Page 1 of 1

Boot Loader sans FAT?

Posted: Mon Apr 11, 2005 9:55 pm
by Jubbens
I'm starting my OS project, and I hope to keep it as simple as possible. The problem with that plan is that OSdev isn't simple. I ran into a problem in my first step: the boot sector.

My boot loader needs to be able to load my kernel, but I don't want to screw with FAT yet. Is it possible to write my kernel to a physical location on the floppy and just have my loader look there? Any pointers on doing this?

Thanks.

Re:Boot Loader sans FAT?

Posted: Mon Apr 11, 2005 10:17 pm
by Dex4u
Why not do what i do and load your OS with bootprog, this let you boot a bin, com or mz exe, from a fat12 floppy, once the bootprog is put on the boot sector, all you do is put your OS on the floppy and reboot your pc simple.

Note: It loads a file called a certan name.
you can down load it here: http://alexfru.chat.ru/epm.html#bootprog

Re:Boot Loader sans FAT?

Posted: Mon Apr 11, 2005 10:42 pm
by Colonel Kernel
There is also a ready-made floppy with GRUB installed on it. That's what I use and it works great.

http://www.osdev.org/osfaq2/index.php/W ... k%20Images

Re:Boot Loader sans FAT?

Posted: Tue Apr 12, 2005 1:47 am
by Pype.Clicker
another option is just to start writing your kernel at a "well known" location on the floppy and start reading sectors from that point. I suggest the amount of sector to be generated automatically from the image's size (so that you don't miss parts of your kernel when it'll get bigger ;)

You can even keep the floppy FAT-compatible by placing your kernel in the "reserved sectors" ...

Re:Boot Loader sans FAT?

Posted: Tue Apr 12, 2005 5:40 am
by bubach
If you want to have your kernel directly after the bootsector you can put it on the floppy at offset 0x200 with PARTCOPY, by John S. Fine.
http://bos.asmhackers.net/downloads/pcopy02.zip

After that all you have to worry about is putting the right values in the registers, and call BIOS.
An example of this can be found in the xosdev tutorial, on http://www.osdever.net/

Re:Boot Loader sans FAT?

Posted: Tue Apr 12, 2005 8:28 am
by DruG5t0r3
I suggest using grub. It supports tons of filesystems and will load your kernel image where you want. + the multiboot headers provide you with some usefull information such as available memory and some mmapings (not always usefull though)

Re:Boot Loader sans FAT?

Posted: Tue Apr 12, 2005 8:34 am
by Jubbens
Thanks all.

Especially Bubach.

Re:Boot Loader sans FAT?

Posted: Fri Apr 15, 2005 9:01 am
by Jubbens
One final question on the kernel loading crap....I'm new to this.

I want to load my kernel right after low memory, at 65kb. So is this right?

65KB = 66560 bytes = 0x10400 = 0x0020:0x0000

Segment:offset memory addressing has me confused.

Re:Boot Loader sans FAT?

Posted: Fri Apr 15, 2005 9:11 am
by Brendan
Hi,
Jubbens wrote:I want to load my kernel right after low memory, at 65kb. So is this right?

65KB = 66560 bytes = 0x10400 = 0x0020:0x0000

Segment:offset memory addressing has me confused.
It's almost correct (except for the segment:offset part :) ).

0x10400 = 0x1040:0x0000 and/or 0x1000:0x0400

0x0020:0x0000 = 0x200 = 512 bytes


Cheers,

Brendan

Re:Boot Loader sans FAT?

Posted: Fri Apr 15, 2005 10:50 am
by bubach
Might I suggest that you load it at 0x1000:0x0000 (64kb) instead?
0x1040:0x0000 is just wierd... :P