公司产品基于linux内核开发,对linux-2.6.26内核做了裁剪,添加了部分功能。
现在有需求:需要编译出能够支持ARM Versatile/PB (ARM926EJ-S)的内核。
现在存在问题:
我用标准linux内核2.6.26编译出的内核(格式zImage),在CentOS 7上使用qemu-system-arm模拟arm平台进行启动,可以启动走到加载文件系统的位置,相关打印如下:[root@localhost ~]# qemu-system-arm -M versatilepb -m 512M -kernel /home/g11303/QEMU_simulate_ARM/zImage-2.6.26 -nographic -append "root=/dev/ram console=ttyAMA0 mem=256M"pulseaudio: pa_context_connect() failedpulseaudio: Reason: Connection refusedpulseaudio: Failed to initialize PA contextaudio: Could not init `pa' audio driverALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused
sdl: SDL_OpenAudio failedsdl: Reason: No available audio devicesdl: SDL_OpenAudio failedsdl: Reason: No available audio deviceaudio: Failed to create voice `lm4549.out'Uncompressing Linux....................................................................................... done, booting the kernel.Linux version 2.6.26 (g11303@NFV.COMPILE) (gcc version 4.4.3 (ctng-1.6.1) ) #2 Wed Nov 11 19:17:48 CST 2015CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00093177Machine: ARM-Versatile PBsetup_arch:__atags_pointer = 0x100setup_arch:fixup = 00000000iBankLoop = 0:start = 0, size = 268435456, node = 0.pgprot_kernel=0xefMemory policy: ECC disabled, Data cache writebackiBankLoop = 0:start = 0, size = 268435456, node = 0.check_initrd:phys_initrd_start = 0, phys_initrd_size = 0.come in create_mapping<7>On node 0 totalpages: 65536come in free_area_init_core.PAGE_SHIFT = 12, PAGE_SIZE = 4096, PAGE_MASK = 4294963200.DMA zone: size = 65536, sizeof(struct page) = 32. DMA zone: 512 pages used for memmap DMA zone: 0 pages reserved DMA zone: 65024 pages, LIFO batch:15Normal zone: size = 0, sizeof(struct page) = 32. Normal zone: 0 pages used for memmapMovable zone: size = 0, sizeof(struct page) = 32. Movable zone: 0 pages used for memmapgo out free_area_init_core.bootmem_init:high_memory = 0xd0000000come in create_mappingcome in create_mappingcome in create_mappingcome in create_mappingcome in create_mappingcome in create_mappingcome in local_flush_tlb_all.if TLB_WB.if TLB_V4_D_FULL | TLB_V6_D_FULL.if TLB_V4_I_FULL | TLB_V6_I_FULL.CPU0: D VIVT write-through cacheCPU0: I cache: 4096 bytes, associativity 4, 32 byte lines, 32 setsCPU0: D cache: 65536 bytes, associativity 4, 32 byte lines, 512 setsBuilt 1 zonelists in Zone order, mobility grouping on. Total pages: 65024Kernel command line: root=/dev/ram console=ttyAMA0 mem=256MPID hash table entries: 1024 (order: 10, 4096 bytes)Console: colour dummy device 80x30Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)Memory: 256MB = 256MB totalMemory: 257024KB available (2464K code, 215K data, 100K init)Mount-cache hash table entries: 512CPU: Testing write buffer coherency: oknet_namespace: 192 bytesNET: Registered protocol family 16NET: Registered protocol family 2IP route cache hash table entries: 2048 (order: 1, 8192 bytes)TCP established hash table entries: 8192 (order: 4, 65536 bytes)TCP bind hash table entries: 8192 (order: 3, 32768 bytes)TCP: Hash tables configured (established 8192 bind 8192)TCP reno registeredNET: Registered protocol family 1NetWinder Floating Point Emulator V0.97 (double precision)Installing knfsd (copyright (C) 1996 okir@monad.swb.de).JFFS2 version 2.2. (NAND) ? 2001-2006 Red Hat, Inc.msgmni has been set to 502io scheduler noop registeredio scheduler anticipatory registered (default)io scheduler deadline registeredio scheduler cfq registeredCLCD: Versatile hardware, VGA displayClock CLCDCLK: setting VCO reg params: S=1 R=99 V=98Console: switching to colour frame buffer device 80x60Serial: AMBA PL011 UART driverdev:f1: ttyAMA0 at MMIO 0x101f1000 (irq = 12) is a AMBA/PL011console [ttyAMA0] enableddev:f2: ttyAMA1 at MMIO 0x101f2000 (irq = 13) is a AMBA/PL011dev:f3: ttyAMA2 at MMIO 0x101f3000 (irq = 14) is a AMBA/PL011fpga:09: ttyAMA3 at MMIO 0x10009000 (irq = 38) is a AMBA/PL011brd: module loadedsmc91x.c: v1.1, sep 22 2004 by Nicolas Pitre <nico@cam.org>eth0: SMC91C11xFD (rev 1) at d0866000 IRQ 25 [nowait]eth0: Ethernet addr: 52:54:00:12:34:56armflash.0: Found 1 x32 devices at 0x0 in 32-bit bank Intel/Sharp Extended Query Table at 0x0031Using buffer write methodRedBoot partition parsing not availableafs partition parsing not availablemice: PS/2 mouse device common for all miceinput: AT Raw Set 2 keyboard as /class/input/input0TCP cubic registeredNET: Registered protocol family 17RPC: Registered udp transport module.RPC: Registered tcp transport module.VFP support v0.3: implementor 41 architecture 1 part 10 variant 9 rev 0input: ImExPS/2 Generic Explorer Mouse as /class/input/input1rd_load_image:in_fd = -2initrd_load:err = 0mount_block_root:fs_names = ext2mount_block_root:err = -22mount_block_root:err = -22mount_block_root:err = -22mount_block_root:err = -22List of all partitions:No filesystem could mount root, tried: ext2 cramfs minix romfsKernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)
但是用我们自己代码编译出的内核,启动失败,会挂死在start_kernel->setup_arch->paging_init->devicemaps_init->local_flush_tlb_all处,相关打印如下:
[root@localhost ~]# qemu-system-arm -M versatilepb -m 512M -kernel /home/g11303/QEMU_simulate_ARM/zImage -nographic -append "root=/dev/ram console=ttyAMA0 mem=256M"pulseaudio: pa_context_connect() failedpulseaudio: Reason: Connection refusedpulseaudio: Failed to initialize PA contextaudio: Could not init `pa' audio driverALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused
sdl: SDL_OpenAudio failedsdl: Reason: No available audio devicesdl: SDL_OpenAudio failedsdl: Reason: No available audio deviceaudio: Failed to create voice `lm4549.out'Uncompressing Linux............................................................................................... done, booting the kernel.gyb test!!come in start_kernel.vprintk: NULL exec env (env)smp_setup_processor_id done.init_ve0 done.unwind_init done.lockdep_init done.debug_objects_early_init done.<6>Initializing cgroup subsys cpu <6>donecgroup_init_early done.local_irq_disable done.early_boot_irqs_off done.early_init_irq_lock_class done.lock_kernel done.ub_init_early done.tick_init done.boot_cpu_init done.page_address_init done.<5>Linux version (none) (@) (gcc version 4.4.1 (GCC) ) #60 Wed Nov 11 20:12:38 CST 2015Standard version 0.50processor_id = 0x41069265CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00093177machine_arch_type = 387.Machine: ARM-Versatile PB__atags_pointer = 256, tags = 0xc0000100boot_command_line = root=/dev/ram console=ttyAMA0 mem=256M.Parsing ARGS: root=/dev/ram console=ttyAMA0 mem=256Mparse_cmdline doneprocessor_id = 0x41069265cpu_arch = 7pgprot_kernel=0x4fMemory policy: ECC disabled, Data cache writebackbuild_mem_type_table done<7>On node 0 totalpages: 65536come in free_area_init_core.PAGE_SHIFT = 12, PAGE_SIZE = 4096, PAGE_MASK = 4294963200.DMA zone: size = 65536, sizeof(struct page) = 44.<7> DMA zone: 704 pages used for memmap<7> DMA zone: 0 pages reserved<7> DMA zone: 64832 pages, LIFO batch:15Normal zone: size = 0, sizeof(struct page) = 44.<7> Normal zone: 0 pages used for memmapHighMem zone: size = 0, sizeof(struct page) = 44.<7> HighMem zone: 0 pages used for memmapMovable zone: size = 0, sizeof(struct page) = 44.<7> Movable zone: 0 pages used for memmapgo out free_area_init_core.bootmem_init donePAGE_SIZE = 4096come in versatile_map_io.come in local_flush_tlb_allif TLB_WB.if TLB_V4_D_FULL | TLB_V6_D_FUL.
社区中的达人是否遇到过类似的现象?或者是哪些修改可以引起这个问题?
小弟不太了解这方面的知识,希望各位前辈可以不吝赐教。
可以比较一下2个内核的配置文件: .config
看看是不是有些选项不一样。