Firmoo

Firmoo
Firmoo

Quran Guidance of the Day

Wednesday, January 4, 2012

How a Disk Boot Works

by Ron White

A personal computer can’t do anything useful unless it’s running an operating system—a basic type of software that acts as a supervisor for all the applications, games, or other programs you use. The operating system sets the rules for using memory, drives, and other parts of the computer.

But before a PC can run an operating sys tem, it needs some way to load the operating system from disk to random access memory (RAM). The way to do this is with the boot strap or simply to boot — a small amount of code that’s permanently a part of the PC.

The bootstrap is aptly named because it lets the PC do something entirely on its own, without any outside operating system. Of course, the boot operation doesn’t do much. In fact, it has only two functions: one is to run a POST, or power-on self-test described in the preceding chapter, and the other is to search drives for an operating system. When these functions are complete, the boot operation launches the process of reading the system files and copying them to random access memory.

Why do PCs use such a round - about arrangement? Why not simply make the opera ting system a part of the PC? A few low-end or specialized computers do this. Early computers used primarily for playing games, such as the Atari 400 and 800, and the more recent palm-sized PCs, have a permanent operating system. But in most cases, the operating system is loaded from harddisk for two reasons.

It is simpler to upgrade the operating system when loading from a disk. When a company such as Microsoft—which makes MS-DOS and Windows, the most commonly used PC operating systems—wants to add new features or fix serious bugs, it can simply issue a new set of disks. Sometimes all that’s necessary is a single file that patches a flaw in the operating system. It’s cheaper for Microsoft to distribute an operating system on disk than to design a microchip that contains the operating system. And it’s easier for computer users to install a new operating system from disk than it is to swap chips.

The other reason for loading an operating system from disk is that it gives users a choice of operating systems. Although most PCs based on microprocessors built by Intel use Windows or MS-DOS, there are alternative operating systems, such as Windows NT, OS/2, DRDOS, and UNIX. In some PC setups, you can even choose which of the operating systems to use each time you turn on your computer. We’ll use DOS/Windows here because it’s typical of all operating systems.

Disk Boot

1. After conducting a POST check of all the hardware components of a PC, the boot program contained on the computer’s ROM BIOS chips checks drive A to see if it contains a formatted floppy disk. If a disk is mounted in the drive, the program searches specific locations on the disk for the files that make up the first two parts of the operating system. You won’t ordinarily see these system files because each is marked with a special file attribute that ordinarily hides it from any file listing. For Windows systems, the files are named IO.SYS and MSDOS.SYS. If the floppy drive is empty, the boot program checks the hard drive C for the system files, and on some systems, as a last resort, checks the CD-ROM drive. If a boot disk does not contain the files, the boot program generates an error message.

2. After locating a disk with the system files, the boot program reads the data stored on the disk’s first sector and copies that data to specific locations in RAM. This information constitutes the boot record. The boot record is found in the same location on every formatted disk. The boot record is only about 512 bytes, just enough code to initiate the loading of the two hidden system files. After the BIOS boot program has loaded the boot record into memory at the hexadecimal address 7C00, the BIOS passes control to the boot record by branching to that address.

3. The boot record takes control of the PC and loads IO.SYS into RAM. The IO.SYS file contains extensions to the ROM BIOS and includes a routine called SYSINIT that manages the rest of the boot up. After loading IO.SYS, the boot record is no longer needed and is replaced in RAM by other code.

4. SYSINIT assumes control of the start-up process and loads MSDOS.SYS into RAM. The MSDOS.SYS file works with the BIOS to manage files, execute programs, and respond to signals from hardware.

5. SYSINIT searches the root dire c t o ry of the boot disk for a file named CONFIG.SYS. If CONFIG.SYS exists, SYSINIT tells MSDOS.SYS to execute the commands in the file. CONFIG.SYS is a file created by the user. Its commands tell the operating system how to handle certain operations, such as how many files may be opened at one time. CONFIG.SYS may also contain instructions to load device drivers.

Device drivers are files containing code that extends the capabilities of the BIOS to control memory or hardware devices. (In Windows, drivers are loaded through records in a file called the Registry.)

6. SYSINIT tells MSDOS.SYS to load the file COMMAND.COM. This operating system file consists of three parts. One is a further extension to the input/output functions. This part is loaded in memory with the BIOS and becomes a part of the operating system.

7. The second part of COMMAND.COM contains the internal DOS commands such as DIR, COPY, and TYPE. It is loaded at the high end of conventional RAM, where it can be overwritten by applications programs if they need the memory.

8. The third part of COMMAND.COM is used only once and then discarded. This part searches the root directory for a file named AUTOEXEC.BAT. This file is created by the computer’s user and contains a series of DOS batch file commands and/or the names of programs that the user wants to run each time the computer is turned on. The PC is now fully booted and ready to be used.


No comments:

Post a Comment

Revolver Maps