[comp.sys.ibm.pc] DOS Structure on Hard Disk - A Question

desmond@cod.NOSC.MIL (J. Desmond) (09/01/89)

            Recently, out of curiosity, I started to take a deep look at
      how DOS is structured on my hard disk.  All the manuals say that the
      boot record is the absolutely no kidding very first thing on the
      disk.  And that's exactly what shows up with DEBUG and NORTON U's
      when I specify the lowest numbered sector available.  I felt
      reassured.  Today I found several low level sector editors and took
      them for a spin and nearly drove off the edge of the world!  There,
      before the boot sector, was an entire track with more stuff on it.
      The editor said that the boot sector began at cylinder 0, head 1,
      sector 1 but woke up looking at C0,H0,S1 which contained code and
      some ascii such as "Bad part. table" and "Hard drive I/O error" and
      "No DOS on disk".  The rest of the track seems to be all zeros.
      Anybody out there able to explain what this stuff is, how and when it
      gets there, and how programs might access it and why (i.e. do PC
      locking programs mess with it and does DOS care?)

      Here's my basic disk information:

      OEM Name and Version: ZDS  3.0

      Information for Drive C:
            512 Bytes/Sector
              4 Sectors/Cluster (2048 Bytes/Cluster)
             17 Sectors/Track
              4 Heads on Disk

         Total Disk Capacity is 41463 Sectors
                      including     1 Boot Sector
                                   82 FAT Sectors
                            and    32 Root DIR Sectors

         Storage Capacity is 21170176 Bytes
                                41348 Sectors
                                10337 Clusters

         The disk contains 2 FAT's of 41 sectors each, using 16 bit FAT entries
         The disk's root directory occupies 32 sectors and can hold 512 files



      Thanks.
      -John M. Desmond
      desmond@nosc.mil

cpcahil@virtech.UUCP (Conor P. Cahill) (09/02/89)

In article <1626@cod.NOSC.MIL>, desmond@cod.NOSC.MIL (J. Desmond) writes:
> 
>             Recently, out of curiosity, I started to take a deep look at
>       how DOS is structured on my hard disk.  All the manuals say that the
>       boot record is the absolutely no kidding very first thing on the
>       disk.  And that's exactly what shows up with DEBUG and NORTON U's

The first sector on the disk contains the partition table which is read
by the bios and which indicates the location of the "active" partition
whose first sector must contain the bootstrap program.  This info 
is described in heavy detail in the "Norton's Guide to the IBM PC".


-- 
+-----------------------------------------------------------------------+
| Conor P. Cahill     uunet!virtech!cpcahil      	703-430-9247	!
| Virtual Technologies Inc.,    P. O. Box 876,   Sterling, VA 22170     |
+-----------------------------------------------------------------------+

mlord@bmers58.UUCP (Mark Lord) (09/02/89)

Congratulations, you have just discovered the partition table, which will
preceed the boot sectors on any drive with multiple partitions.  If your 
disk had only a single partition (ie. a 32meg drive with NO partition table)
you would find the boot sectors where you expected them: first on the disk.

The partition table is an add on to allow the physical disk to appear to be
several disks, each of which may have a boot record in the "first sectors".
A flag within the partition table selects which "disk" to really boot from.

-Mark

silver@eniac.seas.upenn.edu (Andy Silverman) (09/03/89)

In article <180@bmers58.UUCP> mlord@bmers58.UUCP (Mark Lord) writes:
>Congratulations, you have just discovered the partition table, which will
>preceed the boot sectors on any drive with multiple partitions.  If your 
>disk had only a single partition (ie. a 32meg drive with NO partition table)
>you would find the boot sectors where you expected them: first on the disk.

This is slightly inaccurate.  There is a partition table located on EVERY
hard disk, whether there is only one partition or not.  If there is only
one partition then there will be only one entry in it, but it will be there
all the same. Otherwise how would the controller figure out whether the first
sector of the drive was a table or a boot sector?  (The table is not made up
of executable code.)



+-----------------------+-----------------------------------------+
| Andy Silverman        | Internet:   silver@eniac.seas.upenn.edu |
| "All stressed out and | Compu$erve: 72261,531                   |
|  nobody to choke."    |                                         |         
+-----------------------+-----------------------------------------+

ralf@b.gp.cs.cmu.edu (Ralf Brown) (09/03/89)

In article <14039@netnews.upenn.edu> silver@eniac.seas.upenn.edu.UUCP (Andy Silverman) writes:
}This is slightly inaccurate.  There is a partition table located on EVERY
}hard disk, whether there is only one partition or not.  If there is only
}one partition then there will be only one entry in it, but it will be there
}all the same. Otherwise how would the controller figure out whether the first
}sector of the drive was a table or a boot sector?  (The table is not made up
}of executable code.)

No, the partition table *follows* executable code, whose job it is to 
determine which partition to boot from, and to load and execute that 
partition's boot sector.  The partition table is at offset 1BEh of the master
boot record.
-- 
{backbone}!cs.cmu.edu!ralf   ARPA: RALF@CS.CMU.EDU   FIDO: Ralf Brown 1:129/46
BITnet: RALF%CS.CMU.EDU@CMUCCVMA   AT&Tnet: (412)268-3053 (school)   FAX: ask
DISCLAIMER? |"Humor is laughing at what you haven't got when you ought to
What's that?| have it."  -- Langston Hughes