I am working on trying to emulate this old media server I received that runs 2.6.38 Linux cross compiled to PowerPC using buildroot and qemu (using the kernel config files I was able to pull from the device). I have had success cross compiling kernels before using buildroot, but never one as old as 2.6.x. Going through all the typical steps (notably setting the Linux version to custom 2.6.38, the headers to 2.6.x and using the qemu_ppc_g3beige_defconfig
config), I am able to successfully compile the kernel and obtain the rootfs and vmlinux images. Using the start-qemu.sh automatically generated does not crash QEMU, but it hangs on boot (it does not even enter the kernel boot process).
The only thing I can think of that differs between this and previous builds I have used for Buildroot is that this kernel configuration has CONFIG_PREEMPT set, but to my knowledge QEMU has no limitations for a preempted kernel.
For reference I ran the following commands:
$ make qemu_ppc_g3beige_defconfig
$ make menuconfig
...
BR2_KERNEL_CUSTOM_CONFIG_FILE="/path/to/my/kernel.config
BR2_TARGET_GENERIC_ROOT_PASSWD="root"
BR2_PACKAGE_LINUX_HEADER=y
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_REALLY_OLD=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="2.6.38"
...
$ make linux-menuconfig
...
CONFIG_PREEMPT=y
...
$ make
$ qemu-system-pcc -M g3beige -kernel vmlinux -drive file=rootfs.ext2,format=raw -append "console=ttyS0 rootwait root=/dev/hda" -net nic,model=rtl8139 -net user -serial stdio
Output I received:
>> ==============================================================
>> OpenBIOS 1.1 [Feb 22 2018 00:53]
>> Configuration device id QEMU version 1 machine id 2
>> CPUs: 1
>> Memory: 128M
>> UUID: 00000000-0000-0000-0000-000000000000
>> CPU type PowerPC-750
milliseconds isn't unique
>> [ppc] Kernel already loaded (0x1000000 + 0x005734e8) (initrd 0x00000000 + 0x00000000)
>> [ppc] Kernel command line: console=tty0 rootwait root=/dev/hda
Whereas I was expecting it to boot normally