Yasin Fatullayev
Yasin Fatullayev

Reputation: 169

Do Bios interrupts always sits on ram?

My question is Do Bios interrupts sit in RAM even after operating system loaded? If yes then that part of ram which keeps bios interrupts and interrupt handlers is reserved and not overridden by other programs. Is that right? Thanks in Advance

Upvotes: 0

Views: 463

Answers (1)

Ross Ridge
Ross Ridge

Reputation: 39571

Because RAM is volatile and is completely erased when the power is turned off, the code that handles the BIOS interrupts doesn't exist in RAM. It's all in ROM (or actually flash memory these days). There is however one critical part of how interrupts are handled that's kept in RAM and that's the Interrupt Vector Table (IVT), which stores the address of all the interrupt routines. The CPU uses this table to find the address of the code to execute in order to handle interrupts. The BIOS interrupt routines also use RAM store various bits of data they need to function.

When an modern protected-mode operating starts it has to completely replace all interrupt routines with its own. It has to do this because the BIOS's interrupt code won't work in protected mode. Unless the OS takes special steps to preserve the old IVT in RAM that the BIOS created, along with any data the BIOS stored in RAM, then this information is lost. That means it's no longer possible to use BIOS interrupts without rebooting the machine. The RAM used by the BIOS to handle interrupts is not reserved an the OS can use it how it pleases.

The only protected-mode operating systems that I know that preserve the BIOS's IVT and data are Windows 95, 98 and ME. These are also the only operating systems that would let you invoke a BIOS interrupt from a user-mode program, and then only reliably from a 16-bit application.

Upvotes: 3

Related Questions