[openbeos] Re: Stage 1 Bootloader

  • From: Eike Dehling <e.e.dehling@xxxxxxxxxxxxxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Mon, 25 Nov 2002 20:36:52 +0100

At 20:16 25-11-2002 +0100, you wrote:

Eike Dehling <e.e.dehling@xxxxxxxxxxxxxxxxxx> wrote:
> On the kernel team page i spotted a new item: stage 1 boot loader.
> Now when
> you look on the internet you see tons of different boot loaders, each
> doing
> exactly the same thing: loading the second stage loader.

Short answer: nope :-)
That's not correct, if you would have read the description of the task
you would know that the stage 1 boot loader loads the OpenBeOS "zbeos"
equivalent from a BFS disk. Now, adding support to GRUB to be able to
load from BFS is probably more complicated than only doing a very basic
BFS loader  (though it probably have to be done in assembly, due to the
lack of 16bit real mode compilers).

Ok. So it's at least a little more intelligent than some standard blocklist loader :)
Grub does have support for about 5 or 10 different filesystems, so there are enough examples to look at when implementing BFS.
Also it can load with blocklists instead of from a filesystem, so it could already now load zbeos (maybe not pass parameters in the correct way ...) But i don't see where your lack of real mode compilers comes from ... borlands turbo C (available for free from the borland museum), MS quick C (still commercial i guess) are just some examples. of course they are DOS programs ... Although making it in assembly is probably easier since compilers tend to make rather big code, and 800 bytes is not very much.


> Loading by multibooot standard would i guess be an item for R2, since
> it
> probably requires modifying the boot procedure. But not using yet
> another

I will have a closer look at the multiboot standard before defining the
protocol between stage 2 and the kernel. If it's not too much work, I
would try to be compliant, just to not have to change the protocol
again in the forseeable future.
It is actually quite simple: your code is loaded in 32 bit mode with linear 4gig segements and a20 enabled.
The code should be in a.out (requires a multiboot structure somewhere in the code) or in elf.
You get passed a pointer to a structure with parameters in one of the registers. (memory map, command line, loaded modules, etc.)


Eike.


Other related posts: