Score:1

Is there any kind of complete RFC document for MBR (master boot record) format - better with explanations?

gd flag

I am designing the code enumerating the partitions in the system. Reading numerous documents I can not devise complete and definite list of constraints for the algorithm, and find out why constraints exist.

  • Root MBR is having 4 entries, and thus MBR may contain 4 primary partitions;
  • In this list of root MBR, there may be only one expanded partition, which then chains down to secondary MBRs with logical volumes.

Questions:

  1. Why DOS 6.22 FDISK does not allow creating 3 primary partitions, but only one?
  2. Why secondary MBR in extended partition chain must only have one logical volume, while it may have 3 (saving 2 additional links for expanded partition list)?
  3. When extended partition was checked for logical drives till its end of chain, does the enumeration return back to root MBR and continue from the next entry after extended partition entry? Why not?
  4. What happens to the DOS or Windows OS if they find MBR entries not following the constraints (see questions 1 to 3 above)? In other words is there any description of the process of operating system enumerating their partitions / logical drives?
Score:1
in flag

A master boot record is a type of boot sector for use with IBM PC-compatible systems. The original version of the MBR was written by David Litton of IBM in June 1982 and publicly introduced in 1983 with PC-DOS 2.0. However, PC-DOS implemented only the most important functions, not everything.

The closest to a "spec" (I am aware of) is https://thestarman.pcministry.com/asm/mbr/STDMBR.htm

The MBR structure is as follows:

address hex (dec) size function
0x0000 (0) 440 boot loader
0x01B8 (440) 4 disk signature (since Windows NT family)
0x01BC and 0x01BC (444 and 445) 2 zero (0x0000)
0x01BE (446) 64 partition table
0x01FE and 0x01FF (510 and 511) 2 signature
total 512

Answers:

  1. Why DOS 6.22 FDISK does not allow creating 3 primary partitions, but only one?

Support for partitioned media was introduced with IBM PC DOS 2.0 in March 1983, but supporting only one primary partition at that time. This never changed. DOS itself never used more than one primary partition. As a consequence, FDISK can not create more than one primary partition.

  1. Why secondary MBR in extended partition chain must only have one logical volume, while it may have 3 (saving 2 additional links for expanded partition list)?

Not entirely sure what you mean exactly with "secondary MBR" so eventually the following is not answering your question. (please handle with care!)

Support for an extended partition was added with DOS 3.2. Nested logical drives inside an extended partition came with DOS 3.30.

Each extended partition table defines exactly one logical partition and points to the next extended partition table, if required. In other words - the extended partition tables work according to the chained list principle. Its start sector is specified relative to the position of the current partition table. The second entry can contain a concatenation to another extended partition table and always has the type 5. In the start sector of this entry is always referenced relative to the sector of the first extended partition. As it is chained by definition, you can not refer to all extended partitions, hence you can not save 2 additional links.

  1. When extended partition was checked for logical drives till its end of chain, does the enumeration return back to root MBR and continue from the next entry after extended partition entry? Why not?

No. As there is no such a thing as a "next entry".

  1. What happens to the DOS or Windows OS if they find MBR entries not following the constraints (see questions 1 to 3 above)? In other words is there any description of the process of operating system enumerating their partitions / logical drives?

If partitions are not recognizable then they are not used. If the first primary partition cannot be found, then DOS/Windows is not able to boot.

note: Previous versions of Windows relied on the drive letters determined by MS-DOS, but as of Windows 2000, these mappings are stored in registry keys, such as HKLM\SYSTEM\MountedDevices. For certain system constellations, the disk signature is also used in the boot.ini file, which is part of the Windows NT boot loader (NTLDR). Windows assigns the disk signature when a new disk is initialized.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.