help!!!who can explain the interface between linuxbios and linux.

Eric W. Biederman ebiederman at lnxi.com
Tue Feb 25 11:43:00 CET 2003


王海明 <whm_buaa at sina.com> writes:

> dear all:
>  I have developed a linuxbios debug system succefully.I introduced gdb stub into
> my system. In my system ,developers can debug linuxbios at source code level. I
> setup the stub at the beginning of the begin of the function of hardwaremain,
> the first c function.Now the system can
> 
> excute the function of "step",'step into" "step out" ,"breakpoint"and so on. but
> the system has not been tested fully.
> 
>     I wonder if my design is usefull to others.
> by the way, I have several question.I will appreciate anyone's any idea!
> my question are as follows:

To some extent.  Being able to dump the contents of data structures
is generally more useful than the ability to single step.  The code
that needs the most debugging on a routine basis is the ram initialization
and your debugger does not work that early.

> 1.  As we know, traditonal BIOS not only do some initialization work, but also
> put some data about the hardware in somewhere.BIOS even offer some routine such
> as intx( I know that In linux souce file "setup.s",int10, int13and int15 are
> used),but linuxbios doesn't offer.
> 
>    my question is: what  is the mininal need of linux kernel's starting?

A table of the data usually collected by setup.S.  Basically just
the memory size.
 
>     what data does It need in detail? where does the data need to be placed in
> detail?
> 
>    what routine does linux kernel need for it's starting ?
>    how does linuxbios offer these data and routines?

see mkelfImage.  For the most part we skip arch/i386/boot/setup.S in the kernel and
jump right to arch/i386/kernel/head.S


> 2. the second question is about PCI. I found that in linuxbios, some PCI
> initialization work is done.as we know ,in linux kernel, the same work was be
> done.Some linuxbios PCI initialization code is even the same with linux
> kernel. my question is:
> 
>     if the initialization in linuxbios is necessary?

Yes.  The targets in Linux and LinuxBIOS with respect to pci initialization are
totally different.  The Linux code when in doubt assumes the BIOS set
it up properly, it is good enough to handle random hot-plug devices,
and it has to cope with the fact that we are using some hardware
while the pci bus is being setup.  LinuxBIOS on the other hand know it
must setup all of the pci devices, and it does not need to cope devices
that are already in use.

> 3. my third question is about etherboot.
>    I get a ide-patch of etherboot, and I succefully boot my system via IDE .I
> have read the code for a long time,but still have no idea about it. I found it
> seems does not do the same as setup.s,the kernel loader of traditional linux.who
> can explain it to me?

Roughly the boot process under LinuxBIOS or etherboot is simple.
There is a file (preferably an ELF executable).  That file specifies
where chunks of it should be loaded into memory, and those chunks are
copied where they belong.  In addition an entry point is specified and
after the loading is complete that entry point is jumped to.

The major difference is that everything happens in flat 32bit mode.
That is x86 protected mode with paging disabled.  Which is the
simplest processor mode to run in.

>   I know there are some clever and experienced man in this site.I am very
> interested in this topic and admire all the man with good skills.I am looking
> forward to some help.

I hope this helps.

Eric




More information about the coreboot mailing list