Page 1 of 1

16Bit FAT12

Posted: Mon Oct 17, 2005 12:54 pm
by Vladaz
Hello,
I'm making my bootloader and I want to use some filesystem to load my kernel. I chosen FAT12(because I think that's one of the best ways, if I'm wrong, correct me:)). What ways and what things do I have to do, to load a file from Real Mode?

Re:16Bit FAT12

Posted: Mon Oct 17, 2005 1:35 pm
by bluecode
hi,

I would consider writing your own bootloader a bad choice, because there are just thousands of them on the net and imho it doesn't help you learning assembler. It's just plain&simple frustrating.
But back to your question ;)
Quoting from here:
1. The DOS Boot Record (DBR) is read to determine the size of the DBR, FAT, and Root Directory. The location of each on the disk is then determined.
2. The Root Directory is read in to memory.
3. The Root Directory is searched for the file name LOADER.BIN. If found, we can look in the directory entry to find out which is the file?s first cluster (file allocation unit). If not found, we give an error message.
4. The File Allocation Table is read off the disk in to memory.
5. Starting with the file?s first cluster, we use the FAT to locate all the clusters belonging to the file. We read them all off the disk into memory at a specific location.
6. We jump to that location to begin execution of the operating system.

I also think that fat is a bad choice, because it's limitations (8 letter names + 3 extension, only capital letters, ...). On the other hand it's one of the simplest filesystems on earth and it's supported by microsoft and it's specification is freely available. I plan to use ext2/3 or reiserfs as root filesystem.

Re:16Bit FAT12

Posted: Mon Oct 17, 2005 2:49 pm
by Cjmovie
Two things:

First, I agree with bluecode. Although I'd like to add the best of the avaliable ones that could do your job would have to be GRUB:
http://www.osdev.org/osfaq2/index.php/GRUB

Second, Fat12 is not 16bits, it's 12 bits :). 16 bit FAT, however, would be FAT16.

Oh, one other thing. You aren't restrained to capitals or 8.3 filenames, IF you wish to support the LFN extension to FAT.

However, for me, I made a very simple 'root/boot' filesys. If you'd like, I could also provide it, but I would't recommend it....

Re:16Bit FAT12

Posted: Mon Oct 17, 2005 2:50 pm
by Candy
Cjmovie wrote: Second, Fat12 is not 16bits, it's 12 bits :). 16 bit FAT, however, would be FAT16.
Before you start to sense a pattern, FAT32 is 28 bits.

Re:16Bit FAT12

Posted: Mon Oct 17, 2005 3:02 pm
by Cjmovie
Candy wrote:
Cjmovie wrote: Second, Fat12 is not 16bits, it's 12 bits :). 16 bit FAT, however, would be FAT16.
Before you start to sense a pattern, FAT32 is 28 bits.
Yeah, thought It would be a bad idea to include that in my list though, because of that :).

Re:16Bit FAT12

Posted: Mon Oct 17, 2005 3:33 pm
by bluecode
who said that FAT12 is 16 bit?

[edit: lol. I'm blind ;D the topic...]

btw. 2 + 2 doesn't equal 5, I think :P

Re:16Bit FAT12

Posted: Mon Oct 17, 2005 4:51 pm
by Cjmovie

Re:16Bit FAT12

Posted: Tue Oct 18, 2005 8:40 am
by Vladaz
By saying 16bit i meant Real mode, not the Fat16:) sorry for that:)
Thanks for help, i will try to use maybe GRUB, or I will continue with my own. But if I will want tu use VESA, does the GRUB has the support of it?

Re:16Bit FAT12

Posted: Tue Oct 18, 2005 9:42 am
by bluecode
hi

yes, the multiboot specification should support switching the video resolution, but personally I never got it working. I don't know why, perhaps someone can explain how to do it.
But if your in real-mode, than you can use BIOS Interrupt 0x10. If you're in protected-mode you could use interrupt 0x10 in virtual-8086-mode or you can use the protected-mode interface of the VBE (=Video BIOS Extension). You should look into the VBE Specification 2.0/3.0 for more information.

perhaps lim(2+2) = 5 for 2 -) 2.5 ;)