Page 2 of 2

Posted: Mon Feb 04, 2008 1:29 am
by xyzzy
I compile a symbol table into my kernel - the first time it links the Makefile adds in a fake symbol table, then runs a script to generate a real symbol table and links again with that, then a final time to get the right addresses for the symbols. In the symbol table there's an array of ksym_t's and an int stating how many symbols there are. Then the code that access the symbol's can just loop through the array.

Posted: Mon Feb 04, 2008 1:30 am
by ucosty
kscguru wrote:Grub, alas, cannot load mine; there is a 32-to-64-bit switch, so I have to load myself in a bootstrap stage. (Not terribly hard to do.)
You know, I had a brainwave regarding that today. What if you have grub load a 32-bit to 64-bit mini kernel that then loads the real kernel from a grub image? A third stage for grub, would be a good way to put it.

Posted: Mon Feb 04, 2008 5:31 pm
by AndrewAPrice
ucosty wrote:
kscguru wrote:Grub, alas, cannot load mine; there is a 32-to-64-bit switch, so I have to load myself in a bootstrap stage. (Not terribly hard to do.)
You know, I had a brainwave regarding that today. What if you have grub load a 32-bit to 64-bit mini kernel that then loads the real kernel from a grub image? A third stage for grub, would be a good way to put it.
Some real-mode kernels do the opposite when loaded into grub. Sort of sad in a way :(

Posted: Tue Feb 05, 2008 4:58 am
by AJ
ucosty wrote:You know, I had a brainwave regarding that today. What if you have grub load a 32-bit to 64-bit mini kernel that then loads the real kernel from a grub image? A third stage for grub, would be a good way to put it.
[plug]
That's what CBoot (see the sig - screenshots here is partly an attempt to do. CBoot is installed as GRUB's kernel and relocates the real kernel which is a GRUB module. It is also capable of having two kernels in memory and deciding whether to launch the 32 or 64 bit version based on what the CPU supports.

It installs all paging necessary and also passes argc and argv, so your kernel's 'main' function can have that 'traditional' feel to it. It sets up a physical memory stack or bitmap so that your kernel doesn't have to and switches VESA mode through the command line arguments passed from GRUB. It has a debug console too.
[/plug]

Let me know if you want an up-to-date floppy image and I'll put it up on my web site. CBoot already has all the features mentioned above, but there's still a lot of code tidying to do!

Cheers,
Adam