Reading FAT bs from RAM
Posted: Wed May 07, 2014 4:43 am
first of all I am new to OSDev started a few weeks ago just for fun and because I think it is a very interesting subject. the things I tried so far worked.
I did build a very simple kernel that printed some information on the screen. then I looked up on how to read a FAT table and that is where it did go wrong.
From what I understand is that the first 512bytes form a floppy get loaded to RAM 0x0000:7C00.
But when I read that part some bytes are not as expected.
To read the first FAT I should read 36 bytes form the 4 byte. (0x0000:7C03 - 0x0000:7C27).
This is what i would expect (hex editor on floppy image):
6D 6B 66 73 2E 66 61 74 00 02 01 01 00 02 E0 00 40 0B F0 09 00 12 00 02
This is what i got form RAM:
6D 00 12 00 00 00 02 00 00 00 50 00 00 00 06 00 40 0B F0 09 00 12 00 02
Something definitely messes them um but I can't why (Am guess I missing something ).
My floppy image contains GRUB 0.97 without my kernel, so I don't boot any code I have written.
I tried to boot it in Virtualbox and Bochs both the same outcome.
I did build a very simple kernel that printed some information on the screen. then I looked up on how to read a FAT table and that is where it did go wrong.
From what I understand is that the first 512bytes form a floppy get loaded to RAM 0x0000:7C00.
But when I read that part some bytes are not as expected.
To read the first FAT I should read 36 bytes form the 4 byte. (0x0000:7C03 - 0x0000:7C27).
This is what i would expect (hex editor on floppy image):
6D 6B 66 73 2E 66 61 74 00 02 01 01 00 02 E0 00 40 0B F0 09 00 12 00 02
This is what i got form RAM:
6D 00 12 00 00 00 02 00 00 00 50 00 00 00 06 00 40 0B F0 09 00 12 00 02
Something definitely messes them um but I can't why (Am guess I missing something ).
My floppy image contains GRUB 0.97 without my kernel, so I don't boot any code I have written.
I tried to boot it in Virtualbox and Bochs both the same outcome.