Skip to contentSkip to conversation

Is it possible to boot qemu-system-ppc with -kernel?

Qemu-devel Rob Landley 2 participants 3 messages Apr 3, 2007 – Apr 7, 2007

lore
Share & tools
lore
#0 lore raw

I've been trying several variants of:

  qemu-system-ppc -M prep -nographic -hda "ext2.img" -kernel "zImage" \
    -append "rw init=/tools/bin/sh panic=1 PATH=/tools/bin root=/dev/hda
             console=/dev/ttyS0"

My miniconfig is attached. (You can make a full-sized .config out of it with "make allnoconfig KCONFIG_ALLSYMS=miniconfig-linux", I still need to get the miniconfig patch in so there's a better UI.) I'm trying to boot the zImage file that produces.

Unfortunately, I've never managed to boot a ppc kernel under qemu with -kernel. I've got to be doing something wrong, but I don't know what it is. Could you offer any hints?

Here's the output I get:

Quoted 40 lines

Could not configure '/dev/rtc' to have a 1024 Hz timer. This is not a fatal error, but for better emulation accuracy either use a 2.6 host Linux kernel or type 'echo 1024 > /proc/sys/dev/rtc/max-user-freq' as root.
init_ppc_proc: PVR 00040000 mask ffffffff => 00040000
register PCI host 'pci-bridge' 'pci' '<null>' 'PREP Host PCI Bridge - Motorola Raven' register 'pci-bridge' 'pci' '<null>' 'PREP Host PCI Bridge
- Motorola Raven' 0x80000000 in 'device-tree' 0xffffffff Done 582b000 582b880
PCI device '<null>' 0 11 0 has no reg properties:
PCI device '<null>' 0 11 0 has no assigned addresses properties:
register pci device 'Qemu VGA' 0000000c 'display' 'VGA' 'Qemu VGA' register 'Qemu VGA' 'display' 'VGA' 'Qemu VGA' 0x0000000c in 'pci-bridge' 0x80000000 Done 582b880 582b980
PCI device 'Qemu VGA' 0 12 0 reg properties:
addr: 82006010 00000000 f0000000 size: 00000000 00800000
PCI device 'Qemu VGA' 0 12 0 assigned addresses properties:
addr: 82006010 00000000 f0000000 size: 00000000 00800000
PPC Open Hack'Ware BIOS for qemu version 0.4.1
Build 2005-07-06 23:10:57
Copyright 2003-2005 Jocelyn Mayer

Memory size: 144 MB.
Booting from device m
ide0: drive 0: Hard Disk
ERROR: OF_property_copy cannot get property 'hd' for aliases
ide0: drive 1: CD-ROM
ERROR: OF_property_copy cannot get property 'cd' for aliases
ERROR: ATAPI TEST_UNIT_READY : status 41 != 0x40
ide1: drive 0: none
ide1: drive 1: none
Probe partitions for device c
ERROR: No MSDOS signature (0 0 0 0)
Boot partition: 0 9401fff8 9401fff8 0
Probe partitions for device m
ERROR: No MSDOS signature (38 0 0 0)
Use bloc device as raw partition
Boot partition: 0 9401fff8 9401fff8 0
ERROR: OF_property_copy cannot get property 'alias' for <null> boot device: 5833180 image 1000000 size 1106232
ERROR: No MSDOS signature (7f 45 0 0)

Quoted 8 lines

Use bloc device as raw partition
Boot partition: 0 9401fff8 9401fff8 0
boot device: 5833180
ERROR: Found no boot partition!
ERROR: BUG caught...
BIOS execution exception
nip=0x05800000 msr=0x00002000 dar=0x00000000 dsisr=0x00000000 Stopping execution

It's not getting _to_ the kernel. (I tried booting vmlinux instead of bzImage, but it made no difference.)

Thanks,

Rob

Signature · 2 lines
Penguicon 5.0 Apr 20-22, Linux Expo/SF Convention.  Bruce Schneier, Christine 
Peterson, Steve Jackson, Randy Milholland, Elizabeth Bear, Charlie Stross...

CONFIG_PPC_CHRP=y
CONFIG_SWAP=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_LSF=y
CONFIG_BINFMT_ELF=y
CONFIG_PM=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
CONFIG_INET=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_IDE=y
CONFIG_BLK_DEV_IDE=y
CONFIG_BLK_DEV_IDEDISK=y
CONFIG_IDE_GENERIC=y
CONFIG_BLK_DEV_IDEPCI=y
CONFIG_BLK_DEV_GENERIC=y
CONFIG_NETDEVICES=y
CONFIG_NET_ETHERNET=y
CONFIG_NET_PCI=y
CONFIG_NE2K_PCI=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
CONFIG_SQUASHFS=y

#1 lore raw

To boot the prep machine you need to configure the kernel for prep and use the zImage.prep file. IE: CONFIG_PPC_PREP=y

Right now you selected CONFIG_PPC_CHRP

In any kernel > 2.6.20 there is a bug where no PCI interrupts go to sleep and the default prep loader has a size limit.

I worked around this by modifying the prep loader to accept a bigger image, as well as to process the kernel arguments passed by QEMU. So yes it is definitely possible to boot a prep image, but there some tricks. I also only use the serial ports, so I am not certain if the frame buffer actually works.

Jason.

Quoted 100 lines · Rob Landley

I've been trying several variants of:

  qemu-system-ppc -M prep -nographic -hda "ext2.img" -kernel "zImage" \
    -append "rw init=/tools/bin/sh panic=1 PATH=/tools/bin root=/dev/hda
             console=/dev/ttyS0"

My miniconfig is attached. (You can make a full-sized .config out of it with
"make allnoconfig KCONFIG_ALLSYMS=miniconfig-linux", I still need to get the miniconfig patch in so there's a better UI.) I'm trying to boot the zImage file that produces.

Unfortunately, I've never managed to boot a ppc kernel under qemu with -kernel. I've got to be doing something wrong, but I don't know what it is. Could you offer any hints?

Here's the output I get:

Quoted 40 lines

Could not configure '/dev/rtc' to have a 1024 Hz timer. This is not a fatal error, but for better emulation accuracy either use a 2.6 host Linux kernel or type 'echo 1024 > /proc/sys/dev/rtc/max-user-freq' as root.
init_ppc_proc: PVR 00040000 mask ffffffff => 00040000
register PCI host 'pci-bridge' 'pci' '<null>' 'PREP Host PCI Bridge - Motorola Raven' register 'pci-bridge' 'pci' '<null>' 'PREP Host PCI Bridge
- Motorola Raven' 0x80000000 in 'device-tree' 0xffffffff Done 582b000 582b880
PCI device '<null>' 0 11 0 has no reg properties:
PCI device '<null>' 0 11 0 has no assigned addresses properties:
register pci device 'Qemu VGA' 0000000c 'display' 'VGA' 'Qemu VGA' register 'Qemu VGA' 'display' 'VGA' 'Qemu VGA' 0x0000000c in 'pci-bridge' 0x80000000 Done 582b880 582b980
PCI device 'Qemu VGA' 0 12 0 reg properties:
addr: 82006010 00000000 f0000000 size: 00000000 00800000
PCI device 'Qemu VGA' 0 12 0 assigned addresses properties:
addr: 82006010 00000000 f0000000 size: 00000000 00800000
PPC Open Hack'Ware BIOS for qemu version 0.4.1
Build 2005-07-06 23:10:57
Copyright 2003-2005 Jocelyn Mayer

Memory size: 144 MB.
Booting from device m
ide0: drive 0: Hard Disk
ERROR: OF_property_copy cannot get property 'hd' for aliases
ide0: drive 1: CD-ROM
ERROR: OF_property_copy cannot get property 'cd' for aliases
ERROR: ATAPI TEST_UNIT_READY : status 41 != 0x40
ide1: drive 0: none
ide1: drive 1: none
Probe partitions for device c
ERROR: No MSDOS signature (0 0 0 0)
Boot partition: 0 9401fff8 9401fff8 0
Probe partitions for device m
ERROR: No MSDOS signature (38 0 0 0)
Use bloc device as raw partition
Boot partition: 0 9401fff8 9401fff8 0
ERROR: OF_property_copy cannot get property 'alias' for <null> boot device: 5833180 image 1000000 size 1106232
ERROR: No MSDOS signature (7f 45 0 0)

Quoted 9 lines

Use bloc device as raw partition
Boot partition: 0 9401fff8 9401fff8 0
boot device: 5833180
ERROR: Found no boot partition!
ERROR: BUG caught...
BIOS execution exception
nip=0x05800000 msr=0x00002000 dar=0x00000000 dsisr=0x00000000 Stopping execution

It's not getting _to_ the kernel. (I tried booting vmlinux instead of bzImage, but it made no difference.)

Thanks,

Rob

------------------------------------------------------------------------

CONFIG_PPC_CHRP=y
CONFIG_SWAP=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_LSF=y
CONFIG_BINFMT_ELF=y
CONFIG_PM=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
CONFIG_INET=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_IDE=y
CONFIG_BLK_DEV_IDE=y
CONFIG_BLK_DEV_IDEDISK=y
CONFIG_IDE_GENERIC=y
CONFIG_BLK_DEV_IDEPCI=y
CONFIG_BLK_DEV_GENERIC=y
CONFIG_NETDEVICES=y
CONFIG_NET_ETHERNET=y
CONFIG_NET_PCI=y
CONFIG_NE2K_PCI=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
CONFIG_SQUASHFS=y

Signature · 2 lines
Jason Wessel, SMTS Linux Products, Wind River direct +1.630.971.6420
mobile +1.630.715.4615 fax +1.630.971.6433
#2 lore raw
Quoted 5 lines · Jason Wessel

To boot the prep machine you need to configure the kernel for prep and use the zImage.prep file. IE: CONFIG_PPC_PREP=y

Right now you selected CONFIG_PPC_CHRP

In 2.6.20.4 PPC_PREP depends on:
(PPC64 || CLASSIC32) && PPC_MULTIPLATFORM && PPC32 && BROKEN

Broken? Hmmm, removing that from arch/powerpc/Kconfig lets me select it, and then building... And apparently, CONFIG_PPC_PREP doesn't create a zImage?

Ok, back up and try the prep defconfig. cp prep_defconfig to .config, run "make ARCH=powerpc oldconfig" and... yeesh, it prompted for a dozen screens full of stuff (hold down enter)... Try the build... Sigh, go into menuconfig and switch off:

CONFIG_LOCALVERSION_AUTO - Hang build indefinitely waiting for git.

Second verse, same as the first...

Ok, that created arch/powerpc/boot/zImage, zImage.chrp, zImage.coff, zImage.lds, zImage.miboot, and zImage.pmac.

No zImage.prep. How do you create this?

Quoted 5 lines

In any kernel > 2.6.20 there is a bug where no PCI interrupts go to sleep and the default prep loader has a size limit.

I worked around this by modifying the prep loader to accept a bigger image, as well as to process the kernel arguments passed by QEMU.

How did you modify the loader? (Are you talking about making changes to qemu, or to the kernel?)

And you didn't work around the PCI interrupts issue, but got it to boot anyway? (Using initramfs?)

Quoted 4 lines

So
yes it is definitely possible to boot a prep image, but there some tricks. I also only use the serial ports, so I am not certain if the frame buffer actually works.

I'm just trying to get a serial console to work myself...

Quoted 1 line

Jason.

Thanks,

Rob

Signature · 2 lines
Penguicon 5.0 Apr 20-22, Linux Expo/SF Convention.  Bruce Schneier, Christine 
Peterson, Steve Jackson, Randy Milholland, Elizabeth Bear, Charlie Stross...