Linux XBE Bootloader ~~~~~~~~~~~~~~~~~~~~ Usage: The "New" Xbeboot has a nice now very cool feature It supports Linking of the vmlinuz initrd linuxboot.cfg into the .xbe file So, your compleate Linux shrinks down to a single file, which holds everything in it. There are some "limits" The Kernel Size is limited to 1MB The RAMdisk is unknown, i tested with a 12MB ramdisk here, and it worked. so, how to do this now. METHOD 1: If you want the conventional Method: Go to the config.h file and do #define LOADHDD #undef LOADXBE This will force the Xbeboot to load all 3 files now from the HDD In this mode, you can choose a config fallback #define LOADHDD_CFGFALLBACK means: if the Xbeboot can not load the linuxboot.cfg from the hdd, it will try to take the one linked into the xbeboot METHOD 2: Ok, now the New method #define LOADXBE #undef LOADHDD This now tells the XBEBOOT only to take the 3 Files from the XBEBOOT even if the files are existing on the hdd, it will not take care of them This provides a single standalone Soulution for small Linux Distros and so. Ok, now the question: Where does it get the kernel from ? Only place the 3 files vmlinuz initrd linuxboot.cfg into the xbeboot directory This is all. Happy hacking.. franz & ed (C)2002 by Michael Steil <mist@c64.org>, based on code by M. Steil & Anonymous Linux VESA Framebuffer support by Milosch Meriac <xboxlinux@meriac.de> No-Initrd-Fix by Edgar Hucek <hostmaster@ed-soft.at> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Features ~~~~~~~~~ The Linux XBE Bootloader is an Xbox XBE file that boots the Linux kernel. It supports configuration files, standard i386 bzImage kernels (no zImage) initial RAM disks, and a kernel command line. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Location of the Configuration File ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The bootloader executable can be started from hard disk or CD/DVD. It first reads the file "linuxboot.cfg" from the same directory on hard disk or CD/DVD the bootloader executable resides in. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Configuration File Commands ~~~~~~~~~~~~~~~~~~~~~~~~~~~ The configuration file is a plaintext file containing one or more lines each with a command, and, sepatated with a space or tab, the command's parameters. The bootloader knows the following commands (note that the case of the commands does not matter): {TITLE|LABEL} ~~~~~~~~~~~~~ Reserved keywords. Will be important for multiple configurations. Example: TITLE linux ROOT ~~~~ NT namespace base path. This path will be prepended to the paths of the kernel image and the initial RAM disk. If you don't set the root directory, it is set to the directory of the bootloader executable by default. Examples: ROOT \Device\Harddisk0\Partition1 (the system partition) ROOT \Device\CdRom0 (the CD/DVD) ROOT \??\D: (also the CD/DVD) KERNEL ~~~~~~ Relative path and filename of the kernel image. Optionally, you can supply a kernel command line after the kernel path and filename. The parameter "initrd=" gets recognized as the initial RAM disk filename (see below); this parameter won't be passed to the kernel. Examples: KERNEL data\vmlinuz KERNEL vmlinuz KERNEL \vmlinuz (the same as "vmlinuz") KERNEL \vmlinuz-2.4.18 root=/dev/hda1 initrd=\initrd-2.4.18.gz INITRD ~~~~~~ Relative path and filename of the initial ramdisk. An Initrd is optional. Examples: INITRD boot\initrd-failsafe.gz INITRD initrd.gz ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Note that the syntax of the configuration file is very similar to GRUB's and SYSLINUX'. You have two possibilities to pass the bootloader the path and filename of the configuartion file, one is "the GRUB way" and the other one is "the SYSLINUX way". There are also two ways to pass the kernel command line. If the same command is read multiple times, only the last one is preserved for ROOT, KERNEL and INITRD. For the kernel command line, all command line parts defined using the different commands are concatenated. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The Kernel Command Line ~~~~~~~~~~~~~~~~~~~~~~~ The bootloader automatically adds the following parameters to the kernel command line: xboxeepromkey=00112233445566778899AABBCCDDEEFF xboxhdkey=00112233445566778899AABBCCDDEEFF so that applications can access these resources without them having to be included or caculated (legal problems). Note however that the EEPROMKey might not be available when booting from the Dashboard or another utility application. The parameter: kbd-reset is also passed to the kernel to make it detect that there is no keyboard controller. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The NT Object Namespace ~~~~~~~~~~~~~~~~~~~~~~~ All paths and filenames are passed to the Xbox kernel, so you have to use the NT object namespace for the "root" path. Here is a short table with all drives known to the Xbox kernel. Symbolic Link Device Object Description ~~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~ \??\C: \Device\Harddisk0\Partition2 System Partition (500 MB) \??\D: \Device\CdRom0 CD/DVD \??\E: \Device\Harddisk0\Partition1 Data Partition (4895 GB) \??\F: \Device\Harddisk0\Partition6 EvoX Additional Partition \??\X: \Device\Harddisk0\Partition3 Game Cache A (750 MB) \??\Y: \Device\Harddisk0\Partition4 Game Cache B (750 MB) \??\Z: \Device\Harddisk0\Partition5 Game Cache C (750 MB) The subdirectory and the filename are added to the volume base, so that for example \Device\Harddisk0\Partition2\Linux\vmlinuz and \\??\D:\vmlinuz are both valid absolute paths. Note that all subdirectory and file names are case insensitive. Also note that some utility applications such as EvoX might redefine some symbolic links, only the device object paths are static. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Example Configuration Files ~~~~~~~~~~~~~~~~~~~~~~~~~~~ # GRUB style root \Device\Hardisk0\Partion1\Linux kernel vmlinuz hdb=ide-scsi root=/dev/hda1 initrd initrd # SYSLINUX style kernel \Device\Hardisk0\Partion1\Linux\vmlinuz append initrd=\Device\Hardisk0\Partion1\Linux\initrd hdb=ide-scsi append root=/dev/hda1 # minimal, all files in the directory of the bootloader kernel vmlinuz initrd=initrd root=/dev/hda1 # minimal #2, no initrd kernel vmlinuz root=/dev/hda1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Video Resolution ~~~~~~~~~~~~~~~~ The bootloader detects whether the Xbox is in 640x480 or 640x576 (PAL box with Linux booted from the Dashboard) mode and tells Linux the resolution. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TODO ~~~~ * Xbox kernel calls should be abstracted to fopen/fread/fclose. * header.S is stille quite a mess ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~