Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!ogicse!pdxgate!eecs!ericb From: ericb@eecs.cs.pdx.edu (Eric Berggren) Newsgroups: comp.os.msdos.programmer Subject: Re: How does BIOS find Boot Sectors? Message-ID: <2635@pdxgate.UUCP> Date: 15 May 91 06:05:09 GMT References: <13073@monu1.cc.monash.oz> Sender: news@pdxgate.UUCP Lines: 39 ins760z@monu4.cc.monash.edu.au (mr c.r. hames) writes: > How does the BIOS know how far in is the boot record from the start of >a harddisk that is going to be autobooted from? Like how does it work out >how much partition info is before the boot record ? >Email please, I already e-mailed him, here's a copy of my letter... Well.. [in case you have not already received 30 messages in 30 seconds] Located on absolute sector 0 and offset 0x1be (I believe) is the partition table. In this table contains all the necessary information such as starting and ending cylinders, heads, and sectors, as well as its size and absolute starting sector (why the redundancies, I dunno, some fdisk programs only set one of the parameters and not the others, which creates problems for some OS's other than MS-DOS). When you boot the system, the fixed disk BIOS does its magic and looks for a partition with a flag indicating it is the active one (also conatained in each partition entry) When it finds an active partition, it reads the starting sector, jumps to that and boots similarly to a floppy disk, the first sector of each partition has their own boot block, so you may have multiple operating systems on one drive and can boot off of any one by simply changing the active flag and rebooting the machine. Now DOS 4.xx+ has logical partitions in a physical partition, so each MS-DOS physical partition has a mini-partition table in it. Only the first logical partition is bootable, the rest are assigned as consecutive drives. This is a very general overview of how it works. If you want to know more about the gory details, lemme know, as I am writing my own disk partitioning program that will enable me to manipulate any type of partition. -e.b. ============================================================================== Eric Berggren | "Life is a Turing Test; Computer Science/Eng. | We're all automatons!" ericb@eecs.cs.pdx.edu | - (click, whir, buzz, chirp)