Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/22/02 04:10
Read: times


 
#34840 - RE: ide hard disk / Contents of MBR
The master boot record on a disk volume contains a number of things which happen to fit nicely within 512 bytes. These items include:

1) The code to load and give control to the partition boot record for one of the up to four partitions that may be defined for the disk. This will normally be executable code that is loaded by the BIOS into real mode RAM at address of 0x0000:0x7C00. The code here is typically written in 8088 opcodes.

2) A partition table at the end of the master boot record.

3) A MBR signature in the last two bytes of the sector which would be 0x55 and 0xAA for a real valid MBR.

The partition table DOES NOT specifically tell how many sectors are on the whole disk. It contains four records at offsets 0x1BE, 0x1CE, 0x1DE, and 0x1EE - each of which is 16 bytes long. The content of each partition record is:

BYTE - Boot Indicator for "Active Partition" with 0x80 value if active.

BYTE - Head location for start of partition.

BYTE - Sector location for start of partition. This byte low six bits are sector with the upper two bits being the high two bits of the cylinder number.

BYTE - Cylinder location of start of partition. This is the just the low 8 bits of the cylinder. (See Sector for upper cyl bits above).

BYTE - System Indicator. ID of the owner operating system. Some IDs are 0x00=unknown, 0x01=DOS 12 bit FAT, 0x02=DOS 16 bit FAT. There are other newer types that are for other OS's and file system types.

BYTE - Head location for end of partition.

BYTE - Sector location for end of partition. This byte low six bits are sector with the upper two bits being the high two bits of the cylinder number.

BYTE - Cylinder location of end of partition. This is the just the low 8 bits of the cylinder. (See Sector for upper cyl bits above).

WORD - Low word of the relative sector number to the start of the partition.

WORD - High word of the relative sector number to the start of the partition.

WORD - Low word of the number of sectors in the partition.

WORD - High word of the number of sectors in the partition.

Note that in these tables the Cylinder and Head numbers start at zero and increase. Sector numbers on the other hand start at one. Most drives these days do not use the actual physical cylinders, heads, and sectors numbers that relate to the physical characteristics of the drive. Instead a set of counts of these is a logical system that is translated to/from a logical sector number that is then mapped on board the drive in the electronics behind the IDE connector to the physical characteristics of the drive. (There is a long technical history behind this subject but it is way too much to go into here).

To get the actual characteristics of the drive, i.e. total number of logical sectors, you need to access the IDE / ATA command that I mentioned before. (Or you can read the label on the drive, remember the olden days when an MFM drive had a TYPE number that you put into the BIOS setup screen. The BIOS then used this to look up the drive capacity (#Cyl, #Head, and #Sect) from a table in the BIOS ROM).

Michael Karas





List of 17 messages in thread
TopicAuthorDate
ide hard disk            01/01/70 00:00      
RE: ide hard disk            01/01/70 00:00      
RE: ide hard disk            01/01/70 00:00      
RE: ide hard disk            01/01/70 00:00      
RE: ide hard disk            01/01/70 00:00      
RE: ide hard disk            01/01/70 00:00      
RE: ide hard disk            01/01/70 00:00      
RE: ide hard disk            01/01/70 00:00      
RE: ide hard disk            01/01/70 00:00      
RE: ide hard disk            01/01/70 00:00      
RE: ide hard disk            01/01/70 00:00      
RE: ide hard disk            01/01/70 00:00      
RE: ide hard disk            01/01/70 00:00      
RE: ide hard disk            01/01/70 00:00      
RE: ide - standards            01/01/70 00:00      
RE: ide hard disk / Contents of MBR            01/01/70 00:00      
RE: ide hard disk            01/01/70 00:00      

Back to Subject List