Page 1 of 1
Another Floppy disk problem
Posted: Thu Jun 25, 2009 9:23 am
by quanganht
So, for the exo-kernel, there will be absolutely no FS ( at kernel level). So how can I read data on disk? I need to read sector 2 to parse data, then load next n sectors. Assume that we are working on a floppy disk, all of the data are written continuously at disk create/format time and apps don't have access rights to overwrite it.
EDIT: Oh, I forgot that we also assume that we're working in Realmode.
Re: Another Floppy disk problem
Posted: Thu Jun 25, 2009 11:42 am
by mathematician
Where's the problem? In real mode the BIOS can read absolute disk sectors. (int 13h, ah=2)
Re: Another Floppy disk problem
Posted: Thu Jun 25, 2009 11:52 am
by frank
Make the bootloader load the data by using the BIOS.
Re: Another Floppy disk problem
Posted: Thu Jun 25, 2009 6:27 pm
by quanganht
Yeah I know. But do I need BPB?
Re: Another Floppy disk problem
Posted: Thu Jun 25, 2009 6:47 pm
by kop99
So, for the exo-kernel, there will be absolutely no FS ( at kernel level).
If there is no FS, then why do you need bpb?
Re: Another Floppy disk problem
Posted: Thu Jun 25, 2009 9:17 pm
by quanganht
Ok. Thank you. Mod, lock this please.
Re: Another Floppy disk problem
Posted: Thu Jun 25, 2009 10:44 pm
by Troy Martin
I don't think you entirely understand what a BPB is. It's part of the floppy's first sector and exclusive to FAT volumes. It's not something you drop into a kernel or its drivers. Sure, you can write a struct that lets you access the BPB's values, but you don't hardcode the BPB's values into the kernel.
Re: Another Floppy disk problem
Posted: Fri Jun 26, 2009 1:21 am
by quanganht
I know. But BPB is not just exclusive to FAT volumes, but also FAT32, NTFS and maybe others. Anyway, I don't need it.
Re: Another Floppy disk problem
Posted: Fri Jun 26, 2009 10:08 am
by Troy Martin
FAT32
is FAT....
NTFS uses a way different BPB than FAT does, take a peek here:
http://www.geocities.com/thestarman3/asm/mbr/NTFSBR.htm. It's also based on the FAT BPB but it adds more and fills up a bunch of bytes with nulls or seemingly random numbers.
Apparently HPFS also uses the BPB (probably in a similar manner as NTFS does), but I'll have to research it.
Re: Another Floppy disk problem
Posted: Fri Jun 26, 2009 5:37 pm
by pcmattman
Troy Martin wrote:FAT32 is FAT....
No, FAT is often used to refer to FAT16/FAT12 (depending on the medium), while FAT32 is used to refer to... FAT32.
I imagine that this concept is what quanganht was using in his post.
Re: Another Floppy disk problem
Posted: Fri Jun 26, 2009 9:28 pm
by neon
pcmattman wrote:Troy Martin wrote:FAT32 is FAT....
No, FAT is often used to refer to FAT16/FAT12 (depending on the medium), while FAT32 is used to refer to... FAT32.
Troy is still technically correct... I personally refer to FAT as a generalization for all FAT filesystems, which technically includes FAT32.
Re: Another Floppy disk problem
Posted: Fri Jun 26, 2009 9:29 pm
by pcmattman
Sorry, I meant that they're still FAT, but FAT without the numerics is often used when talking about FAT12/FAT16, while FAT32 is always used for FAT32 volumes. The easiest way to see this different naming is when formatting disks in Windows
EDIT: The only reason I brought this up was because of the ambiguity in "FAT and FAT32" in the post in question.
Re: Another Floppy disk problem
Posted: Fri Jun 26, 2009 9:36 pm
by neon
pcmattman wrote:The easiest way to see this different naming is when formatting disks in Windows
Right, good point there.
Troy is still technically correct but I cannot answer why they do that in Windows (and alot of other sources.)
Re: Another Floppy disk problem
Posted: Fri Jun 26, 2009 9:38 pm
by Troy Martin
The last time I used FAT16 was when I had a copy of Windows 95 OEM. No OSRs.