FAQ: Difference between revisions

From coreboot
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 1: Line 1:
General
What is LinuxBIOS?
Why do we need LinuxBIOS?
Who is working on LinuxBIOS?
Who is funding LinuxBIOS?
Will LinuxBIOS work on my machine?
What commercial products use LinuxBIOS?
How can I help with LinuxBIOS?
Developer
Developer


Line 54: Line 37:




== General ==


General
=== What is LinuxBIOS? ===
 
What is LinuxBIOS?  


LinuxBIOS aims to replace the normal BIOS found on PCs, Alphas, and other machines with a Linux kernel that can boot Linux from a cold start. LinuxBIOS is primarily Linux - about 10 lines of patches to the current Linux kernel. Additionally, the startup code - about 500 lines of assembly and 5000 lines of C - executes 16 instructions to get into 32-bit mode and then performs DRAM and other hardware initialization required before Linux can take over.  
LinuxBIOS aims to replace the normal BIOS found on PCs, Alphas, and other machines with a Linux kernel that can boot Linux from a cold start. LinuxBIOS is primarily Linux - about 10 lines of patches to the current Linux kernel. Additionally, the startup code - about 500 lines of assembly and 5000 lines of C - executes 16 instructions to get into 32-bit mode and then performs DRAM and other hardware initialization required before Linux can take over.  
Line 64: Line 46:
Our primary motivation for the project was maintenance of large clusters, but not surprisingly interest and contributions have come from people with varying backgrounds.  
Our primary motivation for the project was maintenance of large clusters, but not surprisingly interest and contributions have come from people with varying backgrounds.  


Why do we need LinuxBIOS?  
=== Why do we need LinuxBIOS? ===


Current PCs used as cluster nodes depend on a vendor-supplied BIOS for booting. The BIOS in turn relies on inherently unreliable devices such as floppy disks and hard drives to boot the operating system. In addition, current BIOS software is unable to accommodate non-standard hardware making it difficult to support experimental work. The BIOS is slow and often erroneous and redundant and, most importantly, maintenance is a nightmare. Imagine walking around with a keyboard and monitor to every one of the 128 nodes in a cluster to change one BIOS setting.  
Current PCs used as cluster nodes depend on a vendor-supplied BIOS for booting. The BIOS in turn relies on inherently unreliable devices such as floppy disks and hard drives to boot the operating system. In addition, current BIOS software is unable to accommodate non-standard hardware making it difficult to support experimental work. The BIOS is slow and often erroneous and redundant and, most importantly, maintenance is a nightmare. Imagine walking around with a keyboard and monitor to every one of the 128 nodes in a cluster to change one BIOS setting.  
Line 74: Line 56:
Using a real operating system to boot another operating system provides much greater flexibility than using a simple netboot program or the BIOS. Because Linux is the boot mechanism, it can boot over standard Ethernet or over other interconnects such as Myrinet, Quadrics, or SCI. It can use SSH connections to load the kernel, or it can use the InterMezzo caching file system or traditional NFS. Cluster nodes can be as simple as they need to be - perhaps as simple as a CPU and memory, no disk, no floppy, and no file system. The nodes will be much less autonomous thus making them easier to maintain.  
Using a real operating system to boot another operating system provides much greater flexibility than using a simple netboot program or the BIOS. Because Linux is the boot mechanism, it can boot over standard Ethernet or over other interconnects such as Myrinet, Quadrics, or SCI. It can use SSH connections to load the kernel, or it can use the InterMezzo caching file system or traditional NFS. Cluster nodes can be as simple as they need to be - perhaps as simple as a CPU and memory, no disk, no floppy, and no file system. The nodes will be much less autonomous thus making them easier to maintain.  


Who is working on LinuxBIOS?  
=== Who is working on LinuxBIOS? ===


The LinuxBIOS project was started in the winter of 1999 in the Advanced Computing Laboratory at Los Alamos National Laboratory by Ron Minnich. Two undergraduate students, James Hendricks and Dale Webster spent their winter vacation putting together the proof of concept implementation.  
The LinuxBIOS project was started in the winter of 1999 in the Advanced Computing Laboratory at Los Alamos National Laboratory by Ron Minnich. Two undergraduate students, James Hendricks and Dale Webster spent their winter vacation putting together the proof of concept implementation.  
Line 81: Line 63:
Since then, a long list of people have contributed both in discussions and actual code. See our contributors page for details. Please don't be shy and let us know if you are missing from the list. It's not a purposeful omission, just an unfortunate mistake.  
Since then, a long list of people have contributed both in discussions and actual code. See our contributors page for details. Please don't be shy and let us know if you are missing from the list. It's not a purposeful omission, just an unfortunate mistake.  


Who is funding LinuxBIOS?  
=== Who is funding LinuxBIOS? ===


The LinuxBIOS project is funded by the Los Alamos Computer Science Institute and the Department of Energy's Office of Science.  
The LinuxBIOS project is funded by the Los Alamos Computer Science Institute and the Department of Energy's Office of Science.  


Will LinuxBIOS work on my machine?  
=== Will LinuxBIOS work on my machine? ===


See the status page for which mainboards are supported. Also, see the products page for a list of vendors selling products running LinuxBIOS.  
See the status page for which mainboards are supported. Also, see the products page for a list of vendors selling products running LinuxBIOS.  


What commercial products use LinuxBIOS?  
=== What commercial products use LinuxBIOS? ===


See the products page.  
See the products page.  


How can I help with LinuxBIOS?  
=== How can I help with LinuxBIOS? ===


Contact Ron Minnich for projects related to LinuxBIOS.  
Contact [[User:Rminnich|Ron Minnich]] for projects related to LinuxBIOS.  


   
   
Line 383: Line 365:




   /Christer  
  /Christer  




Line 806: Line 788:
Linuxbios@clustermatic.org
Linuxbios@clustermatic.org
http://www.clustermatic.org/mailman/listinfo/linuxbios
http://www.clustermatic.org/mailman/listinfo/linuxbios
 

Revision as of 17:58, 1 March 2005

Developer


Where is the mailing list archived? Where do I get the code?

How do I build?

Why is the code so complicated and what can I do to make it easier?

What chipsets are supported?

What is this POST card thing?

How do I contribute my changes?

How do I re-flash the BIOS?

How do I actually burn a flash ROM?

How do I burn a DoC?

Can I do any serious damage mucking around with this stuff?

How do I put a filesystem on DoC?

How do I turn off embedded sis630 devices?

What is a PIRQ table?

How do I set up etherboot with LinuxBIOS?

How do I set GEODE video?

How do I set up testbios?


General

What is LinuxBIOS?

LinuxBIOS aims to replace the normal BIOS found on PCs, Alphas, and other machines with a Linux kernel that can boot Linux from a cold start. LinuxBIOS is primarily Linux - about 10 lines of patches to the current Linux kernel. Additionally, the startup code - about 500 lines of assembly and 5000 lines of C - executes 16 instructions to get into 32-bit mode and then performs DRAM and other hardware initialization required before Linux can take over.


Our primary motivation for the project was maintenance of large clusters, but not surprisingly interest and contributions have come from people with varying backgrounds.

Why do we need LinuxBIOS?

Current PCs used as cluster nodes depend on a vendor-supplied BIOS for booting. The BIOS in turn relies on inherently unreliable devices such as floppy disks and hard drives to boot the operating system. In addition, current BIOS software is unable to accommodate non-standard hardware making it difficult to support experimental work. The BIOS is slow and often erroneous and redundant and, most importantly, maintenance is a nightmare. Imagine walking around with a keyboard and monitor to every one of the 128 nodes in a cluster to change one BIOS setting.


The LinuxBIOS gunzip's the Linux kernel straight out of NVRAM and essentially requires no moving parts other than the fan. It does a minimal amount of hardware initialization before jumping to the kernel start and lets Linux do the rest. As a result, it is much faster (current record 3 seconds), which has sparked interest in the consumer electronics community as well. Moreover, updates can be performed over the network.


Using a real operating system to boot another operating system provides much greater flexibility than using a simple netboot program or the BIOS. Because Linux is the boot mechanism, it can boot over standard Ethernet or over other interconnects such as Myrinet, Quadrics, or SCI. It can use SSH connections to load the kernel, or it can use the InterMezzo caching file system or traditional NFS. Cluster nodes can be as simple as they need to be - perhaps as simple as a CPU and memory, no disk, no floppy, and no file system. The nodes will be much less autonomous thus making them easier to maintain.

Who is working on LinuxBIOS?

The LinuxBIOS project was started in the winter of 1999 in the Advanced Computing Laboratory at Los Alamos National Laboratory by Ron Minnich. Two undergraduate students, James Hendricks and Dale Webster spent their winter vacation putting together the proof of concept implementation.


Since then, a long list of people have contributed both in discussions and actual code. See our contributors page for details. Please don't be shy and let us know if you are missing from the list. It's not a purposeful omission, just an unfortunate mistake.

Who is funding LinuxBIOS?

The LinuxBIOS project is funded by the Los Alamos Computer Science Institute and the Department of Energy's Office of Science.

Will LinuxBIOS work on my machine?

See the status page for which mainboards are supported. Also, see the products page for a list of vendors selling products running LinuxBIOS.

What commercial products use LinuxBIOS?

See the products page.

How can I help with LinuxBIOS?

Contact Ron Minnich for projects related to LinuxBIOS.


Developer

Where is the mailing list archived? 

The best archive out there is at the University of Maryland.


In addition, we've pieced together an archive that dates back to about the beginning of 2000 (including messages that were going to the freebios and openbios mailing lists).

Where do I get the code?

See download.

How do I build?

See the documentation. For help generating a config file, see Generate a config file.

Why is the code so complicated and what can I do to make it easier?

The reason is the complexity of the problem. We support a lot of hardware, and a given chip on a given board will most likely not be configured quite the same as the same chip on some other board.


To help make code navigation easier, pick a target and build that target. Then, in the build directory, type make tags or make etags to get your favorite tags file.

What chipsets are supported?

See status for the most up-to-date info..

What is this POST card thing?

A POST card will save your life. The term POST means Power On Self Test and comes from the original IBM specifications for the BIOS. Port 80 is a pre-defined port to which programs can output a byte. The POST card displays the byte in hex on its 2 digit display. We use a lot of POST codes in LinuxBIOS, so if you can tell us the POST code you see, we will have some idea of what happened.


If your LinuxBIOS machine is working properly, you will see it count up from 0xd0 to 0xd9 (while it is gunzipping the kernel) and then display 0x98 (Linux idle loop).

How do I contribute my changes?

Any one without commit privileges (which is most of you) need to get changes approved by Ron Minnich.

How do I re-flash the BIOS?

Download the appropriate flash update utility. Build the romimage as explained above and use the flash update utility to update the BIOS. Be warned that not all update utilities allow you to load your own BIOS image. For example, Intel decided to disallow it for the MS440GX mainboard (probably after hearing about us!) Here are some mainboard specific directions.

SiS 630/950 M/Bs Ollie Lho provided us with flash utilities for these boards under freebios/util/sis. flash_on turns on the flash write enable. This needs to be run before loading the DoC drivers. flash_rom allows you to use your SiS 630/950 M/Bs as a flash programmer. It currently supports JEDEC flash parts, AMD am29f040b models, MXIC MX29F002 models, and SST28SF040C models. Intel L440GX Get the System Update Package directly from Intel. mcopy the ten files created from running make phlash onto the Intel flash burner disk and use the update utility to burn the BIOS. To restore the original BIOS, set the recovery boot jumper on the motherboard, put the floppy in, and it will load and reflash the original BIOS. How do I actually burn a flash ROM?

Buy your favorite flash burner (we use a Needham Electronics EMP 30). Use make floppy to create the romimage and copy it to a floppy. Then use the provided software to burn the flash.

How do I burn a DoC?

Currently, only the DoC Millennium is supported. See the documentation.

Can I do any serious damage mucking around with this stuff?

Any time you stick your hand into an open machine while the power is on, you're risking life and limb. That said, there are also some other not-so-nice things that can happen if you mess up (not that we would know).

Incorrect inserstion of the flash (1 casualty) Incorrect jumper settings (1 casualty) Aggressive and/or inappropriate use of metal objects such as screwdrivers (2 casualties) Miscellaneous miswirings and mishandlings (3+ casualties)

And finally a note on electrostatic discharge (ESD) and ESD protection thanks to Bari Ari.


ESD can damage disk drives, boards, DoC's and other parts. The majority of the time, ESD events cause the component to degrade, but not fail testing procedures, resulting in failure at a later date. Because components do not fail immediately, technicians often underestimate the cost of not using ESD prevention measures. Provide at minimum some ESD protection by wearing an antistatic wrist strap attached to the chassis ground on your system when handling parts.


Always handle boards carefully. They can be extremely sensitive to ESD. Hold boards only by their edges. After removing a board from its protective wrapper or from the system, place it component side up on a grounded, static free surface. Use a conductive foam pad if available. Do not slide the board over any surface.


To further reduce the chances of ESD, you should create an ESD safe workstation that includes at minimum:

Conductive rubber mat, with a lead wire that can be connected to a metal surface to create a ground. ESD wrist strap, which has a resistor inside the strap and a lead wire that can be connected to a metal surface as a ground. The grounding wire on the wrist strap should have between 1 and 10 Megaohms of resistance. The resistor should protect you in case you come in contact with a voltage source. If the resistor is bad or not included, the wrist strap is useless. An accidental shock could be serious and even deadly! Table or workspace that is clean, clear of dust, and away from electrical machinery or other equipment that generates electrical currents. The idea is to ensure that all components you are going to interact with have the same charge. By connecting everything to the computer case, you ensure that the components of the case, the chair, and your body all have the same charge. If every object has the same charge, the electrons will not jump from one object to another minimizing the risk of ESD damage. How do I put a filesystem on DoC? OK, here is a little HOWTO on how to set up MTD with a file system.

This is a m810lmr, booting out of DoC. I am going to reserve the first 2M for kernel. So the layout will be the first 2M for linuxbios and kernel, and 6M for a file system. Kernel is 2.4.17, with linux-2.4.17-sis.patch from linuxbios source tree, and config-2.4.17-sis from the linuxbios source tree. Mainboard is the pcchips m810lmr.


So I:

modprobe doc2001 
modprobe docprobe 
dmesg 


which shows:


DiskOnChip Millennium found at address 0xFFFC8000

Flash chip found: Manufacturer ID: 98, Chip ID: E6 (Toshiba TC58V64AFT/DC) 
1 flash chips found. Total DiskOnChip size: 8 MiB 
mtd: Giving out device 0 to DiskOnChip Millennium 
Ignoring DiskOnChip Millennium at 0xFFFCA000 - already configured 
Ignoring DiskOnChip Millennium at 0xFFFCC000 - already configured 
Ignoring DiskOnChip Millennium at 0xFFFCE000 - already configured 
Ignoring DiskOnChip Millennium at 0xFFFD0000 - already configured 
Ignoring DiskOnChip Millennium at 0xFFFD2000 - already configured 
Ignoring DiskOnChip Millennium at 0xFFFD4000 - already configured 
Ignoring DiskOnChip Millennium at 0xFFFD6000 - already configured 
(etc..) 
Now I need MTD utilities. 
So I: 
cvs -d :pserver:anoncvs@cvs.infradead.org:/home/cvs login 
CVS password: 

(password is anoncvs) 
Then: 
cvs -d :pserver:anoncvs@cvs.infradead.org:/home/cvs co mtd 


Forget the drivers and such, you don't need them. What you need is the tools.

cd mtd/tools 
make 


Go ahead and copy the executables somewhere handy, you'll need them.


Now we need to make the last 6M into a "disk". We need to format it. The tool is nftl_format, so:

[root@carly util]# ./nftl_format 
$Id: nftl_format.c,v 1.17 2001/08/29 14:28:48 dwmw2 Exp $ 
Usage: ./nftl_format [ []] 
[root@carly util]# expr 2048 \* 1024 
2097152 
[root@carly util]# expr 6 \* 1024 \* 1024 
6291456 
[root@carly util]# ./nftl_format /dev/mtd0 2097152 6291456 
$Id: nftl_format.c,v 1.17 2001/08/29 14:28:48 dwmw2 Exp $ 
Phase 1. Checking and erasing Erase Zones from 0x00200000 to 0x00800000 
Phase 2.a Writing NFTL Media Header and Bad Unit Table 
Phase 2.b Writing Spare NFTL Media Header and Spare Bad Unit Table 
Phase 3. Writing Unit Control Information to each Erase Unit 


we now have a formatted disk in there. We can now partition it.


[root@carly util]# modprobe nftl

dmesg shows LOTS of errors, since this was never partitioned ... 


Also, if you don't have /dev/nftla,

[root@carly util]# mknod /dev/nftla b 93 0 


Don't use the script just yet, it makes /dev/nftla as b 93 16, which is the wrong unit #.


now fdisk /dev/nftla


[root@carly util]# fdisk /dev/nftlA

Command (m for help): n 
Command action 
e extended 
p primary partition (1-4) 
p 
Partition number (1-4): 1 
First cylinder (1-1, default 1): 
Using default value 1 
Command (m for help): p 
Disk /dev/nftlA: 1 heads, 12224 sectors, 1 cylinders 
Units = cylinders of 12224 * 512 bytes 
Device Boot Start End Blocks Id System 
/dev/nftlA1 1 1 6111+ 83 Linux 
Partition 1 has different physical/logical endings: 
phys=(768, 0, 0) logical=(0, 0, 12224) 
Partition 1 does not end on cylinder boundary: 
phys=(768, 0, 0) should be (768, 0, 12224) 
Command (m for help): w 
The partition table has been altered! 
Calling ioctl() to re-read partition table. 
WARNING: If you have created or modified any DOS 6.x partitions, please see the fdisk manual page for additional information. 
Syncing disks. 
[root@carly util]# mknod /dev/nftlA1 b 93 1 
[root@carly util]# mke2fs /dev/nftlA1 
mke2fs 1.23, 15-Aug-2001 for EXT2 FS 0.5b, 95/08/09 
Filesystem label= 
OS type: Linux 
Block size=1024 (log=0) 
Fragment size=1024 (log=0) 
1528 inodes, 6111 blocks 
305 blocks (4.99%) reserved for the super user 
First data block=1 
1 block group 
8192 blocks per group, 8192 fragments per group 
1528 inodes per group 
Writing inode tables: done 
Writing superblocks and filesystem accounting information: done 


This filesystem will be automatically checked every 37 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.


[root@carly util]# mount /dev/nftlA1 /mnt

[root@carly util]# cd /mnt 
[root@carly mnt]# df . 
Filesystem 1k-blocks Used Available Use% Mounted on 
/dev/nftlA1 5915 13 5597 1% /mnt 
[root@carly mnt]# 


and so you now have an ext2 file system on the DoC.


ron

How do I turn off embedded sis630 devices? From aip@cwlinux.com Mon Mar 25 08:54:07 2002

Date: Mon, 25 Mar 2002 22:07:54 +0800 
From: Andrew Ip 
To: Kei Furuuchi 
Cc: linuxbios@lanl.gov 
Subject: Re: How to turn off unused pci device. 
Hi, 
> I have pcchips m758lmr which has audio chip besides sis630. 
> those functions in sis630 are not used in the motherboard. 
> But, the functions keep coming up. How do I turn off those? 
The following is from Nikolai Valdych previous message. Hope this help. 
-Andrew 
-- 
Andrew Ip 
Email: aip@cwlinux.com 
Actualy, it was pretty simple 0x7c00 - All devices enabled, You play with first 4 bits only. Cos there are 4 devices, so you have any combination of 4 bits. Set bit to 1 to turn off the device, bit 0 to enable it. This is the device list: 

Multimedia Audio controler Modem controler Ethernet sis930 controler USB controler. For example, to turn off Ethernet + USB it would be:

0x7c0c -> 1100 in binary (first 4 bits) 
To turn off Multimedia audio : 
0x7c01 -> 0001 
in binary and so on... maybe there are more detail, but this is enogh for me, Ollie, again thanks! 
nikolai 
p.s. though my modem is not yet working..... damn driver...... 

What is a PIRQ table?

From Adam Sulmicki:


I found beautfiul descrition of the BIOS implementation of the PIRQ in the red PCI book.

I found the description of the $PIR data structure in the

       http://www.microsoft.com/hwdev/archive/BUSBIOS/pciirq.asp

looking over linuxbios sources I see that it saves the $PIR data structure somewhere between 0xf0000 & 0x100000.

so it seems I'll have to search for $PIR and then save it before copying over our bios. sigh. hoped for some fixed address in mem.

-- Adam http://www.eax.com The Supreme Headquarters of the 32 bit registers

How do I set up etherboot with LinuxBIOS? 

Note from Ron: I have edited this somewhat to remove Geode-specific items.

Christer Weinigel writes: To: rminnich@lanl.gov

Cc: linuxbios@lanl.gov
Subject: Re: LinuxBIOS + Etherboot HOWTO?

I had some trouble using LinuxBIOS + etherboot...


My bad, I messed up and used mkelfImage-1.6 that I got from ftp.lnxi.com, when I realized that I ought to use the one from freebios/util everything started working.


Here's what I did to get LinuxBIOS + Etherboot loading and booting a Linux kernel using TFTP.


  /Christer 


Get etherboot-5.0 from the CVS tree on etherboot.sourceforge.net.


Modify etherboot-5.0/src/Config, comment out:

   # BIOS select don't change unless you know what you are doing
   #CFLAGS32+=     -DPCBIOS


and uncomment the following:

   # Options to make a version of Etherboot that will work under linuxBIOS.
   CFLAGS32+= -DLINUXBIOS -DCONFIG_TSC_CURRTICKS  -DCONSOLE_SERIAL \
              -DCOMCONSOLE=0x3f8 -DCOMPRESERVE -DCONFIG_PCI_DIRECT -DELF_IMAGE 


Compile Etherboot to make an elf file for your ethernet card:

    make bin32/natsemi.elf


Compile and install mkelfImage from freebios/util/mkelfImage.


Create a bootimage to put on your TFTP server:

   mkelfImage --command-line="root=/dev/hda2 console=ttyS0,38400" \
              --kernel vmlinux -o /tftpboot/kernel


Finally, make sure that your BOOT/DCHP server is answering and that the TFTP server is active.


Tell LinuxBIOS to boot an elf Image, and tell LinuxBIOS where it is:

   option USE_ELF_BOOT=1


I have placed natsemi.elf in the first 64k of my BIOS flash chip, and LinuxBIOS in the second 64k.

   insmod bios.o
   dd if=natsemi.elf of=/dev/bios bs=64k
   dd if=linuxbios.rom of=/dev/bios bs=64k seek=1


Finally boot LinuxBIOS.

How do I set GEODE video? From christer@weinigel.se Wed Nov 27 07:47:17 2002 Date: 27 Nov 2002 10:55:01 +0100 From: Christer Weinigel To: Adam Bezanson Cc: linuxbios@clustermatic.org Subject: Re: Geode Kernel Config

"Adam Bezanson" writes:

> I've got an Eval card from National Semi that contains > the SC1200. I'd like to try LinuxBios on it. > I've downloaded both the 2.4.18 and 2.4.19 kernels to start with. > What patches do I need to apply to the kernel? > Is there a config file I can use to configure the kernel, or > should I do it manually?

A normal 2.4 Linux kernel will work fine as long as you compile for a 586 CPU (CONFIG_M586), not Pentium or higher (CONFIG_M586TSC and up) since the TSC behaves a bit differently.

If you want support for the watchdog or the GPIO pins in a 2.4 kernel, you can find an old patch from me at:

   http://groups.google.com/groups?selm=20020226015215.20118F5B%40acolyte.hack.org&oe=UTF-8&output=gplain

An updated version of this patch has been included in Linux 2.5. Alan Cox' 2.5 kernel also has support for doing DMA on the SC1200 IDE controller; I don't know if there is a corresponding patch for 2.4.

Other than that, take a look at the freebios/src/mainboard/nano/nano directory and make a copy of it. All you should have to do is to modify the Pin Multiplexing Register (PMR) and Miscellaneous Config Register (MCR) in the Config file and to modify the irq assignments.

Depending on what you want to do, there are a few limitations with the current LinuxBIOS on the SC1200:

   There is no video support in LinuxBIOS itself, so you won't get
   any video until you have loaded the NatSemi Geode Linux
   framebuffer driver (can be found at www.linux4.tv under the
   heading SP1SC10 Platform Image).
   There is no SMM/VSA support at all, this means that anything
   relying on it won't work.  What this means is that Audio won't
   work.

Other than that everything works fine, IDE in PIO mode, the PCI bus, watchdog, GPIOs, everything.

 /Christer

-- "Just how much can I get away with and still go to heaven?"

Freelance consultant specializing in device driver programming for Linux Christer Weinigel http://www.weinigel.se _______________________________________________ Linuxbios mailing list Linuxbios@clustermatic.org http://www.clustermatic.org/mailman/listinfo/linuxbios

How do I set up testbios? 

From daubin@actuality-systems.com Wed Oct 6 10:23:10 2004 Date: Tue, 5 Oct 2004 15:19:24 -0400 From: Dave Aubin To: linuxbios@clustermatic.org Subject: RE: Testbios help with nvidia 6800Gt and simple how to

I've taken the time to put together a simple testbios faq. I hope it is helpful. Feedback and additions are welcome.

Thanks, Dave

Testbios (vgabios) Faq

Date: 10/5/2004 Author(s): David Aubin daubin@actuality-systems.com

Purpose: Testbios is an i386 emulator that sits on top of user space linux. It's primary purpose is to provide program video rom's in to the cached memory area.

Faq Contents: 1. Where to obtain testbios 2. Prerequisites 3. How to build testbios 4. How to retrieve a good video bios 5. How to use testbios

1. Where to obtain testbios

       A. Testbios(vgabios) can be retrieved from the

linuxbios/freebios source tree: http://www.linuxbios.org/developer/download/index.html

2. Prerequisites

       A. You must have installed pci-utils
               i.  Get

http://atrey.karlin.mff.cuni.cz/~mj/pciutils.shtml

3. How to build testbios:

       A.  cd freebios/util/vgabios
       B.  Edit ./Makefile and fill in the correct values for your

environment

           I build on a 64 AMD so my makefile looks like this

--Being ./Makefile for x64-- CC = gcc ARCH  := $(shell uname -m | sed -e s,i[3456789]86,i386,) INCLUDE = -I ../pciutils-2.1.11 CFLAGS = -Wall -Ix86emu/include -O2 -g $(INCLUDE)

INTOBJS = int10.o int15.o int16.o int1a.o inte6.o OBJECTS = testbios.o helper_exec.o helper_mem.o $(INTOBJS) LDFLAGS = -static-libgcc -static

LIBS = x86emu/src/x86emu/libx86emu.a ../pciutils-2.1.11/lib/libpci.a

  1. user space pci is the only option right now.

OBJECTS += pci-userspace.o

ifeq ($(shell if test "$(ARCH)" == "x86_64" ; then echo 1; fi), 1)

       CFLAGS +=-m32 -march=i386
       endif
       all: testbios
       testbios: $(OBJECTS) $(LIBS)
               $(CC) $(CFLAGS) -o testbios $(OBJECTS) $(LDFLAGS)

$(LIBS)

helper_exec.o: helper_exec.c test.h

x86emu/src/x86emu/libx86emu.a:

       $(MAKE) -C x86emu/src/x86emu/ -f makefile.linux
       clean:
               $(MAKE) -C x86emu/src/x86emu/ -f makefile.linux clean
               rm -f *.o *~ testbios
       distclean: clean
               $(MAKE) -C x86emu/src/x86emu/ -f makefile.linux clean

--End ./Makefile--

       C.  Edit ~vgabios/x86emu/src/x86emu/makefile.linux and fill in

the correct values for your environment

           I build on a 64 AMD so my makefile looks like this

--Begin ~vgabios/x86emu/src/x86emu/makefile.linux--

  1. Realmode X86 Emulator

Library

  1. Copyright (C) 1996-1999 SciTech Software, Inc.
============================================================
  1. Permission to use, copy, modify, distribute, and sell this software

and

  1. its documentation for any purpose is hereby granted without fee,
  2. provided that the above copyright notice appear in all copies and

that

  1. both that copyright notice and this permission notice appear in
  2. supporting documentation, and that the name of the authors not be

used

  1. in advertising or publicity pertaining to distribution of the

software

  1. without specific, written prior permission. The authors makes no
  2. representations about the suitability of this software for any

purpose.

  1. It is provided "as is" without express or implied warranty.
  2. THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  3. INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN

NO

  1. EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  2. CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS

OF

  1. USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  2. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE

OR

  1. PERFORMANCE OF THIS SOFTWARE.
============================================================
  1. Descripton: Linux specific makefile for the x86emu library.

TARGETLIB = libx86emu.a


OBJS=\ debug.o \ decode.o \ fpu.o \ ops.o \ ops2.o \ prim_ops.o \ sys.o

$(TARGETLIB): $(OBJS)

       ar rv $(TARGETLIB) $(OBJS)
       INCS   = -I. -Ix86emu -I../../include
       CFLAGS += -D__DRIVER__ -DFORCE_POST -D_CEXPORT= -DNO_LONG_LONG

-DDEBUG

       ARCH   := $(shell uname -m | sed -e s,i[3456789]86,i386,)
       ifeq ($(shell if test "$(ARCH)" == "x86_64" ; then echo 1; fi),

1)

               CFLAGS +=-m32 -march=i386
               endif


.c.o:

  1. gcc -m32 -march=i386 -g -O -Wall -c $(CFLAGS) $(INCS) $*.c
       gcc -g -O -Wall -c $(CFLAGS) $(INCS) $*.c

.cpp.o:

  1. gcc -m32 -march=i386 -c $(CFLAGS) $(INCS) $*.cpp
       gcc -c $(CFLAGS) $(INCS) $*.cpp

clean:

       rm -f *.a *.o

validate: validate.o libx86emu.a

       gcc -o validate validate.o -lx86emu -L.

--End ~vgabios/x86emu/src/x86emu/makefile.linux--

       D.  Once built you could have a 32bit testbios executable made.

Depending on your embedded environment you might want to have it built shared as the above example makes it static. Just remove -static-libgcc -static from the LDFLAGS on ./Makefile if you wish to have it built shared.

4. How to retrieve a good video bios

       A.  There are sites that have video bios roms on their website.
           I know of this one for nvidia cards:
           http://whitebunny.demon.nl/hardware/chipset_nvidia.html
       B.  However you should be able to retrieve your own video bios

as well

           with linux.
           i.  Boot up a machine with a commercial bios (not linux

bios) with

               the video card you wish to work under linux bios.
           ii. From the command line enter:
               dd if=/dev/mem of=vgabios.bin skip=1536 count=128 or 
               dd if=/dev/mem of=vgabios.bin bs=1k count=64 skip=786432
               This assumes you card's bios is cached in 0xc0000.  You
               can see where and how much your card's bios is using by
               doing a cat iomem | grep "Video ROM"
               a.  dd Explained (man dd to learn more):
                       1.  if is the location to retrieve from.
                       2.  of is the output file (your rom image)
                       3.  skip jumps n blocks where the default n is

512 bytes

                       4.  count is how many blocks you wish to read
                       5.  bs is the block size
       C.  You now have a video bios image

5. How to use testbios

       A.  Currently testbios only works from user space linux

(10/4/04)

       B.  Example from a linux command line or script enter the

following to

           get your video bios programmed:
           ./testbios -s 65536 --abseg /dev/mem ./vgabios.bin
           i. Testbios explained
               a.  -s  how much of the video bios is there
               b.  --abseg where would you like to write this (/dev/mem

default)

               c.  filename of video bios
               d.  -d diag mode 
                       1.  How to get pci busdevfn
                               A.  lspci
                               B.  look for your video card
                                       Example:
                                       2:00:00
                                       2 (00 << 3) | 00 = 0x200
                                       Example:
                                       00:12.0:
                                       0 (12 << 3) | 0 = 0x90
               e. -t dump 
               f. -c codesegment Where do you want to start, default is

0xc0000

               g. -b base  Where do you want base to be default is

0xc000

               h. -i instruction pointer usually left off as the

default



Original Message-----

From: linuxbios-admin@clustermatic.org [1] On Behalf Of Dave Aubin Sent: Tuesday, October 05, 2004 2:22 PM To: Richard Smith Cc: linuxbios@clustermatic.org Subject: RE: Testbios help with nvidia 6800Gt and simple how to

Hi,

 Thank you:)  Yes, it was at 0xc0000-0xc7fff, which is only 32k.

But the image I got from the windows tool was 64k (double 8000). Weird. I would like to stay away from window tools.

 The info you provided is nice.  I wish there was a way for us To make

a faq and we could add this to the testbios faq. There Is a lot of good info on the clustermatic list, but it is all Dispersed.

 Ron if I write a simple faq can you provide some mechanism to Allow

updates to it?

Thanks, Dave


Original Message-----

From: Richard Smith [2] Sent: Tuesday, October 05, 2004 2:16 PM To: Dave Aubin Cc: linuxbios@clustermatic.org Subject: Re: Testbios help with nvidia 6800Gt and simple how to

Dave Aubin wrote:

> It seems my dd returned an unusable binary. I found a good binary for

> The nvidia card from here: > http://whitebunny.demon.nl/hardware/chipset_nvidia.html >

I was wondering about your dd command that but I had not had a chance to respond yet.

This is what I use:

dd if=/dev/mem of=vbios.bin bs=1k count=64 skip=786432

That will rip the bios from 0x0c0000. You can verify that you actually have bios there with

 'hd -s 0x0c0000 -n 256 /dev/mem'

in some cases it may be located at 0x0e0000 rather than 0x0c0000.

It should start with the 0x55aa (Little endian) or 0xaa55 (big endian) and futher on you should see some text identifying the bios.


-- Richard A. Smith


_______________________________________________ Linuxbios mailing list Linuxbios@clustermatic.org http://www.clustermatic.org/mailman/listinfo/linuxbios