Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How does the BIOS control I/O devices without any form of drivers?

For example how is an image displayed whilst the computer is booting if the BIOS doesn't have any drivers for the graphics card.

Is there some sort of generic driver that is standard across all BIOSs and hardware that allows the BIOS to perform basic functions no matter what hardware is installed.

Any help would be appreciated.

Thanks.

share|improve this question
    
Do you have a specific problem your trying to solve? If your asking if there is BIOS uses a universal generic drive it doesn't –  Ramhound Oct 15 '13 at 11:26
    
I think there's a minimal standard output format (vesa) and the video card has its own bios. Besides, its not like your bios/uefi firmware is rendered, realtime in 3d. –  Journeyman Geek Oct 15 '13 at 11:34
5  
@Ramhound It's not a problem I'm trying to solve it's just a general question. Whatever graphics card you put in your system you can still see the dispaly whilst booting, so is there some standerdised interface that is programmed into the BIOS? –  RJSmith92 Oct 15 '13 at 11:35
3  
Do you have a specific problem your trying to solve? Yes, they are trying to solve the problem of finding an answer to the question they asked. ¬_¬ –  Synetech Oct 15 '13 at 14:46
    
Related: superuser.com/questions/357328/… –  Russell Borogove Oct 15 '13 at 16:56
add comment

2 Answers

up vote 12 down vote accepted

Does the BIOS have some sort of generic 'drivers'

How does the BIOS control I/O devices without any form of drivers?

Standards. All components implement a basic interface, and the BIOS is programmed to use that. Of course because it is a basic interface (that’s what the ‘B’ in BIOS stands for), it can not take advantage of the hardware’s full capabilities; that is left to software to implement via drivers which can access the hardware directly.

Originally, the BIOS manufacturers created a set of APIs that devices were expected to use if they wanted to be compatible. They did this via “interrupts” which is a way for a device to, well, interrupt the program to let it know that something happened and vice versa.

For example how is an image displayed whilst the computer is booting if the BIOS doesn't have any drivers for the graphics card.

In the case of pre-boot display, the video-adapter’s firmware implements VESA (Video Electronics Standards Association) which is a standard that was created to simplify access to display hardware. The BIOS knows how to access the video-hardware using the standard functions provided. It is somewhat similar to how DirectX was implemented as a higher-level API to hardware so that programmers didn’t have to account for every single hardware configuration.

Is there some sort of generic driver that is standered accross all BIOSs and hardware that allows the BIOS to perform basic functions no matter what hardware is installed.

Sort of. It’s not a driver, but a standard API; a set of programming functions that can be used to do basic things like initialize a device or input and output data.

If manufacturers want to sell their products, they will need to make sure that they at least implement the standard APIs so that they will be compatible. That way, the system can detect the hardware and in the case of boot-critical devices, they can access them at a basic level until a software driver that knows how to access them fully can be loaded.

share|improve this answer
    
Thanks, great answer. So BIOS interrupt calls (Which DOS systems used to use) are still used up until the OS is loaded? –  RJSmith92 Oct 15 '13 at 15:25
1  
Yes, the BIOS provides a bunch of different interrupts that can be used (though not all BIOSes will provide all functions). DOS systems did use those, but DOS also created INT 21 and 2F to provide higher-level software interrupts to do things (I miss DOS/hardware assembler programming so much). The fact is, there will always need to be some basic, low-level functionality required to provide compatibility, even with EFI and whatever else comes in the future. It may take different forms, but without some sort of common language, there would be no way for the system to use the hardware devices. –  Synetech Oct 15 '13 at 15:31
    
It's my understanding that interrupt calls are still used by the kernel and kernel-level services. Is that not true? –  BlueRaja Oct 15 '13 at 16:22
    
@BlueRaja, maybe during boot (they need some way of accessing the hardware), but after they run the detection routines, they use the appropriate drivers (which are just low-level programs) to directly access the hardware. Even the kernel would need direct access to get the most of the hardware, for example taking advantage of advanced CPU functions or optimizing the use of the memory controller and chipset. –  Synetech Oct 15 '13 at 17:18
add comment

The BIOS in a PC was meant to fufill a similar function as the BIOS in an 8-bit CP/M system, popular before the PC took over in the mid-80's. The BIOS was intended to contain a minimal bootloader and hardware-dependent low-level routines to do input and output to a few devices (screen, disk, tape, COM port). Knowledge to do this was built into the ROM - no driver needed, and of course, no additional hardware supported by this ROM. (Things like power management and ACPI came much later, in the 90's, after the PC had established itself as an ubiquitous platform.)

(The CP/M "filesystem" was in a component loaded off disk called the BDOS - likewise, knowledge of the FAT filesystem and it's interfaces is in (at least one of) two hidden files MSDOS.SYS or IO.SYS - not part of the BIOS ROM.)

However ... The PC BIOS, unlike CP/M, did support the notion of "Option ROMS" which could be included on an expansion card. So there was at least a minimal mechanism to extend the BIOS. Video cards starting with CGA (MDA, CGA's predecessor, may have done it too) would have an option ROM that extended or added I/O functions to the BIOS interface. (This is why you see an NVidia message before your BIOS boots.) So did hard controllers and SCSI cards. All of these still do. Many older network cards have a socket for a boot ROM.

Keep in mind also that PC clone manufacturers that arose in the 80's very quickly decided not to provide only a compatible BIOS interface, but ended up having to copy the PC platform as a whole, including all of the low level hardware such as the timer chip, interrupt controller, etc. (This was relatively easy since little of it was IBM proprietary.) This was because the BIOS was slow to do things and programmers accessed the hardware directly, particularly for games.

Thus, between option ROMs and this consensus of standard hardware that forms the PC platform, as well as the fact it's been kept backwards compatible throughout the evolution of the PC, something wishing to use the display without a driver can:

  • use standard BIOS interfaces, which may be "hooked" by an option ROM in the video hardware
  • or make assumptions about what hardware is in the system and access basic hardware directly

All PC display hardware still works in a "VGA compatible" mode upon boot. The original IBM VGA adapter had modes compatible with earlier EGA, CGA, and MDA cards. All this means is that something running from the BIOS or outside of an OS can assume it can still read and write the same memory connected to the display now as it could in 1985, through convention.

share|improve this answer
    
Thanks for the answer. So the BIOS on expansion cards must follow some sort of standard so that any motherboard bios can use it? –  RJSmith92 Oct 15 '13 at 12:37
1  
Not sure whether it's as much as a standard rather than a long-standing convention, but something like that. I guess BIOS Boot Specification (BBS) is something of a formal standard here. en.wikipedia.org/wiki/Option_ROM –  ultrasawblade Oct 15 '13 at 13:55
    
Yes, thats the sort of thing I was looking for. Thanks again –  RJSmith92 Oct 15 '13 at 15:30
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.