Board:tyan/s2881: Difference between revisions

From coreboot
Jump to navigation Jump to search
No edit summary
No edit summary
Line 11: Line 11:
LinuxBIOS requires a [http://linuxbios.org/index.php/Payloads Payload] to boot an operating system.
LinuxBIOS requires a [http://linuxbios.org/index.php/Payloads Payload] to boot an operating system.


If you want to boot from the network or from a SATA drive, you will need to use [http://www.etherboot.org Etherboot]. If you want to boot from an IDE drive, you can use [http://linuxbios.org/index.php/FILO FILO]. The rest of this document assumes you want to boot from SATA.
If you want to boot from the network, you will need to use [http://www.etherboot.org Etherboot].  
 
If you want to boot from an IDE drive, SATA drive, USB stick or CDROM, you can use [http://linuxbios.org/index.php/FILO FILO].  


===Building the payload===
===Building the payload===


Since the S2881 comes with a SATA controller, we need to build Etherboot.  
In order to boot from a SATA disk, we use FILO.
 
Once you've downloaded FILO, you will need to put a file 'Config' in its root tree. An example can be found in the distribution, called 'defconfig'.
 
You can configure FILO to load Grub. Here's my Config, which does that:
 
  # Use grub instead of autoboot?
  USE_GRUB = 1
 
  # Grub menu.lst path
  MENULST_FILE = "hda1:/grub/menu.lst"


1. Download the latest version from http://www.etherboot.org. At the time of writing, that is Etherboot 5.4.1.<br>
  # Driver for hard disk, CompactFlash, and CD-ROM on IDE bus
2. Configure it as explained here: http://www.linuxbios.org/index.php/Etherboot<br>
   IDE_DISK = 1
3. Version 5.4.1 adds PXE support. which is not compatible with the LinuxBIOS/FILO code included in Etherboot. You will need to disable it by removing this line from src/Config:
   CFLAGS+= -DPXE_IMAGE -DPXE_EXPORT


4. Etherboot has an (optional) boot prompt that allows you the choice of a network or disk boot. We always want to book from disk, so make sure you set ASK_BOOT to -1, which disables the prompt:
  # Add a short delay when polling status registers
  # (required on some broken SATA controllers)
  IDE_DISK_POLL_DELAY = 1


   CFLAGS+= -DASK_BOOT=-1
   # Driver for USB Storage
  USB_DISK = 1


5. However, currently (2006-04-23) Etherboot/FILO needs a bit of time to detect SATA drives (but only after a cold boot). It seems at least 3 extra seconds are required, so to be safe update the FILO boot prompt delay (where you can choose different boot images) to 5 seconds in src/filo/Config.lb:
  # VGA text console
  VGA_CONSOLE = 1
  PC_KEYBOARD = 1


   AUTOBOOT_DELAY = 5
   # Enable the serial console
  SERIAL_CONSOLE = 1


Now; before we build Etherboot, let's think about the kernel we want to boot first.
  # Serial console; real external serial port
  SERIAL_IOBASE = 0x3f8
  SERIAL_SPEED = 115200


===The kernel you boot===
  # Filesystems
  FSYS_EXT2FS = 1
  FSYS_ISO9660 = 1


The mkelfImage program from
  # Support for boot disk image in bootable CD-ROM (El Torito)
  ELTORITO = 1


   ftp://ftp.lnxi.com
   # PCI support
  SUPPORT_PCI = 1


can be used to generate a kernel to boot with LinuxBIOS. Note that this is not required, you can also boot a normal kernel.  
  # Enable this to scan PCI busses above bus 0
  # AMD64 based boards do need this.
  PCI_BRUTE_SCAN = 1


You can use mkelfImage to combine the kernel and initrd you want to boot into an elf image that filo can boot, for instance like this:
  # Loader for standard Linux kernel image, a.k.a. /vmlinuz
  LINUX_LOADER = 1


  mkelfImage --command-line="ro root=/dev/md3 quiet splash console=tty0 console=ttyS0,115200n8" \
In order to get serial output from Grub, you will also need to add something like this to your menu.list:
            --kernel="/boot/vmlinuz-2.6.12-9-amd64-generic" \
            --initrd="/boot/initrd.img-2.6.12-9-amd64-generic" \
            --output="/boot/linuxbios.elf"


This means you will also need to update etherboot-5.4.1/src/filo/Config with the new autoboot file:
   # serial port 0
    
   serial --unit=0 --speed=115200
   AUTOBOOT_FILE = "hde1:/linuxbios.elf"
   terminal --timeout=15 serial console
    
Then build etherboot


  cd etherboot-5.4.1/src
Now execute 'make', which will generate a filo.elf file that will be your payload. You will need to refer to this file to build LinuxBIOS as explained below, because it gets included in the LinuxBIOS ROM image.
  make bin/tg3--filo.elf


===Building LinuxBIOS===
===Building LinuxBIOS===
Line 75: Line 94:
   ./buildtarget tyan/s2881
   ./buildtarget tyan/s2881


Modify tyan/s2881/Config.lb; change payload setting to point to your tg3--filo.elf file<br>
Modify tyan/s2881/Config.lb; change payload setting to point to your filo.elf file<br>


If you don't need VGA, you will need to modify tyan/s2881/Config.lb. Comment out the line:
If you don't need VGA, you will need to modify tyan/s2881/Config.lb. Comment out the line:

Revision as of 19:07, 27 June 2006

Before you begin

Do yourself a favor, and get a BiosSavior before you begin. We bought ours from http://www.paragonca.com. There are different models, make sure you order the one you need. It depends on the size and type of the ROM chip on your board. Our S2881 board has a 4Mbit PLCC chip:

 http://www.paragonca.com/hardwareacc-rd1biossavior.html

While LinuxBIOS replaces the functions of the proprietary bios, it does NOT replace the VGA bios. If you want VGA on your linuxBIOS'd machine (not strictly necessary for servers), you will need to extract the VGA bios and concatenate it with the LinuxBIOS image, before burning it to your ROM. See below for details.

Payload

LinuxBIOS requires a Payload to boot an operating system.

If you want to boot from the network, you will need to use Etherboot.

If you want to boot from an IDE drive, SATA drive, USB stick or CDROM, you can use FILO.

Building the payload

In order to boot from a SATA disk, we use FILO.

Once you've downloaded FILO, you will need to put a file 'Config' in its root tree. An example can be found in the distribution, called 'defconfig'.

You can configure FILO to load Grub. Here's my Config, which does that:

 # Use grub instead of autoboot?
 USE_GRUB = 1
 # Grub menu.lst path
 MENULST_FILE = "hda1:/grub/menu.lst"
 # Driver for hard disk, CompactFlash, and CD-ROM on IDE bus
 IDE_DISK = 1
 # Add a short delay when polling status registers
 # (required on some broken SATA controllers)
 IDE_DISK_POLL_DELAY = 1
 # Driver for USB Storage
 USB_DISK = 1
 # VGA text console
 VGA_CONSOLE = 1
 PC_KEYBOARD = 1
 # Enable the serial console
 SERIAL_CONSOLE = 1
 # Serial console; real external serial port
 SERIAL_IOBASE = 0x3f8
 SERIAL_SPEED = 115200
 # Filesystems
 FSYS_EXT2FS = 1
 FSYS_ISO9660 = 1
 # Support for boot disk image in bootable CD-ROM (El Torito)
 ELTORITO = 1
 # PCI support
 SUPPORT_PCI = 1
 # Enable this to scan PCI busses above bus 0
 # AMD64 based boards do need this.
 PCI_BRUTE_SCAN = 1
 # Loader for standard Linux kernel image, a.k.a. /vmlinuz
 LINUX_LOADER = 1

In order to get serial output from Grub, you will also need to add something like this to your menu.list:

 # serial port 0
 serial --unit=0 --speed=115200
 terminal --timeout=15 serial console

Now execute 'make', which will generate a filo.elf file that will be your payload. You will need to refer to this file to build LinuxBIOS as explained below, because it gets included in the LinuxBIOS ROM image.

Building LinuxBIOS

Download LinuxBIOS (http://linuxbios.org/index.php/Download_LinuxBIOS). You need subversion revision 2251 or higher. Note that revisions 2288 through 2295 are known bad, do not use those.

If you want VGA support, a few changes are required in the linuxbios source tree. Edit this file:

 src/mainboard/tyan/s2881/Options.lb

You'll need to enable the following two lines:

 #VGA Console
 default CONFIG_CONSOLE_VGA=1
 default CONFIG_PCI_ROM_RUN=1

Whether you want VGA or not, build a tyan/s2881 tree.

 cd targets
 ./buildtarget tyan/s2881

Modify tyan/s2881/Config.lb; change payload setting to point to your filo.elf file

If you don't need VGA, you will need to modify tyan/s2881/Config.lb. Comment out the line:

 option ROM_SIZE = 475136

If you do need VGA, modify the ROM_SIZE line to the following, because our VGA bios is only 32KB:

 option ROM_SIZE = 491520

Make you are using GCC 3.4 (not GCC 4.0), or your image will be too large, and then:

 cd tyan/s2881/s2881
 make

VGA bios

Skip this section if you don't need VGA support in your LinuxBIOS.

While booted with your proprietary BIOS, you can see where your vga bios starts and how much space it takes by issuing

 cat /proc/iomem | grep "Video ROM"

Then get a copy of your vga bios. For me, this command did the trick.

 dd if=/dev/mem of=vgabios.bin bs=1k count=32 skip=768

Our vga bios is 32K. Verify that the image is correct - it should start with 55 AA, and contain strings that indicate it's your VGA bios. In my case, I could clearly make out 'ATI RAGE' etc.

Now concatenate the VGA bios with the linuxbios image

 cat vgabios.bin linuxbios.rom > final_linuxbios.rom

TODO: fix; this doesn't seem to work.

Burning the bios

Make sure your Biossavior is set to the 'RD1' position (not to 'ORG'!), so that you can always revert to the original bios.

On the target machine:

  cd LinuxBIOSv2/util/flashrom
  ./flashrom -v -w path/to/your/linuxbios.rom

If you want VGA support, make sure you burn the final_linuxbios.rom image!

Booting LinuxBIOS

You now need to 'halt' the machine. A soft reset won't work the first time you boot from the proprietary BIOS into LinuxBIOS.

Since we set up serial output in the LinuxBIOS configuration files above, you will want to hook up a serial console (or a copy of minicom or the like) to see what the box is doing while starting up. Keep your eyes on the screen after hitting the power button - LinuxBIOS will be up and running way before you expect it!

If you have problems, don't despair. Power down the box, switch the biossavior to 'ORG' and boot in the proprietary BIOS. Just don't forget to switch the biossavior back to the 'RD1' position before flashing the BIOS!

See what went wrong, and subscribe and post to the friendly and helpful mailing list if you can't figure it out by yourself.