Does the BIOS have some sort of generic 'drivers'

22

7

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.

RJSmith92

Posted 2013-10-15T11:13:07.557

Reputation: 820

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 – 2013-10-15T11:26:11.807

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 – 2013-10-15T11:34:53.010

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 – 2013-10-15T11:35:05.977

4Do 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 – 2013-10-15T14:46:09.730

Answers

13

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.

Synetech

Posted 2013-10-15T11:13:07.557

Reputation: 63 242

Thanks, great answer. So BIOS interrupt calls (Which DOS systems used to use) are still used up until the OS is loaded? – RJSmith92 – 2013-10-15T15:25:20.433

1Yes, 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 – 2013-10-15T15:31:54.630

It's my understanding that interrupt calls are still used by the kernel and kernel-level services. Is that not true? – BlueRaja - Danny Pflughoeft – 2013-10-15T16:22:51.467

@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 – 2013-10-15T17:18:36.897

22

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.

LawrenceC

Posted 2013-10-15T11:13:07.557

Reputation: 63 487

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 – 2013-10-15T12:37:12.080

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. http://en.wikipedia.org/wiki/Option_ROM

– LawrenceC – 2013-10-15T13:55:28.190

Yes, thats the sort of thing I was looking for. Thanks again – RJSmith92 – 2013-10-15T15:30:48.147