| 1 | This is FILO, a bootloader which loads boot images from local filesystem, |
|---|
| 2 | without help from legacy BIOS services. |
|---|
| 3 | |
|---|
| 4 | Expected usage is to flash it into the BIOS ROM together with coreboot. |
|---|
| 5 | |
|---|
| 6 | Find the latest version and more information on FILO |
|---|
| 7 | at http://www.coreboot.org/FILO |
|---|
| 8 | |
|---|
| 9 | FEATURES |
|---|
| 10 | |
|---|
| 11 | - Supported boot devices: IDE hard disk and CD-ROM, and system memory (ROM) |
|---|
| 12 | S-ATA and USB memory devices |
|---|
| 13 | - Supported filesystems: ext2, fat, jfs, minix, reiserfs, xfs, and iso9660 |
|---|
| 14 | - Supported image formats: ELF and [b]zImage (a.k.a. /vmlinuz) |
|---|
| 15 | - Supports boot disk image of El Torito bootable CD-ROM |
|---|
| 16 | - Supports loading image from raw device with user-specified offset |
|---|
| 17 | - Console on VGA + keyboard, serial port, or both |
|---|
| 18 | - Line editing with ^H, ^W and ^U keys to type arbitrary filename to boot |
|---|
| 19 | - GRUB like user interface |
|---|
| 20 | - Full support for the ELF Boot Proposal (where is it btw, Eric?) |
|---|
| 21 | - Auxiliary tool to compute checksum of ELF boot images |
|---|
| 22 | - Full 32-bit code, no BIOS calls |
|---|
| 23 | |
|---|
| 24 | REQUIREMENTS |
|---|
| 25 | |
|---|
| 26 | Only i386 PC architecture is currently supported. |
|---|
| 27 | |
|---|
| 28 | x86-64 (AMD 64) machines in 32-bit mode do also work. |
|---|
| 29 | (coreboot uses 32-bit mode and the Linux kernel does the |
|---|
| 30 | transition to 64-bit mode) |
|---|
| 31 | |
|---|
| 32 | I'm using an AMD64 based mainboard with IDE hard disk |
|---|
| 33 | and a DVD drive for testing, and QEmu, Bochs or VMware |
|---|
| 34 | for development. |
|---|
| 35 | |
|---|
| 36 | Recent version of GNU toolchain is required to build. |
|---|
| 37 | I have tested with the toolchains from SUSE 10.0 and SUSE 10.1, |
|---|
| 38 | but slightly older versions might also work. |
|---|
| 39 | |
|---|
| 40 | INSTALL |
|---|
| 41 | |
|---|
| 42 | First, you need to compile libpayload (included in coreboot): |
|---|
| 43 | |
|---|
| 44 | $ cd ../coreboot/payloads/libpayload |
|---|
| 45 | $ make defconfig |
|---|
| 46 | $ make |
|---|
| 47 | $ make DESTDIR=../../../filo/build install |
|---|
| 48 | $ cd ../../../filo |
|---|
| 49 | |
|---|
| 50 | Configure FILO using the Kconfig interface: |
|---|
| 51 | |
|---|
| 52 | $ make menuconfig |
|---|
| 53 | |
|---|
| 54 | Then run make again will build filo.elf, the ELF boot image of FILO. |
|---|
| 55 | |
|---|
| 56 | $ make |
|---|
| 57 | |
|---|
| 58 | If you are compiling on an AMD64 platform, do |
|---|
| 59 | |
|---|
| 60 | $ make CC="gcc -m32" LD="ld -b elf32-i386" HOSTCC="gcc" AS="as --32" |
|---|
| 61 | |
|---|
| 62 | Alternatively, you can build libpayload and FILO in one go using the |
|---|
| 63 | build.sh script: |
|---|
| 64 | |
|---|
| 65 | $ ./build.sh |
|---|
| 66 | |
|---|
| 67 | Use build/filo.elf as your payload of coreboot, or a boot image for Etherboot. |
|---|
| 68 | |
|---|
| 69 | NOTES |
|---|
| 70 | |
|---|
| 71 | If you are using the GRUB like frontend: |
|---|
| 72 | |
|---|
| 73 | - make sure you adapt your menu.lst path |
|---|
| 74 | - if you want to use FILO over a serial connection, make sure you have |
|---|
| 75 | something like this in your menu.lst file: |
|---|
| 76 | |
|---|
| 77 | serial --unit=0 --speed=115200 |
|---|
| 78 | terminal serial console |
|---|
| 79 | |
|---|
| 80 | USING |
|---|
| 81 | |
|---|
| 82 | When FILO starts, it displays "boot:" prompt or the GRUB menu interface. |
|---|
| 83 | |
|---|
| 84 | At "boot:" prompt, type the name of your boot image, and optionally |
|---|
| 85 | the kernel parameter, in the form: |
|---|
| 86 | DEVICE:FILENAME[ PARAM] |
|---|
| 87 | for example: |
|---|
| 88 | boot: hda1:/vmlinuz root=/dev/hda1 |
|---|
| 89 | |
|---|
| 90 | Notation of DEVICE for IDE disk and CD-ROM is same as in Linux |
|---|
| 91 | (eg. hda1 means the first partition of master device on primary |
|---|
| 92 | IDE channel). Support for El Torito bootable CD-ROM, "hdc1" means |
|---|
| 93 | the boot disk image of the CD-ROM at hdc. |
|---|
| 94 | |
|---|
| 95 | FILENAME can be standard bzImage/zImage (vmlinuz) Linux kernels, |
|---|
| 96 | Linux-compatible images such as memtest.bin of Memtest86, |
|---|
| 97 | and any bootable ELF images, which include Linux kernel converted |
|---|
| 98 | by mkelfImage, Etherboot .elf and .zelf, Memtest86, FILO itself, etc. |
|---|
| 99 | |
|---|
| 100 | If USE_GRUB is disabled: |
|---|
| 101 | |
|---|
| 102 | If AUTOBOOT_FILE is set in Config, FILO tries to boot this file |
|---|
| 103 | first, and falls back to boot: prompt if it fails. |
|---|
| 104 | |
|---|
| 105 | If AUTOBOOT_DELAY is also set, FILO waits for specified time in |
|---|
| 106 | seconds before booting AUTOBOOT_FILE. If <Esc> key is pressed |
|---|
| 107 | during this time period, automatic boot is canceled. |
|---|
| 108 | Pressing <Enter> key also cancels the delay, but in this case |
|---|
| 109 | AUTOBOOT_FILE is booted immediately. |
|---|
| 110 | |
|---|
| 111 | Even if AUTOBOOT_DELAY is not set, automatic boot can be disabled |
|---|
| 112 | by pressing <Esc> key beforehand. |
|---|
| 113 | |
|---|
| 114 | FILO can also load separate initrd images along with vmlinuz |
|---|
| 115 | kernels. (For ELF kernel, initrd images are embedded into the |
|---|
| 116 | ELF file and cannot be altered). |
|---|
| 117 | To do so, add "initrd=NAME" parameter to the kernel command line. |
|---|
| 118 | NAME uses the same notation as kernel image name. |
|---|
| 119 | (eg. boot: hda1:/vmlinuz initrd=hda1:/root.gz root=/dev/ram) |
|---|
| 120 | |
|---|
| 121 | To boot an image in the BIOS flash (or whatever is mapped in the system |
|---|
| 122 | memory space), use the notation "mem@OFFSET[,LENGTH]", like: |
|---|
| 123 | boot: mem@0xfffe0000 |
|---|
| 124 | In this example, it loads the boot image from the last 128KB of BIOS |
|---|
| 125 | flash. |
|---|
| 126 | |
|---|
| 127 | The same notation can be used with IDE devices, eg: |
|---|
| 128 | boot: hda@512,697344 initrd=hda@1M,4M |
|---|
| 129 | In this case the 697344 bytes starting from second sector of IDE drive |
|---|
| 130 | is loaded as kernel, and 4M bytes of offset 1M bytes of the same disk |
|---|
| 131 | is loaded as initrd. |
|---|
| 132 | Note that when you load vmlinuz kernel or initrd this way, |
|---|
| 133 | you must specify the LENGTH parameter. You can omit it for ELF |
|---|
| 134 | images since they have segment length internally. |
|---|
| 135 | OFFSET and LENGTH parameters must be multiple of 512. |
|---|
| 136 | |
|---|
| 137 | USB |
|---|
| 138 | |
|---|
| 139 | USB support is originally taken from Steven James's baremetal in |
|---|
| 140 | coreboot-v1 util. |
|---|
| 141 | |
|---|
| 142 | Yinghai Lu seperated common functions from uhci.c to usb.c and |
|---|
| 143 | created ohci.c to support ohci. |
|---|
| 144 | ohci.c is heavily inspired by Linux Kernel 2.4.22 drivers/usb/host/usb-ohci.c. |
|---|
| 145 | |
|---|
| 146 | Stefan Reinauer integrated USB back into the main filo version. |
|---|
| 147 | |
|---|
| 148 | USB support includes several parts |
|---|
| 149 | 1. UHCI+OHCI--->USB: provides usb init, usb_control_msg and usb_bulk_msg interface |
|---|
| 150 | 2. USB_SCSI: bulk only device |
|---|
| 151 | 3. USB_X interface to FILO |
|---|
| 152 | |
|---|
| 153 | todo: |
|---|
| 154 | - EHCI support |
|---|
| 155 | |
|---|
| 156 | BUG REPORTING |
|---|
| 157 | |
|---|
| 158 | If you have problem with FILO, set DEBUG_ALL in Config and send its |
|---|
| 159 | console output to the coreboot mailinglist at <coreboot@coreboot.org>. |
|---|
| 160 | |
|---|
| 161 | ACKNOWLEDGEMENTS |
|---|
| 162 | |
|---|
| 163 | Filesystem and menu code taken from GNU GRUB and patches for it. |
|---|
| 164 | IDE driver is originally taken from Etherboot. |
|---|
| 165 | Steve Gehlbach wrote the original bzImage loader for FILO. |
|---|
| 166 | |
|---|
| 167 | Besides, I have taken pieces of code and/or learned concepts |
|---|
| 168 | from various standalone programs, including GNU GRUB, Etherboot, |
|---|
| 169 | polled IDE patch by Adam Agnew, Memtest86, LinuxBIOS, and Linux. |
|---|
| 170 | I must say thanks to all the developers of these wonderful software, |
|---|
| 171 | especially to Eric Biederman for his great development work in this area. |
|---|
| 172 | |
|---|
| 173 | Stefan Reinauer is now maintaining FILO officially and added new features |
|---|
| 174 | such as the grub menu interface and merged S-ATA and USB support from |
|---|
| 175 | etherboot. |
|---|
| 176 | |
|---|
| 177 | LICENSE |
|---|
| 178 | |
|---|
| 179 | Copyright (C) 2003 by SONE Takeshi <ts1@tsn.or.jp> and others. |
|---|
| 180 | Copyright (C) 2005-2009 by coresystems GmbH <info@coresystems.de>. |
|---|
| 181 | |
|---|
| 182 | This program is licensed under the terms of GNU General Public License. |
|---|
| 183 | See the COPYING file for details. |
|---|
| 184 | |
|---|