Page 1 of 1
Your opinion regarding the MBR for my File System
Posted: Sun Jul 01, 2007 5:24 am
by XCHG
I decided to call my File System SSFS which is the abbreviation for Schematically Structured File System. Today I layed out the format for its MBR and I have attached it to this post. I'd really appreciate it if some of you could give me your opinions about this design. Thanks in advance.
Posted: Sun Jul 01, 2007 1:49 pm
by frank
Not bad at all. Covers a lot of important things such as having multiple sectors allocated to the MBR. The only thing that is wrong with it IMO is that it looks more like a boot sector than a MBR. Most MBRs only do one thing load the boot sector of the active partition into memory and start executing them. Also if you were to use that MBR on a disk then the only operating system that will be able to read it would be yours.
Posted: Mon Jul 02, 2007 7:16 am
by XCHG
Thank you frank for the review. Well I guess you are right. I was just too worried about the size of the assembled code at the beginning of the MBR that the first thing I thought of was a way to extend this space. I think you are also right about compatibility issues. Maybe I should try a more general scheme such as IBM's MBR scheme. I will give that a try and see how things will turn out.
By the way, do you know of a utility that can format an HDD image instead of a real HDD?
Posted: Mon Jul 02, 2007 7:27 am
by AJ
Hi,
There are a few tools that let you mount an image as if a real disk - I would suggest that is the easiest way. Alternatively
- here - are the suggestions from the Bochs pages.
Cheers,
Adam
Posted: Thu Jul 05, 2007 1:51 am
by XCHG
AJ,
Thank you for your help. I decided to format the MBR using a program that I coded in Delphi!.
Posted: Fri Jul 06, 2007 2:46 am
by XCHG
I coded a bootstrap for the MBR and I want to know if you guys thing what this code does is what it is expected from an actual MBR:
There are the tasks that my MBR bootstrap code carries out:
1) It of course first sets all the segment registers and etc to valid values.
2) It then searches in the Partition Table at offset 0x01BE (446) to find a partition that is active.
3) If it doesn't find an active partition, it will display a message and halt.
4) If it finds an active partition, it will check its Starting C/H/S values and see if that is valid.
5) If the Starting C/H/S value is valid, it will load that sector into the memory at 0x0000:0x0600 and it will jump to it. (Using INT 0x13)
6) If the C/H/S bits are not valid, it will directly access the HDD and use LBA28 and the Starting LBA address of that partition to load the boot sector for that partition. The boot sector will be loaded at 0x0000:0x0600. (Using IDE Ports)
I thought of also checking for the boot signature 0xAA55 but thought that could be of no use because the BIOS already does that when transferring control to the HDD. Do you guys have any opinions or suggestions to make this a better MBR? I'd appreciate it.
Posted: Fri Jul 06, 2007 8:25 am
by frank
Everything looks good except the where you plan on loading the boot sector. The boot sector expects to be loaded at 0x0000:0x7C00. Most MBRs relocate themselves to 0x0000:0x0600 and then load the boot sector to 0x0000:0x7C00. If you have room left over it could be a good idea to check for the 0xAA55 signature at the end of the boot sector you just loaded before jumping to it.
Other than that looks good to me.
Posted: Sat Jul 07, 2007 3:08 am
by XCHG
Thank you frank. I did the relocation (which was tough in NASM) and
posted the code here