Difference between revisions of "FILO"

From coreboot
Jump to: navigation, search
(Configuration)
(Building: svn bad. git good.)
(36 intermediate revisions by 11 users not shown)
Line 1: Line 1:
 +
[[Image:Qemu filo.png|thumb|right|FILO trying to load menu.lst.]]
 +
[[Image:Qemu filo prompt.png|thumb|right|FILO prompt.]]
 +
 
'''FILO''' is a bootloader which loads boot images from a local filesystem,
 
'''FILO''' is a bootloader which loads boot images from a local filesystem,
 
without help from legacy BIOS services.
 
without help from legacy BIOS services.
Line 6: Line 9:
 
== Download FILO ==
 
== Download FILO ==
  
Download the latest version of FILO from Subversion with
+
Download the latest version of FILO from Git with
  
  $ svn co svn://coreboot.org/filo/trunk/filo-0.5
+
  $ git clone http://review.coreboot.org/p/filo.git
  
 
You can also browse the source code online at
 
You can also browse the source code online at
http://openbios.org/viewvc/trunk/?root=FILO
+
http://review.coreboot.org/gitweb?p=filo.git
  
 
== Features ==
 
== Features ==
Line 25: Line 28:
 
* Auxiliary tool to compute checksum of ELF boot images
 
* Auxiliary tool to compute checksum of ELF boot images
 
* Full 32-bit code, no BIOS calls
 
* Full 32-bit code, no BIOS calls
 +
* uses [[libpayload]]
  
 
== Requirements ==
 
== Requirements ==
Line 32: Line 36:
 
for more information.
 
for more information.
  
x64/AMD 64 machines work fine when compiling FILO in 32-bit mode.
+
Recent version of GNU toolchain is required to build.  
(coreboot uses 32-bit mode and Linux kernel does the transition to 64-bit mode)
+
 
+
Recent version of GNU toolchain is required to build.
+
  
 
We have tested with Debian/woody (gcc 2.95.4, binutils 2.12.90.0.1,
 
We have tested with Debian/woody (gcc 2.95.4, binutils 2.12.90.0.1,
 
make 3.79.1), Debian/sid (gcc 3.3.2, binutils 2.14.90.0.6,
 
make 3.79.1), Debian/sid (gcc 3.3.2, binutils 2.14.90.0.6,
make 3.80) and different versions of SUSE Linux from 9.0 to 10.3.
+
make 3.80) and different versions of SUSE Linux from 9.0 to 11.0.
  
On AMD64 for Debian install the gcc-multilib package.
+
FILO will use the coreboot crossgcc if you have it built and it can be found.
  
== Preparation ==
+
FILO uses coreboot's '''libpayload'''. It is easiest to locate and build FILO in the '''coreboot/payloads''' directory.
  
First invocation of make creates the default Config file.
+
== Building on 64-bit OS specifics ==
  $ make
+
  
== Configuration ==
+
If you will be building FILO on AMD64 platform for Debian install the '''gcc-multilib''' package.
Edit this file as you like. It's fairly straightforward (I hope).
+
  $ vi Config
+
  
#Use the grub menu interface?
+
x64/AMD64 machines work fine when compiling FILO in 32-bit mode.
USE_GRUB = 1
+
(coreboot uses 32-bit mode and Linux kernel does the transition to 64-bit mode)
+
#Grub menu interface settings
+
MENULST_FILE = "hda1:/boot/filo/menu.lst"
+
MENULST_TIMEOUT = 0
+
+
#Default parameters for Autoboot (if USE_GRUB is set to 0
+
AUTOBOOT_FILE = "hda1:/vmlinuz root=/dev/hda1 console=tty0 console=ttyS0,115200"
+
AUTOBOOT_DELAY = 2
+
+
#Drivers
+
IDE_DISK = 1
+
USB_DISK = 1
+
PCMCIA_CF = 0
+
VGA_CONSOLE = 1
+
PC_KEYBOARD = 1
+
SERIAL_CONSOLE = 1
+
SERIAL_IOBASE = 0x3f8
+
+
#Filesystems
+
FSYS_EXT2FS = 1
+
FSYS_FAT = 1
+
FSYS_ISO9660 = 1
+
FSYS_JFS = 0
+
FSYS_MINIX = 0
+
FSYS_REISERFS = 1
+
FSYS_XFS = 0
+
FSYS_CRAMFS = 0
+
FSYS_SQUASHFS = 0
+
+
#Extra settings
+
ELTORITO = 1
+
IDE_DISK_POLL_DELAY = 0
+
SLOW_SATA = 0
+
SUPPORT_PCI = 1
+
PCI_BRUTE_SCAN = 1
+
SUPPORT_SOUND = 0
+
VIA_SOUND = 0
+
+
#Debugging
+
DEBUG_ALL=0
+
DEBUG_ELFBOOT = 0
+
DEBUG_ELFNOTE = 0
+
DEBUG_LINUXBIOS = 0
+
DEBUG_MALLOC = 0
+
DEBUG_MULTIBOOT = 0
+
DEBUG_SEGMENT = 0
+
DEBUG_SYS_INFO = 0
+
DEBUG_TIMER = 0
+
DEBUG_BLOCKDEV = 0
+
DEBUG_PCI = 0
+
DEBUG_VIA_SOUND = 0
+
DEBUG_LINUXLOAD = 0
+
DEBUG_IDE = 0
+
DEBUG_USB = 0
+
DEBUG_ELTORITO = 0
+
+
#i386 options
+
LINUX_LOADER = 1
+
MULTIBOOT_IMAGE = 0
+
  
== Installation ==
+
== Preparation ==
Then running make again will build filo.elf, the ELF boot image of FILO.
+
  $ make
+
  
Use filo.elf as your payload of coreboot, or a boot image for
+
Before you can build FILO, you have to build libpayload. If your filo directory is located inside the coreboot/payloads directory, you don't have to do anything special.  If for some reason you want to compile FILO of the coreboot/payloads directory, you will need to tell the makefile where libpayload is. Open filo/Makefile in your favorite text editor and change this line
[[Etherboot]].
+
  
If you enable MULTIBOOT_IMAGE option in Config, you can
+
  export LIBCONFIG_PATH := $(src)/../libpayload
also boot filo.elf from GNU GRUB or other Multiboot bootloader.
+
This feature is intended for testing or development purpose.
+
  
== Credits ==
+
to match the location of the libpayload directory on your system:
  
This software was originally developed by SONE Takeshi <ts1@tsn.or.jp> and is now maintained by [mailto:stepan@coresystems.de Stefan Reinauer].
+
  export LIBCONFIG_PATH := /home/YOUR_USER_NAME/PATH_TO_COREBOOT/payloads/libpayload
  
== Additional Information ==
+
== Configuration ==
  
=== FILO on the ARIMA HDAMA ===
+
Configure FILO (and libpayload) using the Kconfig interface:
This is a quick guide for getting coreboot up and running on the Arima HDAMA dual Opteron mainboard. If there are blanks to be filled in, go ahead and either ask on the [[Mailinglist|coreboot mailing list]] or you can reach me at cro_marmot_at_comcast.net. -- David Hendricks
+
  
Quick coreboot install guide for HDAMA,
+
  $ make menuconfig
David W. Hendricks, May 13 2004
+
  
Requirement: Kernel with framebuffering either in an initrd or compiled
+
This will run menuconfig twice -- the first time for libpayload, the second time for FILO.
statically in. Do not enable the "no BIOS init" option for ATi Mach64
+
framebuffering. An example .config can be found here:
+
http://home.comcast.net/~zen_weasel/linuxbios_stuff/hdama/kernel.config
+
+
==== Building coreboot ====
+
1. Grab the latest CVS code from https://sourceforge.net/cvs/?group_id=3206
+
  
2. Add the following lines to src/mainboard/arima/hdama/Config.lb for VGA
+
== Building ==
functionality:
+
  ## ATI Rage XL framebuffering graphics driver
+
  dir /drivers/ati/ragexl
+
  
3. Edit the targets/arima/hdama/Config.lb file and add this for VGA:
+
Then running make will build filo.elf, the ELF boot image of FILO.
   uses CONFIG_CONSOLE_BTEXT
+
   $ make
  option CONFIG_CONSOLE_BTEXT=1
+
  
4. Select a payload. Example:
+
If you are compiling on an AMD64 platform and compiler complains, instead of "make" you need to write
  payload /usr/src/filo-0.4.1_btext/filo.elf
+
I'll elaborate on this a little later.
+
  
5. Run "buildtarget arima/hdama" from the targets/ directory. cd to the
+
  $ make CC="gcc -m32" LD="ld -b elf32-i386" HOSTCC="gcc" AS="as --32"
arima/hdama/hdama directory and run "make"
+
  
6. If all went well during the build process, you should have a coreboot.rom
+
Use '''build/filo.elf''' as your payload of coreboot, or a boot image for
image in targets/arima/hdama/hdama/ .
+
[[Etherboot]].
  
Back to #4 -- FILO is a file loader for ELF images. It provides
+
Alternatively, you can build libpayload and FILO in one go using the build.sh script, with the drawback that you'll get the default options for both of them:
minimal bootloader functionality. To build a FILO payload:
+
  $ ./build.sh
1. Download FILO with BText for optional VGA:
+
http://home.comcast.net/~zen_weasel/linuxbios_stuff/hdama/filo_0.4.1_btext.tar.bz2
+
  
2. Decompress, edit Config. If you're booting off a disk, you can use a
+
Here is the short listing how to build FILO from git
LILO-like line to boot a kernel image. Example:
+
  cd coreboot/payloads
  AUTOBOOT_FILE = "hda1:/boot/x86_64 root=/dev/hda2 console=ttyS0,115200 console=tty0 vga=792 video=atyfb:mode:1024x768"
+
git clone http://review.coreboot.org/p/filo.git
 +
cd filo
 +
make config
 +
make
  
Booting a kernel off of the flash your BIOS is on requires that you know exactly
+
== Credits ==
it's located. If you do know this information, you can use AUTOBOOT_FILE =  
+
"mem@0x00000000" where 0x00000000 is the actual location in hexadecimal.
+
  
Also, make sure you have proper filesystem
+
* This software was originally developed by SONE Takeshi <ts1@tsn.or.jp>
support for whichever partition has your kernel image. Example: FSYS_EXT2FS = 1
+
* It has been significantly enhanced and is now maintained by [mailto:stepan@coresystems.de Stefan Reinauer].
 +
* It uses libpayload from Uwe Hermann and Jordan Crouse
  
An example FILO config file can be found here:
+
== Troubleshooting ==
[http://home.comcast.net/~zen_weasel/linuxbios_stuff/hdama/FILO_Config]
+
  
3. Run "make" and you should now have a filo.elf ELF image. Use this as your
+
If you experience trouble compiling or using FILO, please report with a build log or detailed error description to the [[Mailinglist|coreboot mailing list]].
payload in step #4 for building coreboot.
+
  
==== Troubleshooting ====
+
== Notes ==
  
Q: coreboot.strip is too big, image is greater than 64KB
+
=== CD-ROM Booting ===
A: A good way to reduce image size is simply to reduce the log level. Change
+
these lines in your targets/arima/hdama/Config.lb file:
+
option DEFAULT_CONSOLE_LOGLEVEL=9
+
option MAXIMUM_CONSOLE_LOGLEVEL=9
+
 
+
You can bring them down gradually. I've found that "7" works well with the
+
freebios source I downloaded before writing this.
+
 
+
==== Installation ====
+
 
+
Installing SuSE 9.0 AMD64 on a Solo-System:
+
 
+
FILO version 0.4.1 (stepan@prokofjieff) Thu Oct 30 13:29:16 CET 2003
+
Press <Enter> for default boot, or <Esc> for boot prompt... 
+
boot: hdc:/boot/loader/linux initrd=/boot/loader/initrd console=ttyS0,115200n8
+
 
+
== Notes ==
+
  
 
To boot a CD-ROM or DVD you only need to specify the drive '''without a partition number'''. For example to boot to the primary drive on the secondary IDE channel you would use '''hdc''' and not '''hdc1''' in FILO.
 
To boot a CD-ROM or DVD you only need to specify the drive '''without a partition number'''. For example to boot to the primary drive on the secondary IDE channel you would use '''hdc''' and not '''hdc1''' in FILO.
  
If you are using FILO with '''USE_GRUB = 1''', and want to boot to your Linux install disk you have to do a mixture of GRUB and FILO commands.
+
=== Grub-like Interface ===
 +
If you are using FILO with '''CONFIG_USE_GRUB''', and want to boot to your Linux install disk you have to do a mixture of GRUB and FILO commands.
  
 
Like GRUB you have to append a kernel (and parameters), then an initrd, and give a boot command.
 
Like GRUB you have to append a kernel (and parameters), then an initrd, and give a boot command.
Line 215: Line 116:
  
 
Example to boot to a GeeXboX install CD-ROM:
 
Example to boot to a GeeXboX install CD-ROM:
  grub>kernel hdc:/GEEXBOX/boot/vmlinuz root=/dev/ram0 rw init=linuxrc boot=cdrom installator
+
  filo> kernel hdc:/GEEXBOX/boot/vmlinuz root=/dev/ram0 rw init=linuxrc boot=cdrom installator
 
Press <ENTER>
 
Press <ENTER>
  grub>initrd hdc:/GEEXBOX/boot/initrd.gz
+
  filo> initrd hdc:/GEEXBOX/boot/initrd.gz
 
Press <ENTER>
 
Press <ENTER>
  grub>boot
+
  filo> boot
 
Press <ENTER>
 
Press <ENTER>
  
 
Your system will now boot right into the Linux install.
 
Your system will now boot right into the Linux install.
 +
 +
=== NVRAM Parsing ===
 +
 +
FILO parses the following NVRAM variables:
 +
 +
* 'boot_devices' can contain a list of boot devices seperated by semicolons. FILO will try to load filo.lst / menu.lst from any of these devices.
 +
Example how to set:
 +
nvramtool -w "boot_devices=hda1:/boot/filo;hdc:"

Revision as of 18:35, 20 March 2013

FILO trying to load menu.lst.
FILO prompt.

FILO is a bootloader which loads boot images from a local filesystem, without help from legacy BIOS services.

Expected usage is to flash it into the BIOS ROM together with coreboot.

Download FILO

Download the latest version of FILO from Git with

$ git clone http://review.coreboot.org/p/filo.git

You can also browse the source code online at http://review.coreboot.org/gitweb?p=filo.git

Features

  • Supported boot devices: IDE hard disk, SATA hard disk, CD-ROM, and system memory (ROM)
  • Supported filesystems: ext2, fat, jfs, minix, reiserfs, xfs, and iso9660
  • Supported image formats: ELF and [b]zImage (a.k.a. /vmlinuz)
  • Supports boot disk image of El Torito bootable CD-ROM. "hdc1" means the boot disk image of the CD-ROM at hdc.
  • Supports loading image from raw device with user-specified offset
  • Console on VGA + keyboard, serial port, or both
  • Line editing with ^H, ^W and ^U keys to type arbitrary filename to boot
  • Full support for the ELF Boot Proposal (where is it btw, Eric)
  • Auxiliary tool to compute checksum of ELF boot images
  • Full 32-bit code, no BIOS calls
  • uses libpayload

Requirements

Only the x86 (x64) architecture is currently supported. Some efforts have been made to get FILO running on PPC. Contact the coreboot mailinglist for more information.

Recent version of GNU toolchain is required to build.

We have tested with Debian/woody (gcc 2.95.4, binutils 2.12.90.0.1, make 3.79.1), Debian/sid (gcc 3.3.2, binutils 2.14.90.0.6, make 3.80) and different versions of SUSE Linux from 9.0 to 11.0.

FILO will use the coreboot crossgcc if you have it built and it can be found.

FILO uses coreboot's libpayload. It is easiest to locate and build FILO in the coreboot/payloads directory.

Building on 64-bit OS specifics

If you will be building FILO on AMD64 platform for Debian install the gcc-multilib package.

x64/AMD64 machines work fine when compiling FILO in 32-bit mode. (coreboot uses 32-bit mode and Linux kernel does the transition to 64-bit mode)

Preparation

Before you can build FILO, you have to build libpayload. If your filo directory is located inside the coreboot/payloads directory, you don't have to do anything special. If for some reason you want to compile FILO of the coreboot/payloads directory, you will need to tell the makefile where libpayload is. Open filo/Makefile in your favorite text editor and change this line

 export LIBCONFIG_PATH := $(src)/../libpayload

to match the location of the libpayload directory on your system:

 export LIBCONFIG_PATH := /home/YOUR_USER_NAME/PATH_TO_COREBOOT/payloads/libpayload 

Configuration

Configure FILO (and libpayload) using the Kconfig interface:

 $ make menuconfig

This will run menuconfig twice -- the first time for libpayload, the second time for FILO.

Building

Then running make will build filo.elf, the ELF boot image of FILO.

 $ make

If you are compiling on an AMD64 platform and compiler complains, instead of "make" you need to write

 $ make CC="gcc -m32" LD="ld -b elf32-i386" HOSTCC="gcc" AS="as --32"

Use build/filo.elf as your payload of coreboot, or a boot image for Etherboot.

Alternatively, you can build libpayload and FILO in one go using the build.sh script, with the drawback that you'll get the default options for both of them:

 $ ./build.sh

Here is the short listing how to build FILO from git

cd coreboot/payloads
git clone http://review.coreboot.org/p/filo.git
cd filo
make config
make

Credits

  • This software was originally developed by SONE Takeshi <ts1@tsn.or.jp>
  • It has been significantly enhanced and is now maintained by Stefan Reinauer.
  • It uses libpayload from Uwe Hermann and Jordan Crouse

Troubleshooting

If you experience trouble compiling or using FILO, please report with a build log or detailed error description to the coreboot mailing list.

Notes

CD-ROM Booting

To boot a CD-ROM or DVD you only need to specify the drive without a partition number. For example to boot to the primary drive on the secondary IDE channel you would use hdc and not hdc1 in FILO.

Grub-like Interface

If you are using FILO with CONFIG_USE_GRUB, and want to boot to your Linux install disk you have to do a mixture of GRUB and FILO commands.

Like GRUB you have to append a kernel (and parameters), then an initrd, and give a boot command. Like FILO you have to give absolute paths.

Example to boot to a GeeXboX install CD-ROM:

filo> kernel hdc:/GEEXBOX/boot/vmlinuz root=/dev/ram0 rw init=linuxrc boot=cdrom installator

Press <ENTER>

filo> initrd hdc:/GEEXBOX/boot/initrd.gz

Press <ENTER>

filo> boot

Press <ENTER>

Your system will now boot right into the Linux install.

NVRAM Parsing

FILO parses the following NVRAM variables:

  • 'boot_devices' can contain a list of boot devices seperated by semicolons. FILO will try to load filo.lst / menu.lst from any of these devices.

Example how to set:

nvramtool -w "boot_devices=hda1:/boot/filo;hdc:"