Netboot Mailing List (by thread)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: booting a ELF binary



Hi Ton,

 > It's actually an operating system. The boot system is based on a PC
 > based SVR4 system. The boot loader sets up some tables in low mem,
 > before starting the OS it first updates those tables, so I think the OS
 > uses them. As these tables depend on the SVR4 system I haven't here
 > there are some more problems to solve, but that's not for this list.
 > allthough I appreciate any help on info on this subject (:-).

Once you figure out what that code does, it should be rather
straight-forward to directly include it in your version of mknbi.

 > Assume I know how to setup those tables in low mem, I should still do
 > that somehow next to loading the OS. The mknbi programs do that for
 > Linux and DOS so I should write one myself. Well, what should be the
 > structure of the resulting image made by mknbi that's loaded by the
 > bootrom?

Take a look at the documentation that comes with etherboot or point
your browser to
http://www.syd.dit.csiro.au/staff/ken/personal/etherboot/doc/html/spec.html 

This document describes the file format that is understood by both
etherboot and netboot. All of the mknbi programs do two things:

 - create a tagged image file that includes the program file plus any
   additional files (e.g. ram disk image)

 - attach some customized assembly code that makes sure, that all
   required initializations are performed, before the image is
   executed; this is usually the more difficult part of writing a new
   mknbi program. You will have to write this part of the program in
   x86 assembly language, unless you have access to some development
   tools that can create 16bit code (e.g. Bruce Evan's bcc C
   compiler).

 > Do I need to change the bootrom itself? Is there some magic word for
 > each type of mknbi program that the bootrom should be aware of? I prefer
 > to keep as much of the stuff the same (read: working)

Nope. You do not have to do any changes to the BOOT Prom. The tagged
image file format has been designed to be sufficiently flexible so
that changes to the BOOT Prom should never be neccessary.

 > The bootrom should start a program within the image, where should the
 > image be placed?, what memory locations are used?

This is detailed in the document that I referenced above. The BOOT
Prom uses the lower 64kB and the upper 32kB of conventional memory. If 
your image needs to go into either of these spaces, you will have to
relocate it after the BOOT Prom is done loading the file. In all other 
cases, you can have the BOOT Prom do all the loading and
relocation. Both etherboot and netboot support loading into
conventional and extended memory.

 > The program to be started should setup those low mem tables, then
 > loading the OS and start it, the priciple is easy,as usual.
 > I have a bootflop(SVR4 of course :-(), is it easy to change it into a
 > ramdisk?

If you are very lucky, you might just be able to use the mknbi-dos
program to turn your boot disk into an image file, but this depends a
lot on how the boot code for your program is written.

 > That's sounds hopefull.  I have the source code (licenced, so I may
 > not show it)

:-(

 > for the bootflop, but it's very very dependent on the SVR4 system,
 > so I can only look at it and have to combine the relevant parts
 > with the relevant parts of the bootrom and mknbi stuff. And apart
 > from my zillions of questions that's what I like to know, where
 > should I start, what do I need to know before hand

Try understanding exactly what your boot floopy code does and then
read the document on the tagged image file format. Afterwards, you
should have all the information to combine the different source codes
into a new program that does what you want to do.


Markus

-- 
Markus Gutschke                         Internet: markus@infoscape.com
Infoscape, Inc                          Phone:    +1-415-537-3778
657 Mission Street, Suite 200
San Francisco, CA 94105

Disclaimer: The above message represents my personal opinion; It does
            not constitute an offical statement by Infoscape!

PGP signature



For requests or suggestions regarding this mailing list archive please write to netboot@gkminix.han.de.