4

I am reading the book: How Computers Work: The Evolution of Technology and in Chapter 4 the author says:

The operating system does not work alone. It depends not only on the cooperation of other programs, but also on meshing smoothly with the BIOS and software drivers. The BIOS-or basic input/output system is made of code contained on chips in a Pc. It acts as the intermediary among the hardware, processor, and operating systems. Device drivers are like a specialized BIOS. Drivers translate commands from the operating system and BIOS into instructions for a specific piece of hardware, such as a printer, scanner, or DVD-ROM drive. When some parts of the operating system are loaded from disk, they are added to the BIOS and then joined by device drivers, and all of them carry out routine hardware functions. The operating system is really composed of all three of these components, plus scores of other programs, common code, and data files.

The important part here is:

When some parts of the operating system are loaded from disk, they are added to the BIOS and then joined by device drivers

What is added to the BIOS? I did not know BIOS was modified by the OS? Or am I understanding this wrong?

1 Answer 1

3

First, understand that x86 hardware has an Interrupt Descriptor Table that lives in RAM. On the original 8086 CPU this was fixed at memory location 0, the first location of RAM, but it can be moved in later and modern CPUs. The BIOS initially sets this up at memory location 0.

The IDT is a list of 32-bit pointers to routines elsewhere in memory (which can be ROM or RAM), numbered 0x00 to 0xFF.

These days, the first 32 of those are reserved for use of the CPU itself. A general protection fault, for example, will cause the routine pointed by vector 0x0D to be called.

Any routine pointed to in one of these vectors can be "called" with the software interrupt instruction INT. So INT 0x0D will call the same routine as would be called if a general protection fault was called.

The DOS-era BIOS uses many of them to present a standard interface for BIOS calls. Some of the ones the BIOS traditionally uses overlaps with what the CPU uses.

DOS itself also made use of a single interrupt, 0x21, to allow programs a standard way to call DOS functions.

Now, a well-known BIOS interrupt is 0x13, which allows reading or writing a sector to a disk device.

During the boot process, the ROM area of memory is scanned and the initialization code of any ROM is called. ISA and PCI devices can have a ROM on them that appear, and that will be called during boot. The devices ROM can modify vectors, extending or replacing BIOS functionality. RAID cards designed to work with DOS and 9x versions of Windows can do this.

A BIOS routine initializes the video display and allows setting of the display mode. It's very common for video cards to have a ROM that overrides this interrupt to allow the graphics card to be used during the BIOS boot process (and DOS, if you really wanted).

There is nothing stopping a program after all that initializes from modifying those vectors to augument or replace BIOS functionality. Way back when certain BIOSes could not access hard drive sectors over an 8Gbyte barrier, some vendors provided a boot disk that provided a utility which hooked into Int 0x13, bypassing the BIOS limitation.

So this all was very common when DOS was the prevalent operating system. These days the BIOS, if it's still around (UEFI is it's successor), is pretty much used just for initialization and your boot screen, and the operating system accesses the hardware directly - the exception being things related to power management.

1
  • So we can say that operating system does NOT modify the DOS at all. It used to modify the interrupt table, but not even that anymore? Commented Mar 3, 2015 at 17:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .