Hi,
I've been working on the theory and code found here and I've set everything up, but I'm confused on one point. How do I get the data that makes up fat_BS_t and either fat_extBS_16_t or fat_extBS_32_t? Do I need to read it from the BIOS during boot, or read it from the floppy I'm using somehow, or provide it myself?
Thanks!
FAT Filesystem Implementation
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: FAT Filesystem Implementation
fat_BS_t can be found at the first byte of the medium or partition. The bootloader also starts at the first byte of the medium or partition. The bootloader doesn't need any additional steps to read that structure because it's an integral part of itself.
If you need to read a filesystem at a later point, just read the first sector.
If you need to read a filesystem at a later point, just read the first sector.
Re: FAT Filesystem Implementation
So all the information's located in the BPB, I assume. Assuming the first sector of the disk is loaded into ram at the position 0x0000:0x7c00, as the wiki page tells me, where would I read to find what I need? For example, the bytes per sector value is, according to the wiki, at an offset of 11 bytes. Is that relevant to where in memory the value is?Combuster wrote:fat_BS_t can be found at the first byte of the medium or partition. The bootloader also starts at the first byte of the medium or partition. The bootloader doesn't need any additional steps to read that structure because it's an integral part of itself.
If you need to read a filesystem at a later point, just read the first sector.
Questions are kind of silly and probably obvious, but I'm just kind of muddling through this at the moment.
Re: FAT Filesystem Implementation
Well eh, yeah.
It will be located at (Where you loaded the first sector)+11
In this case 0x7C00+11
It will be located at (Where you loaded the first sector)+11
In this case 0x7C00+11
Re: FAT Filesystem Implementation
Alright, seems simple enough. Thanks. I'll check back once I'm done with it.Nessphoro wrote:Well eh, yeah.
It will be located at (Where you loaded the first sector)+11
In this case 0x7C00+11