Page 1 of 2

Custom File System BIOS Parameter Block

Posted: Sat Oct 22, 2011 1:14 pm
by Mikemk
When creating a custom file system, do I need to put in the BPB?
If so, what information would it need?

Re: Custom File System BIOS Parameter Block

Posted: Sat Oct 22, 2011 4:22 pm
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.

Re: Custom File System BIOS Parameter Block

Posted: Sat Oct 22, 2011 9:58 pm
by Mikemk
Thank You

Re: Custom File System BIOS Parameter Block

Posted: Sun Oct 23, 2011 1:10 am
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.

Re: Custom File System BIOS Parameter Block

Posted: Sun Oct 23, 2011 2:53 am
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.

Re: Custom File System BIOS Parameter Block

Posted: Sun Oct 23, 2011 5:55 am
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:

Re: Custom File System BIOS Parameter Block

Posted: Sun Oct 23, 2011 6:01 am
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'.

Re: Custom File System BIOS Parameter Block

Posted: Sun Oct 23, 2011 6:34 am
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.

Re: Custom File System BIOS Parameter Block

Posted: Sun Oct 23, 2011 6:58 am
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.

Re: Custom File System BIOS Parameter Block

Posted: Sun Oct 23, 2011 7:36 am
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).

Re: Custom File System BIOS Parameter Block

Posted: Sun Oct 23, 2011 9:03 am
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.

Re: Custom File System BIOS Parameter Block

Posted: Sun Oct 23, 2011 9:39 am
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.

Re: Custom File System BIOS Parameter Block

Posted: Sun Oct 23, 2011 10:04 am
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.

Re: Custom File System BIOS Parameter Block

Posted: Sun Oct 23, 2011 10:54 pm
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.

Re: Custom File System BIOS Parameter Block

Posted: Mon Oct 24, 2011 2:44 am
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).