LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-23-2014, 05:27 PM   #1
jbaramidze
LQ Newbie
 
Registered: Feb 2014
Posts: 2

Rep: Reputation: Disabled
kernel panic on init linux for arm using qemu


Hello
I'm just trying to simulate linux for arm using qemu.
I build linux with this:

make ARCH=arm distclean
make ARCH=arm versatile_defconfig
make ARCH=arm menuconfig
(here I tick "Use the ARM EABI to compile the kernel" and "Allow old ABI binaries to run with this kernel (EXPERIMENTAL)"
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage -j5

after this, I created init like this:
compiled this code:
#include<stdio.h>
int main(){
while(1){
printf("Hello Open World\n");
getchar();
}
}

with "arm-none-linux-gnueabi-gcc hello.c -static -o hello"

then "echo hello | cpio -o --format=newc > rootfs"


and now, when trying to simulate with:
"qemu-system-arm -M versatilepb -m 128m -kernel ~/linux-2.6/arch/arm/boot/uImage -initrd ~/development/arm_codes/rootfs -append "root=/dev/ram rdinit=/hello console=ttyAMA0" -nographic"

gives such log:
audio: Could not init `oss' audio driver
Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0x0
Linux version 3.13.0-rc7+ (jani@jani-Aspire-5742G) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #1 Mon Feb 24 02:01:39 GET 2014
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00093177
CPU: VIVT data cache, VIVT instruction cache
Machine: ARM-Versatile PB
Memory policy: Data cache writeback
sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956969942ns
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32512
Kernel command line: root=/dev/ram rdinit=/hello console=ttyAMA0
PID hash table entries: 512 (order: -1, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 125572K/131072K available (2736K kernel code, 154K rwdata, 716K rodata, 115K init, 115K bss, 5500K reserved)
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
vmalloc : 0xc8800000 - 0xff000000 ( 872 MB)
lowmem : 0xc0000000 - 0xc8000000 ( 128 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.text : 0xc0008000 - 0xc0367430 (3454 kB)
.init : 0xc0368000 - 0xc0384c8c ( 116 kB)
.data : 0xc0386000 - 0xc03ac960 ( 155 kB)
.bss : 0xc03ac960 - 0xc03c98d4 ( 116 kB)
NR_IRQS:224
VIC @f1140000: id 0x00041190, vendor 0x41
FPGA IRQ chip 0 "SIC" @ f1003000, 13 irqs
Console: colour dummy device 80x30
Calibrating delay loop... 479.23 BogoMIPS (lpj=2396160)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
Modified by Jani
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x29a380 - 0x29a3d8
VFP support v0.3: implementor 41 architecture 1 part 10 variant 9 rev 0
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
Serial: AMBA PL011 UART driver
dev:f1: ttyAMA0 at MMIO 0x101f1000 (irq = 44, base_baud = 0) is a PL011 rev1
console [ttyAMA0] enabled
dev:f2: ttyAMA1 at MMIO 0x101f2000 (irq = 45, base_baud = 0) is a PL011 rev1
dev:f3: ttyAMA2 at MMIO 0x101f3000 (irq = 46, base_baud = 0) is a PL011 rev1
fpga:09: ttyAMA3 at MMIO 0x10009000 (irq = 70, base_baud = 0) is a PL011 rev1
bio: create slab <bio-0> at 0
Switched to clocksource timer3
NET: Registered protocol family 2
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP: reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Trying to unpack rootfs image as initramfs...
Freeing initrd memory: 444K (c4000000 - c406f000)
NetWinder 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.
ROMFS MTD (C) 2007 Red Hat, Inc.
msgmni has been set to 246
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
clcd-pl11x dev:20: PL110 rev0 at 0x10120000
clcd-pl11x dev:20: Versatile hardware, VGA display
Console: switching to colour frame buffer device 80x60
brd: module loaded
physmap platform flash device: 04000000 at 34000000
physmap-flash.0: Found 1 x32 devices at 0x0 in 32-bit bank. Manufacturer ID 0x000000 Chip ID 0x000000
Intel/Sharp Extended Query Table at 0x0031
Using buffer write method
smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre <nico@fluxnic.net>
smc91x smc91x.0 eth0: SMC91C11xFD (rev 1) at c89c8000 IRQ 57
[nowait]
smc91x smc91x.0 eth0: Ethernet addr: 52:54:00:12:34:56
mousedev: PS/2 mouse device common for all mice
TCP: cubic registered
NET: Registered protocol family 17
Freeing unused kernel memory: 112K (c0368000 - c0384000)
Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004

CPU: 0 PID: 1 Comm: hello Not tainted 3.13.0-rc7+ #1
[<c0018b20>] (unwind_backtrace+0x0/0xf0) from [<c0016470>] (show_stack+0x10/0x14)
[<c0016470>] (show_stack+0x10/0x14) from [<c02962a0>] (panic+0x80/0x1c8)
[<c02962a0>] (panic+0x80/0x1c8) from [<c0021d3c>] (do_exit+0x75c/0x820)
[<c0021d3c>] (do_exit+0x75c/0x820) from [<c0021ed8>] (do_group_exit+0x48/0xac)
[<c0021ed8>] (do_group_exit+0x48/0xac) from [<c002b484>] (get_signal_to_deliver+0x1a8/0x4a8)
[<c002b484>] (get_signal_to_deliver+0x1a8/0x4a8) from [<c0295d38>] (do_signal+0x9c/0x3c4)
[<c0295d38>] (do_signal+0x9c/0x3c4) from [<c0016020>] (do_work_pending+0xac/0xc8)
[<c0016020>] (do_work_pending+0xac/0xc8) from [<c00138bc>] (work_pending+0xc/0x20)

any help please? THANKS in advance!
 
Old 02-25-2014, 02:39 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,269

Rep: Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314
Not sure what's at the bottom of the stack, but looks like you exited on a signal. I suspect your init needs to be a tad more complex. I doubt if you can print if you don't have a root filesystem or a scheduler running. Maybe take a look at the code under /init in the kernel source.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
help with kernel panic in qemu (arm) larry7 Linux - Embedded & Single-board computer 0 07-30-2012 08:13 AM
[SOLVED] arm linux kernel booting problems with qemu vinodk_gautam Linux - Mobile 1 04-21-2011 12:16 AM
Kernel panic - not syncing: Attempted to kill init! (Embedded ARM Board) ksudeadeye Linux - Embedded & Single-board computer 3 12-12-2008 04:20 PM
Kernel panic - not syncing: Attempted to kill init! (Embedded ARM Board) ksudeadeye Linux From Scratch 1 12-12-2008 02:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration