Custom File System BIOS Parameter Block

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.
Mikemk
Member
Member
Posts: 409
Joined: Sat Oct 22, 2011 12:27 pm

Custom File System BIOS Parameter Block

Post by Mikemk »

When creating a custom file system, do I need to put in the BPB?
If so, what information would it need?
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
Casm
Member
Member
Posts: 221
Joined: Sun Oct 17, 2010 2:21 pm
Location: United Kingdom

Re: Custom File System BIOS Parameter Block

Post by Casm »

m12 wrote:When creating a custom file system, do I need to put in the BPB?
If so, what information would it need?
If you are creating your own file system you can put what you like in the bios paramether block, or leave it out completely. The bpb is part of the FAT and NTFS file systems; it is not compulsory for other file systems.
Mikemk
Member
Member
Posts: 409
Joined: Sat Oct 22, 2011 12:27 pm

Re: Custom File System BIOS Parameter Block

Post by Mikemk »

Thank You
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
rdos
Member
Member
Posts: 3308
Joined: Wed Oct 01, 2008 1:55 pm

Re: Custom File System BIOS Parameter Block

Post by rdos »

Casm wrote:
m12 wrote:When creating a custom file system, do I need to put in the BPB?
If so, what information would it need?
If you are creating your own file system you can put what you like in the bios paramether block, or leave it out completely. The bpb is part of the FAT and NTFS file systems; it is not compulsory for other file systems.
I'm not so sure about that. The BPB is part of the boot sector, and BIOS / other boot-loaders expect the boot-sector to have a certain layout. If not, it would not attempt to boot from them.
Casm
Member
Member
Posts: 221
Joined: Sun Oct 17, 2010 2:21 pm
Location: United Kingdom

Re: Custom File System BIOS Parameter Block

Post by Casm »

rdos wrote:
Casm wrote:
m12 wrote:When creating a custom file system, do I need to put in the BPB?
If so, what information would it need?
If you are creating your own file system you can put what you like in the bios paramether block, or leave it out completely. The bpb is part of the FAT and NTFS file systems; it is not compulsory for other file systems.
I'm not so sure about that. The BPB is part of the boot sector, and BIOS / other boot-loaders expect the boot-sector to have a certain layout. If not, it would not attempt to boot from them.
The BIOS might notice the AA55 signature, but I am not sure even about that. In any case, it isn't part of the BIOS parameter block.
rdos
Member
Member
Posts: 3308
Joined: Wed Oct 01, 2008 1:55 pm

Re: Custom File System BIOS Parameter Block

Post by rdos »

Casm wrote:The BIOS might notice the AA55 signature, but I am not sure even about that. In any case, it isn't part of the BIOS parameter block.
I'm pretty sure that it notices much more than the AA55 signature. Just remember what I what I wrote in the Bochs thread: Bochs didn't like my floppy image, that works on real hardware, and it does contain an AA55 signature, and a BPB. I'm pretty sure that boot-sectors for PCs cannot look anyway they want to look like themselves, because then some BIOSes and / or chain-loaders will refuse to boot.

If you want to ensure loaders would load your boot-loader, you make sure that you follow the standards. Regardless of your FS. Period. :wink:
User avatar
Chandra
Member
Member
Posts: 487
Joined: Sat Jul 17, 2010 12:45 am

Re: Custom File System BIOS Parameter Block

Post by Chandra »

rdos wrote:I'm pretty sure that it notices much more than the AA55 signature. Just remember what I what I wrote in the Bochs thread: Bochs didn't like my floppy image, that works on real hardware, and it does contain an AA55 signature, and a BPB. I'm pretty sure that boot-sectors for PCs cannot look anyway they want to look like themselves, because then some BIOSes and / or chain-loaders will refuse to boot.
I'm tempted to disagree. Why would BIOS scan the boot-sector to see if there is any BPB present? Even 0xAA55 signature check has been dropped from newer BIOSes. Besides, Bios Parameter Block is the courtesy of the Filesystem.

And of course, Bochs can boot any sorts of image, be it with the BPB or without the BPB (inclusive of the fact that it will triple fault for invalid instructions). You can even disable the 'Boot Signature Check'.
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
rdos
Member
Member
Posts: 3308
Joined: Wed Oct 01, 2008 1:55 pm

Re: Custom File System BIOS Parameter Block

Post by rdos »

Chandra wrote:I'm tempted to disagree. Why would BIOS scan the boot-sector to see if there is any BPB present? Even 0xAA55 signature check has been dropped from newer BIOSes. Besides, Bios Parameter Block is the courtesy of the Filesystem.
You mean you have never seen: "No devices to boot from" when you have inserted a bootable floppy? I have, and I know that BIOS requires certain things to be present in the boot-sector before it will attempt to boot. But different BIOSes will have different opinions about what should be present, which means the best is to provide everything that BIOS might check for!

And a custom filesystem does not start in the boot-sector, so there is no reason to invent a new boot-sector layout just because you use a new filesystem.
User avatar
Chandra
Member
Member
Posts: 487
Joined: Sat Jul 17, 2010 12:45 am

Re: Custom File System BIOS Parameter Block

Post by Chandra »

rdos wrote:You mean you have never seen: "No devices to boot from" when you have inserted a bootable floppy?
No, not at least under BOCHS. While I won't further argue on this issue since I don't have too many BIOSes to test on, I'd assume those are the faulty BIOSes.
rdos wrote:Just remember what I what I wrote in the Bochs thread: Bochs didn't like my floppy image, that works on real hardware, and it does contain an AA55 signature, and a BPB.
That's the most likely result of incorrect configuration. Instead of blaming Bochs, you may want to post your Bochsrc file to let us find the problem.
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
rdos
Member
Member
Posts: 3308
Joined: Wed Oct 01, 2008 1:55 pm

Re: Custom File System BIOS Parameter Block

Post by rdos »

Chandra wrote:That's the most likely result of incorrect configuration. Instead of blaming Bochs, you may want to post your Bochsrc file to let us find the problem.
Rather of an non-intuitive dialog for selecting floppy images. First, it is required a select a format (3.5'' 1.44MB), then an image file, type of image (1.44 again), and lastly one must check "inserted". If any of these are not made, it won't work. As soon as a floppy image is selected, format settings and "inserted" should be turned on automatically!

Still, with those done, Bochs cannot handle RDOS, and panics on a LLDT instruction (and gives the exception to RDOS so it writes the panic screen).
User avatar
Combuster
Member
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: Custom File System BIOS Parameter Block

Post by Combuster »

When creating a custom file system, do I need to put in the BPB?
That technically depends on what you expect of the medium. If you want to boot from it, chances are the BPB is read by the BIOS and interpreted accordingly. This reportedly applies to USB sticks in particular which lack a CHS geometry of their own.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Casm
Member
Member
Posts: 221
Joined: Sun Oct 17, 2010 2:21 pm
Location: United Kingdom

Re: Custom File System BIOS Parameter Block

Post by Casm »

rdos wrote:
Casm wrote:The BIOS might notice the AA55 signature, but I am not sure even about that. In any case, it isn't part of the BIOS parameter block.
I'm pretty sure that it notices much more than the AA55 signature. Just remember what I what I wrote in the Bochs thread: Bochs didn't like my floppy image, that works on real hardware, and it does contain an AA55 signature, and a BPB. I'm pretty sure that boot-sectors for PCs cannot look anyway they want to look like themselves, because then some BIOSes and / or chain-loaders will refuse to boot.

If you want to ensure loaders would load your boot-loader, you make sure that you follow the standards. Regardless of your FS. Period. :wink:
The Bios Parameter block contains stuff which is specific to the file system, such as the number of FATs, sectors per FAT, number of entries in the root directory, number of reserved sectors, and so on. IBM had written the BIOS before MS-DOS, or the FAT file system, was even a gleam in Bill Gate's eye.

The BIOS reads the first sector and jumps to it. After that it is up to the loader and the operating system.
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: Custom File System BIOS Parameter Block

Post by neon »

Hello,

Considering the BPB is not at all mentioned in the BIOS boot specification it can be assumed that the BPB is not mandatory for boot. However, I have noticed that some emulators may fail to boot an image that lacks a BPB. This is an error in the emulator: on real hardware it should work fine.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
User avatar
Combuster
Member
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: Custom File System BIOS Parameter Block

Post by Combuster »

I just cleared out my recollections and I located the original reference for the problem: BPBs on USB do matter, real hardware included.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
rdos
Member
Member
Posts: 3308
Joined: Wed Oct 01, 2008 1:55 pm

Re: Custom File System BIOS Parameter Block

Post by rdos »

Combuster wrote:I just cleared out my recollections and I located the original reference for the problem: BPBs on USB do matter, real hardware included.
Basically, if it is a floppy, the BPB will be required, but not if it is a hard-drive. That makes sense, because I think BIOS will get fundamental floppy-parameters from the BPB (like type of floppy).
Post Reply