Can OS bypass the BIOS?

This is a discussion on Can OS bypass the BIOS? within the Tech Board forums, part of the Community Boards category; The BIOS is not totally ignored in Windows, but I'm not sure about Linux. More than likely through the years, ...

  1. #31
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,596
    The BIOS is not totally ignored in Windows, but I'm not sure about Linux. More than likely through the years, MS wrote a driver to interface with the auto-power on/off feature of the BIOS. You can still generate interrupts in protected mode, contrary to popular belief, but it comes at a performance price. I'm not saying that Windows never fires off interrupts because it does. I know that interrupt 13h is hooked by Windows for hard drive control. If it did not use the BIOS to control the hardware then vendors of drives would have to agree to a standard about how drives are accessed and used. Perhaps they have such a standard and thus Microsoft can now access the drives w/o using interrupt 13h.

    Interrupts are generated in 32-bit protected mode via the IDT or interrupt descriptor table which maps into the IVT or interrupt vector table. To execute one you must pop out of PM temporarily, execute, and pop back in. You don't have to setup your selectors and limits again, however, as it is a simple pop out pop in operation. Check the Intel docs concerning interrupts in 32-bit PM as well as interrupts as they relate to the 32-bit protected mode programming paradigm.

    As for Linux, I'm not sure how they do all of these things. If you do not use the BIOS for some things, though, you will have devices that just won't function - UNLESS they are geared towards a specific standard - and MS has the monopoly on that one.

    The main idea of 32-bit PM is that drivers do all the work. A driver is installed which can then access the device in question directly. The goal is to hide the underlying nitty gritty work that is going on from the end user or even programmer. The bulk of the work is done by the driver which has PL0 access and thus can pretty much do anything it wants.

    However on boot-up ALL OS's must get the system into PM because all Intel CPUs start out in real mode. The BIOS looks for the boot sector on drive 0, sector 0 and if not found looks on drive 1, sector 0. The boot sector must end with a special signature or it will not boot and it must be EXACTLY 512 bytes in length. Once the BIOS starts it then loads 512 bytes from sector 0 into memory location 0000:07C00 and performs a jump to that address to pass control to the boot strap code. The boot strap code then will more than likely setup the IDT, GDT, and LDT for use and pop into protected mode ASAP. After doing this, it will probably re-locate itself at another memory address and continue loading more sectors of boot code. Windows 95 took 4 sectors of boot code to get to the kernel load and shell. After re-locating the boot code will then allocate memory for the kernel and load it from the disk into memory and then Windows probably fires off it's pre-emptive multi-tasking environment.

    The whole process can be quite complex.
    Last edited by VirtualAce; 08-09-2006 at 05:41 AM.

  2. #32
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,231
    I learned some good things:
    It is up to OS to use BIOS methods or not
    System should go from PM to RM and bask to perform a BIOS call.

    What about x64?
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

Page 3 of 3 FirstFirst 123
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Detecting if OS is Windows???
    By Ktulu in forum Windows Programming
    Replies: 2
    Last Post: 11-19-2006, 01:49 AM
  2. Lost BIOS menu options?
    By PJYelton in forum Tech Board
    Replies: 3
    Last Post: 11-14-2004, 07:23 AM
  3. a simple OS
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 06-06-2004, 10:47 PM
  4. Bios upgrade-dell latitude
    By GanglyLamb in forum Tech Board
    Replies: 4
    Last Post: 06-18-2003, 01:55 PM
  5. How do they compile code for an OS ?
    By Nutshell in forum A Brief History of Cprogramming.com
    Replies: 49
    Last Post: 03-27-2002, 11:16 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21