Another Floppy disk problem

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
quanganht
Member
Member
Posts: 301
Joined: Fri May 16, 2008 7:13 pm
Location: Hanoi, Vietnam

Another Floppy disk problem

Post 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.
"Programmers are tools for converting caffeine into code."
User avatar
mathematician
Member
Member
Posts: 437
Joined: Fri Dec 15, 2006 5:26 pm
Location: Church Stretton Uk

Re: Another Floppy disk problem

Post by mathematician »

Where's the problem? In real mode the BIOS can read absolute disk sectors. (int 13h, ah=2)
The continuous image of a connected set is connected.
frank
Member
Member
Posts: 729
Joined: Sat Dec 30, 2006 2:31 pm
Location: East Coast, USA

Re: Another Floppy disk problem

Post by frank »

Make the bootloader load the data by using the BIOS.
User avatar
quanganht
Member
Member
Posts: 301
Joined: Fri May 16, 2008 7:13 pm
Location: Hanoi, Vietnam

Re: Another Floppy disk problem

Post by quanganht »

Yeah I know. But do I need BPB?
"Programmers are tools for converting caffeine into code."
User avatar
kop99
Member
Member
Posts: 120
Joined: Fri May 15, 2009 2:58 am

Re: Another Floppy disk problem

Post 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?
User avatar
quanganht
Member
Member
Posts: 301
Joined: Fri May 16, 2008 7:13 pm
Location: Hanoi, Vietnam

Re: Another Floppy disk problem

Post by quanganht »

Ok. Thank you. Mod, lock this please.
"Programmers are tools for converting caffeine into code."
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: Another Floppy disk problem

Post 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.
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
User avatar
quanganht
Member
Member
Posts: 301
Joined: Fri May 16, 2008 7:13 pm
Location: Hanoi, Vietnam

Re: Another Floppy disk problem

Post 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.
"Programmers are tools for converting caffeine into code."
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: Another Floppy disk problem

Post 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.
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Re: Another Floppy disk problem

Post 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.
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: Another Floppy disk problem

Post 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.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Re: Another Floppy disk problem

Post 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.
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: Another Floppy disk problem

Post 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.)
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: Another Floppy disk problem

Post by Troy Martin »

The last time I used FAT16 was when I had a copy of Windows 95 OEM. No OSRs. :shock:
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
Post Reply