|
![]()
![]() [ Back to the General Tools page ] Cross compiling Why cross compile? The BeBox is dog slow at compiling kernels due to very poor handling of the cache in Linux 2.0. So we're using fast, cheap x86 boxes to accelerate development towards a slick SMP 2.1 kernel. Required files
Installing things aleph:~# cd / aleph:/# bzip2 -dc /tmp/cross.compiler.bz2 | tar xfv - aleph:/# cd cross aleph:/cross# tar zxfv /tmp/linux-2.0.32.pax.gz aleph:/cross# ln -s /cross/linux-2.0.32 linux aleph:/cross# rm /cross/bebox.include/linux aleph:/cross# ln -s /cross/linux/include/linux /cross/bebox.include/linux aleph:/cross# cd linux aleph:/cross/linux# patch -p1 < /tmp/belinux-2.0.32-pl2.diff aleph:/cross/linux# make clean The final command is very important as it will remove some PowerPC executables that someone left in the kernel source tree (presumably by mistake). It is of the utmost importance that you carry out every one of these commands (especially modifying the symlink bebox.include/linux, this is a tiny error in the cross compiler archive). Building your kernel Once you've got the desired configuration, these commands will build the kernel and copy it to a floppy in your first floppy drive: aleph:~# cd /cross/linux aleph:/cross/linux# export PATH=/cross/bin:$PATH aleph:/cross/linux# make clean aleph:/cross/linux# make dep aleph:/cross/linux# make xImage aleph:/cross/linux# dd if=arch/ppc/boot/xImage of=/dev/fd0 bs=512 This builds a kernel that mounts /dev/sda2 (SCSI) as the root filesystem (equivalent to FD_BOOT from the LinuxPPC distributions). For a kernel that mounts /dev/hda2 (IDE) as the root (equivalent to FD_BOOT-hd) replace the two references t o "xImage" in the last two commands above with "xImage-hd". The kernel you've just built replaces the FD_BOOT disk you were previously using with LinuxPPC. You still need to use the be_boot_disk as a bootstrap. The compile will probably generate a lot of warnings; this is because the compiler is derived from egcs rather than gcc, and egcs generates a lot more noise than gcc. | ||
Be is a registered trademark, and BeOS, BeBox, BeWare, GeekPort, the Be logo and the BeOS logo are trademarks of Be, Inc. All other trademarks mentioned are the property of their respective owners. Yadda yadda yadda. |