Boot Loader sans FAT?
Boot Loader sans FAT?
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.
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?
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
Note: It loads a file called a certan name.
you can down load it here: http://alexfru.chat.ru/epm.html#bootprog
- Colonel Kernel
- Member
- Posts: 1437
- Joined: Tue Oct 17, 2006 6:06 pm
- Location: Vancouver, BC, Canada
- Contact:
Re:Boot Loader sans FAT?
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
http://www.osdev.org/osfaq2/index.php/W ... k%20Images
Top three reasons why my OS project died:
- Too much overtime at work
- Got married
- My brain got stuck in an infinite loop while trying to design the memory manager
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Boot Loader sans FAT?
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" ...
You can even keep the floppy FAT-compatible by placing your kernel in the "reserved sectors" ...
Re:Boot Loader sans FAT?
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/
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?
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?
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.
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?
Hi,
0x10400 = 0x1040:0x0000 and/or 0x1000:0x0400
0x0020:0x0000 = 0x200 = 512 bytes
Cheers,
Brendan
It's almost correct (except for the segment:offset part ).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.
0x10400 = 0x1040:0x0000 and/or 0x1000:0x0400
0x0020:0x0000 = 0x200 = 512 bytes
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re:Boot Loader sans FAT?
Might I suggest that you load it at 0x1000:0x0000 (64kb) instead?
0x1040:0x0000 is just wierd...
0x1040:0x0000 is just wierd...