Latest revision as of 23:51, 11 March 2008

Unfortunately, there is a step in this HOWTO that could be hazardous. The
hazards include (but are not limited to)
1) destroying your motherboard
2) hurting yourself
3) killing yourself

Because of these hazards, you must take full responsibility if you
decide to install LinuxBIOS following these procedures. Neither Los
Alamos National Labs nor any lab personnel can be held responsible for
any adverse consequences of your attempt to follow these procedures.

WARNING: we assume you've built kernels, know how to open up your PC,
and how to yank the flash part out while power is on and put in a
different part. There is NO WARRANTY, express or implied, with this
software. In fact, if you don't know what you're doing, and you get
careless, you're going to end up with a nice paperweight instead of a
motherboard, an emergency room bill, or a funeral service.

YOU HAVE BEEN WARNED.

Now that we're done with the mandatory US legal jargon
(how I hate lawyers ...)

Linux distribution: RedHat 6.2 or later. We haven't tried anything else.
They may all work fine.

Other software notes: You MUST have 'as' version 2.9.5 or later.
You MUST have ssh to connect to sourceforge

Recommended: you really ought to get a 32-DIP Zero Insertion Force (ZIF)
socket for the flash part. This makes taking out flash and putting in Disk
On Chip much easier.

You need to have a LinuxBIOS machine (the machine that runs LinuxBIOS)
and a build machine (which will let you build LinuxBIOS). These can be
one and the same machine. In this HOWTO we assume they're the same.
We nevertheless refer to a 'build' machine and 'LinuxBIOS' machine in case you
want to use a different machine.

Also, freebios and linuxbios still share the same source tree. We use the
name 'linuxbios' where it makes sense, and 'freebios' otherwise. But they
are the same source base.

NOTE: these steps are tested up to step 3, and work.
The steps for loading linuxbios are simple:
0) get linux installed on your LinuxBIOS machine
1) Get Linuxbios source from the sourceforge
2) get a 2.4.0-test12 kernel, patch it, then build it
3) config and build linuxbios
4) Get the MTD utilities from http://www.linux-mtd.infradead.org/
and build the 'erase' utility
5) Set up the 'flash_on' program in your path
6) put a Disk On Chip into the flash socket
7) Burn the chip
8) hit reset. You're up.

---
Step 0)
Get Linux installed on your LinuxBIOS machine. We have used
RedHat 6.2, but any recent Linux distribution should work, such
as Mandrake 7.0.

o Once you have pulled this file down and untar'ed it,
apply the proper patch from the freebios/src/kernel_patches
directory. The patch is:

linux-2.4.0-test12-sis630-sisfb_lite.patch
Your patch command will look like this:
cd linux_directory
patch -p1 < ~/freebios/src/kernel_patches/linux-2.4.0-test12-sis630-sisfb_lite.patch
o Now copy config-2.4.0-test12.sis to .config, then
make oldconfig
make clean
make dep
make vmlinux
make modules
make modules_install
make bzdisk (You should test boot this floppy disk just to be safe)

You now have a kernel for linuxbios.
And then try booting this kernel on the LinuxBIOS to make sure it works.
If you want, you can also install this kernel on the LinuxBIOS machine,
and install the modules as well, since you will need the Disk On Chip
modules to burn the Disk On Chip part.

Step 3:

o You now need to figure out where you want to put your build images.
DO NOT PUT THESE IN THE LINUXBIOS SOURCE TREE.
You want to put them OUTSIDE THE TREE, so you can always
cvs update
and not lose any of your build directory.
Linuxbios does all the builds in a single directory, much as BSD does.
To build linuxbios requires a Makefile, a crt0.S file, and a ld script
file. These are generated by a config tool located in
freebios/utils/config
The config tool is a Python program originally written by
Dean Risinger of the ACL.
To build the initial Makefile, assembly stub, and ld script,
you need to build a config file (simple), run the config tool,
cd to the build directory, and type 'make'.

Here is a config file for the winfast 6300

# This will make a target directory of ./winfast
# Note that this is RELATIVE TO WHERE YOU ARE WHEN YOU RUN THE
# CONFIG TOOL. Make it absolute if you like
target winfast

# Leadtek WinFast 6300 MAX mainboard
mainboard leadtek/winfast6300

# Enable Serial Console for debugging
# It will come up at 115200,8n1
option SERIAL_CONSOLE

# We're using disk on chip. Tell it where to find the docipl code
docipl northsouthbridge/sis/630

The target command names the build directory. The mainboard command
names the mainboard. We have set options for a serial console which
will get you linuxbios debug output via the serial port; updating
microcode on the PIII (mandatory for coppermine!); configuring the
L2 cache (harmless, leave it in); framebuffer init (leave it in
if you want a console). You have to tell it where to find the vmlinux
you build (the 'linux' command); and finally you need a commandline
for now.

That's the file.
To run the config tool, you need two args: the first is the
name of a config file, and the second is the (absolute) pathname
of the freebios source tree.

The config tool is NLBConfig.py. Make sure you use that and not
LBConfig.py, the older version.

We now have three files to be loaded into the Disk On Chip. The first
is called docipl. It is 512 bytes. The second is called linuxbios.strip,
and is the binary image of the linuxbios that gets loaded into Doc.
The third file is your kernel, and is stripped and compressed,
vmlinux.bin.gz

Step 4) Get the MTD utilities from http://www.linux-mtd.infradead.org/
(see the instructions at that site)
cvs -d :pserver:anoncvs@cvs.infradead.org:/home/cvs co mtd
cd mtd/util
sh -x MAKEDEV
make
(You need the erase utility)
Install the erase utility where it is in your path.

Step 5) Set up flash_on utiliy
flash_on.c is found in freebios/util/sis/flash_on.c
cd to that directory, make the utility, and put it in your path
(i.e. /usr/bin or in your private path)
(e.g. cp erase /usr/bin)

Step 6)
NOTE: BE ADVISED THAT THIS STEP CAN HURT OR KILL YOU!
YOU ARE WORKING WITH A POWERED-ON COMPUTER AT THIS POINT.
THE COMPUTER NEEDS TO BE OPENED UP, AND YOU NEED TO REMOVE A CHIP
WHILE THE COMPUTER IS ON.
IF YOU HAVE NOT DONE THIS TYPE OF WORK, DO NOT DO IT!
WE TAKE NO RESPONSIBILITY FOR ANYTHING THAT HAPPENS AT THIS STEP.
BEFORE DOING THIS STEP WITH POWER ON, YOU SHOULD TRY IT WITH POWER OFF.

Figure out if you're going to burn the DoC on the build or LinuxBIOS
machine. It has to be the machine with MTD modules.

Open the machine (LEAVE THE POWER ON), yank the flash, and
plug in the DoC. We recommend you practice this first with the
power off. Make sure that whatever you do, you are not shorting
things out. Avoid using a metal tool!

NOTE: YOU CAN HURT YOURSELF AT THIS STEP. We can't take any
responsibility for what happens to you here. If you haven't
done this, or are not trained, or have a history of getting
hurt by hardware, DON'T DO IT.

Step 7) Run the following script:
RUN THIS SCRIPT FROM THE BUILD DIRECTORY FOR LINUXBIOS
Run the burn_mtd script from freebios/util/mtd
Here's how it looks when you run it:
(We'll fill this in later, sorry!)

Step 8) POWER OFF THE MACHINE. DoC requires this.
Turn it back on. Linuxbios should come up in a few seconds.

If it doesn't work:

1) if you can, hook up a serial line to your LinuxBIOS machine,

settings 115200,8n1
and see what messages come out. If you can capture them, send them
to linuxbios@lanl.gov with a description of your problem.