MBR

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: MBR

Post by bewing »

> For very old hard drives, and for "USB emulating hard disk" (with some new USB flash devices); you can't assume that there's 63 sectors per track.

You don't have to. The BIOS Int can load up to (SPT * Heads) sectors or 127, whichever is less. I was just picking a low number. 36 is the limiting number.

> That technique may have been Microsoft's technique before it became a "de facto" standard for PCs.

Yes, but just because everybody before you was stupid is not a good excuse to be stupid too.

> You also can't assume that the MBR is your MBR.

Maybe yes, maybe no. You can make it a prerequisite if you want. But if it saves 2 loading steps, it may be a good idea to test, to see if the previous boot stage was smart enough to load your entire program.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: MBR

Post by Love4Boobies »

bewing wrote:> (It) should load the VBR which would then load the boot loader that (would then load the kernel)

I do not like Love4Boobies' technique, because it takes 3 steps to do what you should be able to do in one, theoretically. So it is unnecessarily complex.
While I agree it is the most complex, I forgot to add the reason behind this extra complexity: modularity. In other words, stages of the boot loader should be independent. The MBR should not care what it loads and the VBR should not care what it is loaded by. The same applies for the VBR vs. boot loader. The advantage is that I can selectively choose what I want to keep when installing my boot mechanism (e.g., I might have a special MBR that does something funky and not wish to override it with the boot loader's MBR).
Brendan wrote:
Love4Boobies wrote:When using the MBR partitioning scheme, there should only be a maximum of one active (primary) partitions. The should load the VBR which would then load the boot loader that enables booting from any partition. Zero active partitions in a MBR indicates that the hard disk is not bootable.
Don't forget the "extended partition" scheme, where there's "primary partitions" (listed in the partition table on the first sector of the disk) and "secondary partitions" (listed in a partition table in the first sector/VBR of a primary partition). Also, in theory an OS could support booting from secondary partitions...
I didn't forget - this is covered by my scheme. While the active partition may only be a primary one, the boot loader should be able to interpret different file systems and load the kernel and its modules from any of the existing partitions (primary or extended).
bewing wrote:> That technique may have been Microsoft's technique before it became a "de facto" standard for PCs.

Yes, but just because everybody before you was stupid is not a good excuse to be stupid too.
Compatibility is always a good excuse to being stupid.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
Post Reply