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

Re: Booting oskit from linear flash



>> I'd like to embed oskit into a diskless x86 system with flash memory and
>> no bios.
>>
>> Does oskit come with a boot loader that can do this?
>
>No, it does not.  But we are interested in making it possible if it's not
>a huge amount of work.  What kind of boot loader would you use to make
>something bootable from flash memory?

Okay, perhaps I can help here.

I made a small multiboot-compliant bootloader for the Alliance project
(www.allos.org.  We don't use OSKit but it should work.)  It's written in
x86 assembly.  It uses DOS for the disk routines needed to load the
multiboot kernel (I was going to change it to load from the bootsector
sometime in the future, but have never done so because I use GRUB myself
anyway :).  You won't need that, though.)

Basically, you'll probably want to do this.  You take my bootloader code,
and strip all the disk stuff and the ELF interpreter (after all, your
kernel is in your flash memory already, you don't need to load it.)  You
stick it in the .text section, call the entry point _bootstrap, and link it
in such a way that .text is at linear 0xf000 (??. I can't check this at the
moment, but IIRC that's the entry point of the BIOS on x86,) ie with ld
-Ttext 0xf000 bootstrap.o [...].  You should also tell the linker that the
entry point isn't called _start, but _bootstrap (can't check the cmdline
option at the moment, do man ld or bug me about this later :).)  Then you
should change my bootloader code that it always jumps to the symbol _start.

That should, more or less, do it.  compile it, link it, and burn it into
your flash memory at the correct address.  If I forgot something, tell me
:).  I don't have any experience with this sort of thing, but it *should*
do the trick.

If you're interested, I can mail my loader code to this list, or privately.
One thing, it was written in NASM syntax (I prefer AT&T myself, but at the
time NASM seemed the right choice for some reason) so you'll probably want
to translate it.

It needs a bit of work but I don't think it'll be very difficult.

-- Ramon



---
Ramon van Handel   <vhandel@chem.vu.nl>
Chemistry Student, OS Programmer and all-round Weirdo
The ant has made himself illustrious / Through constant industry industrious.
So what? Would you be calm and placid / If you were full of formic acid?
(Ogden Nash)


=================================
To unsubscribe from this list, send a message with a body of "unsubscribe"
to oskit-users-request@flux.cs.utah.edu