【问题】
折腾:
期间,运行kernel出错:
crifan@ubuntu:linux-3.10.7$ pwd /home/crifan/develop/crosscompile/kernel/linux-3.10.7 crifan@ubuntu:linux-3.10.7$ ls arch CREDITS drivers include Kbuild lib mm README scripts System.map virt block crypto firmware init Kconfig MAINTAINERS Module.symvers REPORTING-BUGS security tools vmlinux COPYING Documentation fs ipc kernel Makefile net samples sound usr vmlinux.o crifan@ubuntu:linux-3.10.7$ qemu-system-arm -M versatilepb -kernel arch/arm/boot/zImage -initrd /home/crifan/develop/embedded/qemu/rootfs/initramfs -append "console=tty1" oss: Could not initialize DAC oss: Failed to open `/dev/dsp' oss: Reason: No such file or directory oss: Could not initialize DAC oss: Failed to open `/dev/dsp' oss: Reason: No such file or directory audio: Failed to create voice `lm4549.out'
结果是Kernel Panic – Not syncing : Attempted to kill init :
【解决过程】
1.参考原帖:
Compiling Linux kernel for QEMU ARM emulator
后面的评论,看到:
If the message is “Kernel panic – not syncing: Attempted to kill init!” then it seems that your test program is exiting in some way. – Have you enabled EABI support in the kernel menuconfig? (CONFIG_AEABI=y should be inside the config file) – Maybe there’s something in the system calls of the new toolchain you use that is incompatible with the one I used. I used the 2009-q3-67 one: http://www.codesourcery.com/sgpp/lite/arm/portal/release1039 I will send you the rootfs together with the kernel, if it does not work then the problem could be QEMU. |
所以去:
2.重新不用优化,重新编译一下init:
crifan@ubuntu:rootfs$ arm-xscale-linux-gnueabi-gcc -static -O0 -o init_NoOptmize init.c crifan@ubuntu:rootfs$ file init_NoOptmize init_NoOptmize: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, for GNU/Linux 2.6.19, not stripped
重新弄出那个initramfs:
crifan@ubuntu:rootfs$ echo init_NoOptmize | cpio -o --format=newc > initramfs_NoOptmize 1123 blocks crifan@ubuntu:rootfs$ ls -lha total 2.3M drwxrwxr-x 2 crifan crifan 4.0K Aug 18 23:21 . drwxrwxr-x 6 crifan crifan 4.0K Aug 18 22:50 .. -rwxrwxr-x 1 crifan crifan 561K Aug 18 22:51 init -rw-rw-r-- 1 crifan crifan 77 Aug 18 22:51 init.c -rwxrwxr-x 1 crifan crifan 561K Aug 18 23:19 init_NoOptmize -rw-rw-r-- 1 crifan crifan 562K Aug 18 22:54 initramfs -rw-rw-r-- 1 crifan crifan 562K Aug 18 23:21 initramfs_NoOptmize crifan@ubuntu:rootfs$
3.再去试试,结果出现了那个更常见的错误“VFS Cannot open root device null or unknown block(0,0) error -6”:
所以,通过-O0,没法解决此处问题。
4.再去试试那个:
确保内核中选上了EABI
且另外也在:
中看到此办法。
所以,更该去试试:
make ARCH=arm CROSS_COMPILE=arm-xscale-linux-gnueabi- menuconfig
选上对应的"Kernel Features -> Use the ARM EABI to compile the kernel":
.config – Linux/arm 3.10.7 Kernel Configuration ┌──────────────────────────────────────────────────────────── Kernel Features Memory split (3G/1G user/kernel split) —> [ ] High Memory Support |
如图:
重新编译:
make ARCH=arm CROSS_COMPILE=arm-xscale-linux-gnueabi- all
log如下:
crifan@ubuntu:linux-3.10.7$ make ARCH=arm CROSS_COMPILE=arm-xscale-linux-gnueabi- all scripts/kconfig/conf --silentoldconfig Kconfig CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h make[1]: `include/generated/mach-types.h' is up to date. CC kernel/bounds.s GEN include/generated/bounds.h CC arch/arm/kernel/asm-offsets.s GEN include/generated/asm-offsets.h CALL scripts/checksyscalls.sh CC scripts/mod/empty.o MKELF scripts/mod/elfconfig.h CC scripts/mod/devicetable-offsets.s GEN scripts/mod/devicetable-offsets.h HOSTCC scripts/mod/file2alias.o HOSTCC scripts/mod/modpost.o HOSTCC scripts/mod/sumversion.o HOSTLD scripts/mod/modpost CC init/main.o CHK include/generated/compile.h CC init/version.o CC init/do_mounts.o CC init/do_mounts_rd.o CC init/do_mounts_initrd.o LD init/mounts.o CC init/initramfs.o CC init/calibrate.o CC init/init_task.o LD init/built-in.o AS usr/initramfs_data.o LD usr/built-in.o CC arch/arm/nwfpe/fpa11.o CC arch/arm/nwfpe/fpa11_cpdo.o CC arch/arm/nwfpe/fpa11_cpdt.o CC arch/arm/nwfpe/fpa11_cprt.o CC arch/arm/nwfpe/fpmodule.o CC arch/arm/nwfpe/fpopcode.o CC arch/arm/nwfpe/softfloat.o CC arch/arm/nwfpe/single_cpdo.o CC arch/arm/nwfpe/double_cpdo.o AS arch/arm/nwfpe/entry.o LD arch/arm/nwfpe/nwfpe.o LD arch/arm/nwfpe/built-in.o CC arch/arm/vfp/vfpmodule.o AS arch/arm/vfp/entry.o AS arch/arm/vfp/vfphw.o CC arch/arm/vfp/vfpsingle.o CC arch/arm/vfp/vfpdouble.o LD arch/arm/vfp/vfp.o LD arch/arm/vfp/built-in.o CC arch/arm/kernel/elf.o AS arch/arm/kernel/entry-armv.o AS arch/arm/kernel/entry-common.o CC arch/arm/kernel/irq.o CC arch/arm/kernel/opcodes.o CC arch/arm/kernel/process.o CC arch/arm/kernel/ptrace.o CC arch/arm/kernel/return_address.o arch/arm/kernel/return_address.c:63:2: warning: #warning "TODO: return_address should use unwind tables" [-Wcpp] CC arch/arm/kernel/sched_clock.o CC arch/arm/kernel/setup.o CC arch/arm/kernel/signal.o CC arch/arm/kernel/stacktrace.o CC arch/arm/kernel/sys_arm.o CC arch/arm/kernel/time.o CC arch/arm/kernel/traps.o CC arch/arm/kernel/atags_parse.o CC arch/arm/kernel/armksyms.o CC arch/arm/kernel/module.o AS arch/arm/kernel/sleep.o CC arch/arm/kernel/suspend.o CC arch/arm/kernel/sys_oabi-compat.o CC arch/arm/kernel/unwind.o CC arch/arm/kernel/io.o AS arch/arm/kernel/debug.o LD arch/arm/kernel/built-in.o AS arch/arm/kernel/head.o LDS arch/arm/kernel/vmlinux.lds CC arch/arm/mm/dma-mapping.o CC arch/arm/mm/extable.o CC arch/arm/mm/fault.o CC arch/arm/mm/init.o CC arch/arm/mm/iomap.o CC arch/arm/mm/fault-armv.o CC arch/arm/mm/flush.o CC arch/arm/mm/idmap.o CC arch/arm/mm/ioremap.o CC arch/arm/mm/mmap.o CC arch/arm/mm/pgd.o CC arch/arm/mm/mmu.o CC arch/arm/mm/proc-syms.o CC arch/arm/mm/alignment.o AS arch/arm/mm/abort-ev5tj.o AS arch/arm/mm/pabort-legacy.o CC arch/arm/mm/copypage-v4wb.o AS arch/arm/mm/tlb-v4wbi.o AS arch/arm/mm/proc-arm926.o LD arch/arm/mm/built-in.o CC arch/arm/common/firmware.o CC arch/arm/common/icst.o CC arch/arm/common/timer-sp.o LD arch/arm/common/built-in.o CC arch/arm/mach-versatile/core.o CC arch/arm/mach-versatile/versatile_pb.o CC arch/arm/mach-versatile/versatile_ab.o LD arch/arm/mach-versatile/built-in.o CC arch/arm/plat-versatile/clock.o CC arch/arm/plat-versatile/clcd.o CC arch/arm/plat-versatile/sched-clock.o LD arch/arm/plat-versatile/built-in.o CC kernel/fork.o CC kernel/exec_domain.o CC kernel/panic.o CC kernel/printk.o CC kernel/cpu.o CC kernel/exit.o CC kernel/itimer.o CC kernel/time.o CC kernel/softirq.o CC kernel/resource.o CC kernel/sysctl.o CC kernel/sysctl_binary.o CC kernel/capability.o CC kernel/ptrace.o CC kernel/timer.o CC kernel/user.o CC kernel/signal.o CC kernel/sys.o CC kernel/kmod.o CC kernel/workqueue.o CC kernel/pid.o CC kernel/task_work.o CC kernel/rcupdate.o CC kernel/extable.o CC kernel/params.o CC kernel/posix-timers.o CC kernel/kthread.o CC kernel/wait.o CC kernel/sys_ni.o CC kernel/posix-cpu-timers.o CC kernel/mutex.o CC kernel/hrtimer.o CC kernel/rwsem.o CC kernel/nsproxy.o CC kernel/srcu.o CC kernel/semaphore.o CC kernel/notifier.o CC kernel/ksysfs.o CC kernel/cred.o CC kernel/async.o CC kernel/range.o CC kernel/groups.o CC kernel/lglock.o CC kernel/smpboot.o CC kernel/cpu/idle.o LD kernel/cpu/built-in.o CC kernel/irq/irqdesc.o CC kernel/irq/handle.o CC kernel/irq/manage.o CC kernel/irq/spurious.o CC kernel/irq/resend.o CC kernel/irq/chip.o CC kernel/irq/dummychip.o CC kernel/irq/devres.o CC kernel/irq/autoprobe.o CC kernel/irq/irqdomain.o CC kernel/irq/proc.o CC kernel/irq/pm.o LD kernel/irq/built-in.o CC kernel/power/qos.o CC kernel/power/main.o CC kernel/power/console.o CC kernel/power/process.o CC kernel/power/suspend.o CC kernel/power/poweroff.o LD kernel/power/built-in.o CC kernel/sched/core.o CC kernel/sched/clock.o CC kernel/sched/cputime.o CC kernel/sched/idle_task.o CC kernel/sched/fair.o CC kernel/sched/rt.o CC kernel/sched/stop_task.o CC kernel/sched/debug.o LD kernel/sched/built-in.o CC kernel/time/timekeeping.o CC kernel/time/ntp.o CC kernel/time/clocksource.o CC kernel/time/jiffies.o CC kernel/time/timer_list.o CC kernel/time/timeconv.o CC kernel/time/posix-clock.o CC kernel/time/alarmtimer.o CC kernel/time/clockevents.o CC kernel/time/tick-common.o LD kernel/time/built-in.o CC kernel/freezer.o CC kernel/futex.o CC kernel/rtmutex.o CC kernel/up.o CC kernel/uid16.o CC kernel/module.o CC kernel/kallsyms.o CC kernel/utsname.o CC kernel/pid_namespace.o CC kernel/rcutiny.o CC kernel/utsname_sysctl.o CC kernel/elfcore.o CC kernel/irq_work.o CC kernel/cpu_pm.o LD kernel/built-in.o CC mm/filemap.o CC mm/mempool.o CC mm/oom_kill.o CC mm/fadvise.o CC mm/maccess.o CC mm/page_alloc.o CC mm/page-writeback.o CC mm/readahead.o CC mm/swap.o CC mm/truncate.o CC mm/vmscan.o CC mm/shmem.o CC mm/util.o CC mm/mmzone.o CC mm/vmstat.o CC mm/backing-dev.o CC mm/mm_init.o CC mm/mmu_context.o CC mm/percpu.o CC mm/slab_common.o CC mm/compaction.o CC mm/balloon_compaction.o CC mm/interval_tree.o CC mm/fremap.o CC mm/highmem.o CC mm/madvise.o CC mm/memory.o CC mm/mincore.o CC mm/mlock.o CC mm/mmap.o CC mm/mprotect.o CC mm/mremap.o CC mm/msync.o CC mm/rmap.o CC mm/vmalloc.o CC mm/pagewalk.o CC mm/pgtable-generic.o CC mm/process_vm_access.o CC mm/init-mm.o CC mm/bootmem.o CC mm/memblock.o CC mm/page_io.o CC mm/swap_state.o CC mm/swapfile.o CC mm/dmapool.o CC mm/slab.o CC mm/migrate.o LD mm/built-in.o CC fs/open.o CC fs/read_write.o CC fs/file_table.o CC fs/super.o CC fs/char_dev.o CC fs/stat.o CC fs/exec.o CC fs/pipe.o CC fs/namei.o CC fs/fcntl.o CC fs/ioctl.o CC fs/readdir.o CC fs/select.o CC fs/dcache.o CC fs/inode.o CC fs/attr.o CC fs/bad_inode.o CC fs/file.o CC fs/filesystems.o CC fs/namespace.o CC fs/seq_file.o CC fs/xattr.o CC fs/libfs.o CC fs/fs-writeback.o CC fs/pnode.o CC fs/splice.o CC fs/sync.o CC fs/utimes.o CC fs/stack.o CC fs/fs_struct.o CC fs/statfs.o CC fs/buffer.o CC fs/bio.o CC fs/block_dev.o CC fs/direct-io.o CC fs/mpage.o CC fs/ioprio.o CC fs/proc_namespace.o CC fs/cramfs/inode.o CC fs/cramfs/uncompress.o LD fs/cramfs/cramfs.o LD fs/cramfs/built-in.o CC fs/devpts/inode.o LD fs/devpts/devpts.o LD fs/devpts/built-in.o CC fs/exportfs/expfs.o LD fs/exportfs/exportfs.o LD fs/exportfs/built-in.o CC fs/ext2/balloc.o CC fs/ext2/dir.o CC fs/ext2/file.o CC fs/ext2/ialloc.o CC fs/ext2/inode.o CC fs/ext2/ioctl.o CC fs/ext2/namei.o CC fs/ext2/super.o CC fs/ext2/symlink.o LD fs/ext2/ext2.o LD fs/ext2/built-in.o CC [M] fs/fat/cache.o CC [M] fs/fat/dir.o CC [M] fs/fat/fatent.o CC [M] fs/fat/file.o CC [M] fs/fat/inode.o CC [M] fs/fat/misc.o CC [M] fs/fat/nfs.o CC [M] fs/fat/namei_vfat.o LD [M] fs/fat/fat.o LD [M] fs/fat/vfat.o CC fs/jffs2/compr.o CC fs/jffs2/dir.o CC fs/jffs2/file.o CC fs/jffs2/ioctl.o CC fs/jffs2/nodelist.o CC fs/jffs2/malloc.o CC fs/jffs2/read.o CC fs/jffs2/nodemgmt.o CC fs/jffs2/readinode.o CC fs/jffs2/write.o CC fs/jffs2/scan.o CC fs/jffs2/gc.o CC fs/jffs2/symlink.o CC fs/jffs2/build.o CC fs/jffs2/erase.o CC fs/jffs2/background.o CC fs/jffs2/fs.o CC fs/jffs2/writev.o CC fs/jffs2/super.o CC fs/jffs2/debug.o CC fs/jffs2/wbuf.o CC fs/jffs2/compr_rtime.o CC fs/jffs2/compr_zlib.o LD fs/jffs2/jffs2.o LD fs/jffs2/built-in.o CC fs/lockd/clntlock.o CC fs/lockd/clntproc.o CC fs/lockd/clntxdr.o CC fs/lockd/host.o CC fs/lockd/svc.o CC fs/lockd/svclock.o CC fs/lockd/svcshare.o CC fs/lockd/svcproc.o CC fs/lockd/svcsubs.o CC fs/lockd/mon.o CC fs/lockd/xdr.o CC fs/lockd/grace.o CC fs/lockd/clnt4xdr.o CC fs/lockd/xdr4.o CC fs/lockd/svc4proc.o LD fs/lockd/lockd.o LD fs/lockd/built-in.o CC fs/minix/bitmap.o CC fs/minix/itree_v1.o CC fs/minix/itree_v2.o CC fs/minix/namei.o CC fs/minix/inode.o CC fs/minix/file.o CC fs/minix/dir.o LD fs/minix/minix.o LD fs/minix/built-in.o CC fs/nfs/client.o CC fs/nfs/dir.o CC fs/nfs/file.o CC fs/nfs/getroot.o CC fs/nfs/inode.o CC fs/nfs/super.o CC fs/nfs/direct.o CC fs/nfs/pagelist.o CC fs/nfs/read.o CC fs/nfs/symlink.o CC fs/nfs/unlink.o CC fs/nfs/write.o CC fs/nfs/namespace.o CC fs/nfs/mount_clnt.o CC fs/nfs/dns_resolve.o CC fs/nfs/cache_lib.o CC fs/nfs/nfsroot.o CC fs/nfs/sysctl.o CC fs/nfs/nfs2super.o CC fs/nfs/proc.o CC fs/nfs/nfs2xdr.o CC fs/nfs/nfs3super.o CC fs/nfs/nfs3client.o CC fs/nfs/nfs3proc.o CC fs/nfs/nfs3xdr.o LD fs/nfs/nfs.o LD fs/nfs/nfsv2.o LD fs/nfs/nfsv3.o LD fs/nfs/built-in.o CC fs/nfsd/nfssvc.o CC fs/nfsd/nfsctl.o CC fs/nfsd/nfsproc.o CC fs/nfsd/nfsfh.o CC fs/nfsd/vfs.o CC fs/nfsd/export.o CC fs/nfsd/auth.o CC fs/nfsd/lockd.o CC fs/nfsd/nfscache.o CC fs/nfsd/nfsxdr.o CC fs/nfsd/stats.o CC fs/nfsd/nfs3proc.o CC fs/nfsd/nfs3xdr.o LD fs/nfsd/nfsd.o LD fs/nfsd/built-in.o CC [M] fs/nls/nls_base.o CC [M] fs/nls/nls_cp850.o CC [M] fs/nls/nls_iso8859-1.o CC fs/notify/fsnotify.o CC fs/notify/notification.o CC fs/notify/group.o CC fs/notify/inode_mark.o CC fs/notify/mark.o CC fs/notify/vfsmount_mark.o CC fs/notify/fdinfo.o CC fs/notify/dnotify/dnotify.o LD fs/notify/dnotify/built-in.o CC fs/notify/inotify/inotify_fsnotify.o CC fs/notify/inotify/inotify_user.o LD fs/notify/inotify/built-in.o LD fs/notify/built-in.o CC fs/proc/task_mmu.o CC fs/proc/inode.o CC fs/proc/root.o CC fs/proc/base.o CC fs/proc/generic.o CC fs/proc/array.o CC fs/proc/fd.o CC fs/proc/proc_tty.o CC fs/proc/cmdline.o CC fs/proc/consoles.o CC fs/proc/cpuinfo.o CC fs/proc/devices.o CC fs/proc/interrupts.o CC fs/proc/loadavg.o CC fs/proc/meminfo.o CC fs/proc/stat.o CC fs/proc/uptime.o CC fs/proc/version.o CC fs/proc/softirqs.o CC fs/proc/namespaces.o CC fs/proc/self.o CC fs/proc/proc_sysctl.o CC fs/proc/proc_net.o CC fs/proc/kmsg.o CC fs/proc/page.o LD fs/proc/proc.o LD fs/proc/built-in.o CC fs/ramfs/inode.o CC fs/ramfs/file-mmu.o LD fs/ramfs/ramfs.o LD fs/ramfs/built-in.o CC fs/romfs/storage.o CC fs/romfs/super.o LD fs/romfs/romfs.o LD fs/romfs/built-in.o CC fs/sysfs/inode.o CC fs/sysfs/file.o CC fs/sysfs/dir.o CC fs/sysfs/symlink.o CC fs/sysfs/mount.o CC fs/sysfs/bin.o CC fs/sysfs/group.o LD fs/sysfs/built-in.o CC fs/eventpoll.o CC fs/anon_inodes.o CC fs/signalfd.o CC fs/timerfd.o CC fs/eventfd.o CC fs/aio.o CC fs/locks.o CC fs/binfmt_script.o CC fs/binfmt_elf.o CC fs/coredump.o CC fs/drop_caches.o LD fs/built-in.o CC ipc/util.o CC ipc/msgutil.o CC ipc/msg.o CC ipc/sem.o CC ipc/shm.o CC ipc/ipcns_notifier.o CC ipc/syscall.o CC ipc/ipc_sysctl.o CC ipc/namespace.o LD ipc/built-in.o CC security/commoncap.o CC security/min_addr.o LD security/built-in.o CC crypto/api.o CC crypto/cipher.o CC crypto/compress.o CC crypto/algapi.o CC crypto/scatterwalk.o CC crypto/proc.o LD crypto/crypto.o LD crypto/crypto_algapi.o CC crypto/aes_generic.o LD crypto/built-in.o CC [M] crypto/rng.o CC [M] crypto/krng.o CC [M] crypto/ansi_cprng.o CC block/elevator.o CC block/blk-core.o CC block/blk-tag.o CC block/blk-sysfs.o CC block/blk-flush.o CC block/blk-settings.o CC block/blk-ioc.o CC block/blk-map.o CC block/blk-exec.o CC block/blk-merge.o CC block/blk-softirq.o CC block/blk-timeout.o CC block/blk-iopoll.o CC block/blk-lib.o CC block/ioctl.o CC block/genhd.o CC block/scsi_ioctl.o CC block/partition-generic.o CC block/partitions/check.o CC block/partitions/msdos.o CC block/partitions/efi.o LD block/partitions/built-in.o CC block/bsg.o CC block/noop-iosched.o CC block/deadline-iosched.o CC block/cfq-iosched.o LD block/built-in.o CC drivers/amba/bus.o LD drivers/amba/built-in.o CC drivers/base/core.o CC drivers/base/bus.o CC drivers/base/dd.o CC drivers/base/syscore.o CC drivers/base/driver.o CC drivers/base/class.o CC drivers/base/platform.o CC drivers/base/cpu.o CC drivers/base/firmware.o CC drivers/base/init.o CC drivers/base/map.o CC drivers/base/devres.o CC drivers/base/attribute_container.o CC drivers/base/transport_class.o CC drivers/base/topology.o CC drivers/base/power/sysfs.o CC drivers/base/power/generic_ops.o CC drivers/base/power/common.o CC drivers/base/power/qos.o CC drivers/base/power/main.o CC drivers/base/power/wakeup.o CC drivers/base/power/clock_ops.o LD drivers/base/power/built-in.o CC drivers/base/dma-mapping.o CC drivers/base/dma-coherent.o CC drivers/base/firmware_class.o CC drivers/base/module.o LD drivers/base/built-in.o CC drivers/block/brd.o LD drivers/block/built-in.o CC drivers/char/mem.o CC drivers/char/random.o CC drivers/char/misc.o LD drivers/char/built-in.o CC [M] drivers/char/hw_random/core.o LD [M] drivers/char/hw_random/rng-core.o CC drivers/clk/clk-devres.o CC drivers/clk/clkdev.o LD drivers/clk/built-in.o CC drivers/clocksource/mmio.o LD drivers/clocksource/built-in.o CC drivers/gpio/devres.o LD drivers/gpio/built-in.o CC drivers/hid/hid-lg.o CC drivers/hid/hid-core.o CC drivers/hid/hid-input.o LD drivers/hid/hid.o CC drivers/hid/hid-generic.o CC drivers/hid/hid-a4tech.o CC drivers/hid/hid-apple.o CC drivers/hid/hid-belkin.o CC drivers/hid/hid-cherry.o CC drivers/hid/hid-chicony.o CC drivers/hid/hid-cypress.o CC drivers/hid/hid-ezkey.o CC drivers/hid/hid-kensington.o LD drivers/hid/hid-logitech.o CC drivers/hid/hid-microsoft.o CC drivers/hid/hid-monterey.o LD drivers/hid/built-in.o CC drivers/i2c/i2c-boardinfo.o CC drivers/i2c/i2c-core.o LD drivers/i2c/built-in.o CC [M] drivers/i2c/i2c-dev.o CC drivers/input/input.o CC drivers/input/input-compat.o CC drivers/input/input-mt.o CC drivers/input/ff-core.o LD drivers/input/input-core.o CC drivers/input/mousedev.o CC drivers/input/keyboard/atkbd.o LD drivers/input/keyboard/built-in.o CC drivers/input/mouse/psmouse-base.o CC drivers/input/mouse/synaptics.o CC drivers/input/mouse/alps.o CC drivers/input/mouse/logips2pp.o CC drivers/input/mouse/trackpoint.o CC drivers/input/mouse/cypress_ps2.o LD drivers/input/mouse/psmouse.o LD drivers/input/mouse/built-in.o LD drivers/input/built-in.o CC drivers/input/serio/serio.o CC drivers/input/serio/ambakmi.o CC drivers/input/serio/libps2.o LD drivers/input/serio/built-in.o CC drivers/irqchip/irq-vic.o CC drivers/irqchip/irq-versatile-fpga.o LD drivers/irqchip/built-in.o CC [M] drivers/misc/eeprom/eeprom.o CC drivers/mmc/card/block.o CC drivers/mmc/card/queue.o LD drivers/mmc/card/mmc_block.o LD drivers/mmc/card/built-in.o CC drivers/mmc/core/core.o CC drivers/mmc/core/bus.o CC drivers/mmc/core/host.o CC drivers/mmc/core/mmc.o CC drivers/mmc/core/mmc_ops.o CC drivers/mmc/core/sd.o CC drivers/mmc/core/sd_ops.o CC drivers/mmc/core/sdio.o CC drivers/mmc/core/sdio_ops.o CC drivers/mmc/core/sdio_bus.o CC drivers/mmc/core/sdio_cis.o CC drivers/mmc/core/sdio_io.o CC drivers/mmc/core/sdio_irq.o CC drivers/mmc/core/quirks.o CC drivers/mmc/core/slot-gpio.o LD drivers/mmc/core/mmc_core.o LD drivers/mmc/core/built-in.o CC [M] drivers/mmc/host/mmci.o LD drivers/mmc/built-in.o CC drivers/mtd/mtdcore.o CC drivers/mtd/mtdsuper.o CC drivers/mtd/mtdconcat.o CC drivers/mtd/mtdpart.o CC drivers/mtd/mtdchar.o LD drivers/mtd/mtd.o CC drivers/mtd/cmdlinepart.o CC drivers/mtd/mtd_blkdevs.o CC drivers/mtd/mtdblock.o CC drivers/mtd/chips/chipreg.o CC drivers/mtd/chips/cfi_probe.o CC drivers/mtd/chips/cfi_util.o CC drivers/mtd/chips/cfi_cmdset_0001.o CC drivers/mtd/chips/gen_probe.o LD drivers/mtd/chips/built-in.o CC drivers/mtd/maps/physmap.o LD drivers/mtd/maps/built-in.o LD drivers/mtd/built-in.o CC drivers/net/mii.o CC drivers/net/Space.o CC drivers/net/loopback.o CC drivers/net/tun.o CC drivers/net/ethernet/smsc/smc91x.o LD drivers/net/ethernet/smsc/built-in.o LD drivers/net/ethernet/built-in.o LD drivers/net/built-in.o CC drivers/rtc/rtc-lib.o LD drivers/rtc/built-in.o CC drivers/tty/tty_io.o CC drivers/tty/n_tty.o CC drivers/tty/tty_ioctl.o CC drivers/tty/tty_ldisc.o CC drivers/tty/tty_buffer.o CC drivers/tty/tty_port.o CC drivers/tty/tty_mutex.o CC drivers/tty/pty.o CC drivers/tty/sysrq.o CC drivers/tty/serial/serial_core.o CC drivers/tty/serial/amba-pl011.o LD drivers/tty/serial/built-in.o CC [M] drivers/tty/serial/8250/8250_core.o LD [M] drivers/tty/serial/8250/8250.o CC drivers/tty/vt/vt_ioctl.o CC drivers/tty/vt/vc_screen.o CC drivers/tty/vt/selection.o CC drivers/tty/vt/keyboard.o CC drivers/tty/vt/consolemap.o CC drivers/tty/vt/consolemap_deftbl.o CC drivers/tty/vt/vt.o CC drivers/tty/vt/defkeymap.o LD drivers/tty/vt/built-in.o LD drivers/tty/built-in.o CC drivers/video/fb_notify.o CC drivers/video/fbmem.o CC drivers/video/fbmon.o CC drivers/video/fbcmap.o CC drivers/video/fbsysfs.o CC drivers/video/modedb.o CC drivers/video/fbcvt.o LD drivers/video/fb.o CC drivers/video/console/fonts.o CC drivers/video/console/font_acorn_8x8.o LD drivers/video/console/font.o CC drivers/video/console/dummycon.o CC drivers/video/console/fbcon.o CC drivers/video/console/bitblit.o CC drivers/video/console/softcursor.o LD drivers/video/console/built-in.o CC drivers/video/cfbfillrect.o CC drivers/video/cfbcopyarea.o CC drivers/video/cfbimgblt.o CC drivers/video/amba-clcd.o LD drivers/video/built-in.o LD drivers/built-in.o CC sound/sound_core.o LD sound/soundcore.o LD sound/built-in.o CC [M] sound/ac97_bus.o CC [M] sound/arm/aaci.o LD [M] sound/arm/snd-aaci.o CC [M] sound/core/oss/mixer_oss.o CC [M] sound/core/oss/pcm_oss.o CC [M] sound/core/oss/pcm_plugin.o CC [M] sound/core/oss/io.o CC [M] sound/core/oss/copy.o CC [M] sound/core/oss/linear.o CC [M] sound/core/oss/mulaw.o CC [M] sound/core/oss/route.o CC [M] sound/core/oss/rate.o LD [M] sound/core/oss/snd-mixer-oss.o LD [M] sound/core/oss/snd-pcm-oss.o CC [M] sound/core/memalloc.o CC [M] sound/core/pcm.o CC [M] sound/core/pcm_native.o CC [M] sound/core/pcm_lib.o CC [M] sound/core/pcm_timer.o CC [M] sound/core/pcm_misc.o CC [M] sound/core/pcm_memory.o CC [M] sound/core/timer.o CC [M] sound/core/sound.o CC [M] sound/core/init.o CC [M] sound/core/memory.o CC [M] sound/core/info.o CC [M] sound/core/control.o CC [M] sound/core/misc.o CC [M] sound/core/device.o CC [M] sound/core/sound_oss.o CC [M] sound/core/info_oss.o CC [M] sound/core/vmaster.o LD [M] sound/core/snd.o LD [M] sound/core/snd-timer.o LD [M] sound/core/snd-pcm.o LD [M] sound/core/snd-page-alloc.o CC [M] sound/pci/ac97/ac97_codec.o CC [M] sound/pci/ac97/ac97_pcm.o CC [M] sound/pci/ac97/ac97_proc.o LD [M] sound/pci/ac97/snd-ac97-codec.o CC net/socket.o CC net/core/sock.o CC net/core/request_sock.o CC net/core/skbuff.o CC net/core/iovec.o CC net/core/datagram.o CC net/core/stream.o CC net/core/scm.o CC net/core/gen_stats.o CC net/core/gen_estimator.o CC net/core/net_namespace.o CC net/core/secure_seq.o CC net/core/flow_dissector.o CC net/core/sysctl_net_core.o CC net/core/dev.o CC net/core/ethtool.o CC net/core/dev_addr_lists.o CC net/core/dst.o CC net/core/netevent.o CC net/core/neighbour.o CC net/core/rtnetlink.o CC net/core/utils.o CC net/core/link_watch.o CC net/core/filter.o CC net/core/sock_diag.o CC net/core/dev_ioctl.o CC net/core/flow.o CC net/core/net-sysfs.o CC net/core/net-procfs.o LD net/core/built-in.o CC net/ethernet/eth.o LD net/ethernet/built-in.o CC net/ipv4/route.o CC net/ipv4/inetpeer.o CC net/ipv4/protocol.o CC net/ipv4/ip_input.o CC net/ipv4/ip_fragment.o CC net/ipv4/ip_forward.o CC net/ipv4/ip_options.o CC net/ipv4/ip_output.o CC net/ipv4/ip_sockglue.o CC net/ipv4/inet_hashtables.o CC net/ipv4/inet_timewait_sock.o CC net/ipv4/inet_connection_sock.o CC net/ipv4/tcp.o CC net/ipv4/tcp_input.o CC net/ipv4/tcp_output.o CC net/ipv4/tcp_timer.o CC net/ipv4/tcp_ipv4.o CC net/ipv4/tcp_minisocks.o CC net/ipv4/tcp_cong.o CC net/ipv4/tcp_metrics.o CC net/ipv4/tcp_fastopen.o CC net/ipv4/datagram.o CC net/ipv4/raw.o CC net/ipv4/udp.o CC net/ipv4/udplite.o CC net/ipv4/arp.o CC net/ipv4/icmp.o CC net/ipv4/devinet.o CC net/ipv4/af_inet.o CC net/ipv4/igmp.o CC net/ipv4/fib_frontend.o CC net/ipv4/fib_semantics.o CC net/ipv4/fib_trie.o CC net/ipv4/inet_fragment.o CC net/ipv4/ping.o CC net/ipv4/sysctl_net_ipv4.o CC net/ipv4/proc.o CC net/ipv4/xfrm4_mode_beet.o CC net/ipv4/inet_lro.o CC net/ipv4/xfrm4_mode_transport.o CC net/ipv4/xfrm4_mode_tunnel.o CC net/ipv4/ipconfig.o CC net/ipv4/tcp_cubic.o CC net/ipv4/xfrm4_policy.o CC net/ipv4/xfrm4_state.o CC net/ipv4/xfrm4_input.o CC net/ipv4/xfrm4_output.o LD net/ipv4/built-in.o CC net/ipv6/addrconf_core.o CC net/ipv6/exthdrs_core.o CC net/ipv6/ip6_checksum.o CC net/ipv6/ip6_icmp.o CC net/ipv6/output_core.o CC net/ipv6/protocol.o CC net/ipv6/ip6_offload.o CC net/ipv6/tcpv6_offload.o CC net/ipv6/udp_offload.o CC net/ipv6/exthdrs_offload.o LD net/ipv6/built-in.o CC net/netlink/af_netlink.o CC net/netlink/genetlink.o LD net/netlink/built-in.o CC net/packet/af_packet.o LD net/packet/built-in.o CC net/sched/sch_generic.o CC net/sched/sch_mq.o LD net/sched/built-in.o CC net/sunrpc/clnt.o CC net/sunrpc/xprt.o CC net/sunrpc/socklib.o CC net/sunrpc/xprtsock.o CC net/sunrpc/sched.o CC net/sunrpc/auth.o CC net/sunrpc/auth_null.o CC net/sunrpc/auth_unix.o CC net/sunrpc/auth_generic.o CC net/sunrpc/svc.o CC net/sunrpc/svcsock.o CC net/sunrpc/svcauth.o CC net/sunrpc/svcauth_unix.o CC net/sunrpc/addr.o CC net/sunrpc/rpcb_clnt.o CC net/sunrpc/timer.o CC net/sunrpc/xdr.o CC net/sunrpc/sunrpc_syms.o CC net/sunrpc/cache.o CC net/sunrpc/rpc_pipe.o CC net/sunrpc/svc_xprt.o CC net/sunrpc/stats.o CC net/sunrpc/sysctl.o LD net/sunrpc/sunrpc.o LD net/sunrpc/built-in.o CC net/unix/af_unix.o CC net/unix/garbage.o CC net/unix/sysctl_net_unix.o LD net/unix/unix.o LD net/unix/built-in.o CC net/xfrm/xfrm_policy.o CC net/xfrm/xfrm_state.o CC net/xfrm/xfrm_hash.o CC net/xfrm/xfrm_input.o CC net/xfrm/xfrm_output.o CC net/xfrm/xfrm_sysctl.o CC net/xfrm/xfrm_replay.o LD net/xfrm/built-in.o CC net/sysctl_net.o LD net/built-in.o AS arch/arm/lib/ashldi3.o AS arch/arm/lib/ashrdi3.o AS arch/arm/lib/backtrace.o AS arch/arm/lib/call_with_stack.o AS arch/arm/lib/changebit.o AS arch/arm/lib/clear_user.o AS arch/arm/lib/clearbit.o AS arch/arm/lib/copy_from_user.o AS arch/arm/lib/copy_page.o AS arch/arm/lib/copy_to_user.o AS arch/arm/lib/csumipv6.o AS arch/arm/lib/csumpartial.o AS arch/arm/lib/csumpartialcopy.o AS arch/arm/lib/csumpartialcopyuser.o AS arch/arm/lib/delay-loop.o CC arch/arm/lib/delay.o AS arch/arm/lib/div64.o AS arch/arm/lib/findbit.o AS arch/arm/lib/getuser.o AS arch/arm/lib/io-readsb.o AS arch/arm/lib/io-readsl.o AS arch/arm/lib/io-readsw-armv4.o AS arch/arm/lib/io-writesb.o AS arch/arm/lib/io-writesl.o AS arch/arm/lib/io-writesw-armv4.o AS arch/arm/lib/lib1funcs.o AS arch/arm/lib/lshrdi3.o AS arch/arm/lib/memchr.o AS arch/arm/lib/memcpy.o AS arch/arm/lib/memmove.o AS arch/arm/lib/memset.o AS arch/arm/lib/memzero.o AS arch/arm/lib/muldi3.o AS arch/arm/lib/putuser.o AS arch/arm/lib/setbit.o AS arch/arm/lib/strchr.o AS arch/arm/lib/strrchr.o AS arch/arm/lib/testchangebit.o AS arch/arm/lib/testclearbit.o AS arch/arm/lib/testsetbit.o AS arch/arm/lib/ucmpdi2.o AR arch/arm/lib/lib.a CC lib/bcd.o CC lib/div64.o CC lib/sort.o CC lib/parser.o CC lib/halfmd4.o CC lib/debug_locks.o CC lib/random32.o CC lib/bust_spinlocks.o CC lib/hexdump.o CC lib/kasprintf.o CC lib/bitmap.o CC lib/scatterlist.o CC lib/gcd.o CC lib/lcm.o CC lib/list_sort.o CC lib/uuid.o CC lib/flex_array.o CC lib/iovec.o CC lib/bsearch.o CC lib/find_last_bit.o CC lib/find_next_bit.o CC lib/llist.o CC lib/memweight.o CC lib/kfifo.o CC lib/string_helpers.o CC lib/kstrtox.o CC lib/pci_iomap.o CC lib/iomap_copy.o CC lib/devres.o CC lib/hweight.o CC lib/bitrev.o CC lib/crc32.o CC lib/lzo/lzo1x_decompress_safe.o LD lib/lzo/lzo_decompress.o LD lib/lzo/built-in.o CC lib/xz/xz_dec_syms.o CC lib/xz/xz_dec_stream.o CC lib/xz/xz_dec_lzma2.o CC lib/xz/xz_dec_bcj.o LD lib/xz/xz_dec.o LD lib/xz/built-in.o CC lib/zlib_deflate/deflate.o CC lib/zlib_deflate/deftree.o CC lib/zlib_deflate/deflate_syms.o LD lib/zlib_deflate/zlib_deflate.o LD lib/zlib_deflate/built-in.o CC lib/zlib_inflate/inffast.o CC lib/zlib_inflate/inflate.o CC lib/zlib_inflate/infutil.o CC lib/zlib_inflate/inftrees.o CC lib/zlib_inflate/inflate_syms.o LD lib/zlib_inflate/zlib_inflate.o LD lib/zlib_inflate/built-in.o CC lib/syscall.o CC lib/nlattr.o CC lib/atomic64.o CC lib/dynamic_queue_limits.o CC lib/strncpy_from_user.o CC lib/strnlen_user.o LD lib/built-in.o CC lib/argv_split.o CC lib/bug.o CC lib/cmdline.o CC lib/ctype.o CC lib/dec_and_lock.o CC lib/decompress.o CC lib/decompress_bunzip2.o CC lib/decompress_inflate.o CC lib/decompress_unlzma.o CC lib/decompress_unlzo.o CC lib/decompress_unxz.o CC lib/dump_stack.o CC lib/earlycpio.o CC lib/extable.o CC lib/flex_proportions.o CC lib/idr.o CC lib/int_sqrt.o CC lib/ioremap.o CC lib/irq_regs.o CC lib/is_single_threaded.o CC lib/klist.o CC lib/kobject.o CC lib/kobject_uevent.o CC lib/md5.o CC lib/plist.o CC lib/prio_heap.o CC lib/proportions.o CC lib/radix-tree.o CC lib/ratelimit.o CC lib/rbtree.o CC lib/reciprocal_div.o CC lib/rwsem-spinlock.o CC lib/sha1.o CC lib/show_mem.o CC lib/string.o CC lib/timerqueue.o CC lib/vsprintf.o AR lib/lib.a LINK vmlinux LD vmlinux.o MODPOST vmlinux.o GEN .version CHK include/generated/compile.h UPD include/generated/compile.h CC init/version.o LD init/built-in.o KSYM .tmp_kallsyms1.o KSYM .tmp_kallsyms2.o LD vmlinux SORTEX vmlinux SYSMAP System.map OBJCOPY arch/arm/boot/Image Kernel: arch/arm/boot/Image is ready AS arch/arm/boot/compressed/head.o GZIP arch/arm/boot/compressed/piggy.gzip AS arch/arm/boot/compressed/piggy.gzip.o CC arch/arm/boot/compressed/misc.o CC arch/arm/boot/compressed/decompress.o CC arch/arm/boot/compressed/string.o AS arch/arm/boot/compressed/lib1funcs.o AS arch/arm/boot/compressed/ashldi3.o LD arch/arm/boot/compressed/vmlinux OBJCOPY arch/arm/boot/zImage Kernel: arch/arm/boot/zImage is ready Building modules, stage 2. MODPOST 22 modules CC crypto/ansi_cprng.mod.o LD [M] crypto/ansi_cprng.ko CC crypto/krng.mod.o LD [M] crypto/krng.ko CC crypto/rng.mod.o LD [M] crypto/rng.ko CC drivers/char/hw_random/rng-core.mod.o LD [M] drivers/char/hw_random/rng-core.ko CC drivers/i2c/i2c-dev.mod.o LD [M] drivers/i2c/i2c-dev.ko CC drivers/misc/eeprom/eeprom.mod.o LD [M] drivers/misc/eeprom/eeprom.ko CC drivers/mmc/host/mmci.mod.o LD [M] drivers/mmc/host/mmci.ko CC drivers/tty/serial/8250/8250.mod.o LD [M] drivers/tty/serial/8250/8250.ko CC fs/fat/fat.mod.o LD [M] fs/fat/fat.ko CC fs/fat/vfat.mod.o LD [M] fs/fat/vfat.ko CC fs/nls/nls_base.mod.o LD [M] fs/nls/nls_base.ko CC fs/nls/nls_cp850.mod.o LD [M] fs/nls/nls_cp850.ko CC fs/nls/nls_iso8859-1.mod.o LD [M] fs/nls/nls_iso8859-1.ko CC sound/ac97_bus.mod.o LD [M] sound/ac97_bus.ko CC sound/arm/snd-aaci.mod.o LD [M] sound/arm/snd-aaci.ko CC sound/core/oss/snd-mixer-oss.mod.o LD [M] sound/core/oss/snd-mixer-oss.ko CC sound/core/oss/snd-pcm-oss.mod.o LD [M] sound/core/oss/snd-pcm-oss.ko CC sound/core/snd-page-alloc.mod.o LD [M] sound/core/snd-page-alloc.ko CC sound/core/snd-pcm.mod.o LD [M] sound/core/snd-pcm.ko CC sound/core/snd-timer.mod.o LD [M] sound/core/snd-timer.ko CC sound/core/snd.mod.o LD [M] sound/core/snd.ko CC sound/pci/ac97/snd-ac97-codec.mod.o LD [M] sound/pci/ac97/snd-ac97-codec.ko crifan@ubuntu:linux-3.10.7$
5.然后重新运行之前的initramfs试试:
crifan@ubuntu:rootfs$ ls -lha total 2.3M drwxrwxr-x 2 crifan crifan 4.0K Aug 18 23:21 . drwxrwxr-x 6 crifan crifan 4.0K Aug 18 22:50 .. -rwxrwxr-x 1 crifan crifan 561K Aug 18 22:51 init -rw-rw-r-- 1 crifan crifan 77 Aug 18 22:51 init.c -rwxrwxr-x 1 crifan crifan 561K Aug 18 23:19 init_NoOptmize -rw-rw-r-- 1 crifan crifan 562K Aug 18 22:54 initramfs -rw-rw-r-- 1 crifan crifan 562K Aug 18 23:21 initramfs_NoOptmize crifan@ubuntu:rootfs$ qemu-system-arm -M versatilepb -kernel /home/crifan/develop/crosscompile/kernel/linux-3.10.7/arch/arm/boot/zImage -initrd initramfs -append "console=tty1"
结果是正常了,可以看到输出了hello world了:
【总结】
此处,QEMU中,去运行内核,结果出现:
Kernel Panic – Not syncing : Attempted to kill init |
的错误的:
原因:
所用的内核,不是EABI的。
解决办法:
所以重新去menuconfig配置:
make ARCH=arm CROSS_COMPILE=arm-xscale-linux-gnueabi- menuconfig
选上对应的EABI:
Kernel Features -> [*] Use the ARM EABI to compile the kernel |
重新编译一个EABI的kernel,即可。
转载请注明:在路上 » 【已解决】QEMU运行kernel出错:Kernel Panic – Not syncing : Attempted to kill init