12

This question comes to mind when dealing with RAID arrays, but is not necessarily applicable to the subject.

How is that the BIOS is able read from a hard drive to effectively load the OS, when many OS's need drivers to be able to do the same thing? Does the BIOS have a list of drivers it pulls from like one of the mainstream OS's do like Windows or Linux?

1
  • 2
    SU admins are not constructive
    – Stumbler
    Sep 8, 2017 at 14:00

4 Answers 4

10

First off, BIOS is the Basic Input/Output System, not technically an Operating System... As for loading RAID and such, what happens during the boot is the machine queries any add in cards asking if they have a BIOS to load. Mr RAID card yells out "Ya, I got something to do first", then he fires up his "BIOS" (in this case, an OS), does some calculations itself, then passes control back to the main BIOS ("Hey, I'm done, here is all the information you need to know on a need to know, you know?").

Once the main BIOS gets control again, it can go through as say "Ahhh, I see Mr RAID has a bootable volume, I shall cycle through that if possible, then try my other tricks".

So not "technically" is the BIOS an operating system, but it is an Input/Output system to prepare for the real operating system

3
  • 11
    "he fires up his "BIOS" (in this case, an OS)" - BIOS or BIOS extensions simply are not an OS. The salient purpose of an OS is resource management. The BIOS, as a standalone boot program, does not bother to maintain any resource allocation info. There are no open() or close() routines provided by the BIOS to restrict access to hardware. Any executing code can utilize BIOS read/write functions. The BIOS fails to meet the basic purpose of OS.
    – sawdust
    May 15, 2012 at 19:53
  • @sawdust what about enabling or disabling onboard devices? That would restrict access to hardware.
    – Bon Gart
    May 16, 2012 at 0:48
  • @BonGart - En/dis-abling by BIOS is simply a configuration tool that is a substitute for physically installing or removing the device. It's a system-wide action, and in effect until a reconfig or device failure. I was actually referring to OS concepts for synchronization and exclusion such as mutexes and semaphores which can control/restrict at the process and/or thread level. Or for example a print spooler; the OS's spool program owns the printer, and disallows any direct use of that printer. You have to submit your print job to the spooler, which queues print requests.
    – sawdust
    May 16, 2012 at 3:06
10

The BIOS, literally a "basic input/output system", is a set of small programs hard-coded into a computer's motherboard (usually stored on an EEPROM). These programs include the ability to modify settings, write text and take user input from basic I/O devices (the motherboard has to emulate them for advanced VGA and USB mouse/keyboard devices), and most importantly, provides the functionality to find and boot operating systems present on any attacked storage devices.

By itself, the BIOS is not an operating system. The BIOS is a small program to actually load an OS. While it is possible in some operating systems to invoke the various BIOS sub-systems, this requires the CPU to switch back to real-mode, since the BIOS doesn't provide virtual memory support, task switching (and thus the ability to run programs), or device driver support (and thus, cannot directly access hardware out of the direct-map accessible range, nor anything not covered in the BIOS interrupt calls).

As Linus Torvalds said:

Not that I'd ever claim that the BIOS is wonderful either, but at least everybody knows that the BIOS is just a bootloader, and doesn't try to make it anything else.

The absolutely biggest advantage of a BIOS is that it's so inconvenient and obviously oldfashioned, that you have to be crazy to want to do anything serious in it [...] don't get any ideas about it being some grandiose framework for anything else than "just load the OS and get the hell out of there".

Finally, it should be noted that a BIOS is significantly different than a UEFI (Unified Extensible Firmware Interface), the latter being significantly closer to providing a basic operating system interface (providing device drivers and application support). It is still questionable as to whether or not even the UEFI can be considered a true operating system on it's own, although it is significantly closer to being considered an OS than a BIOS would.

3

What is or isn't an "operating system" is a matter of judgment. Arguably (and I argued this in 1980), the original PC/MS DOS was not an "operating system" (despite its name), since it provided only I/O services (and a crude command analyzer) and no true system management facilities.

OTOH, many BIOS implementations now include some degree of hypervisor function which manages system resources in a fairly sophisticated way.

As to how BIOS manages to load from disk, etc, without drivers, by convention/standard "bootable" devices include a set of operations that can be used without having to set up a sophisticated management infrastructure. In some cases this is only the ability to read a few sectors at a relatively fixed location, but that's all that's needed in most cases.

4
  • So, you'd turn on the computer, load MS-DOS, and then be able to run programs. You say that MS-DOS wasn't an OS... where was the OS then? It sounds like you are saying that MS-DOS isn't what you consider to be a real OS, even if it technically functioned as one (and therefore was one).
    – Bon Gart
    May 15, 2012 at 22:03
  • 1
    There used to be lots of computers with no "operating system", just a "run-time executive" or some such that provided file services and a command analyzer. They never called them "operating systems". May 15, 2012 at 22:12
  • 2
    @bonGart "where was the OS then?" there is no requirement to have an OS, that is, a resource allocator/manager, to execute programs on a computer. Early (or simple) computers (including micros running CP/M) simply had a resident loader program, and the loaded program had full access to all computer resources. There was no contention for resources, hence no need for an OS.
    – sawdust
    May 15, 2012 at 22:17
  • @sawdust -- Correct. And one step up from the "resident program loader" was a resident runtime library (paper tape, diskette, and keyboard/display functions -- maybe printer) and a "monitor" or "executive" or some such that would detect when one program ended to load the next one. DOS was not much more sophisticated than these. May 15, 2012 at 23:02
2

To deal with the many comments and points brought up, I have edited the answer yet again.

Is the BIOS an Operating System?

Well, if an operating system is defined as software that allows a user to interact with the hardware of a “computer” then yes… technically and literally it is an Operating System.

Does Task Switching define what makes an Operating System?

Considering that MS-DOS was a valid Operating System, and up until version 5 Task Switching was not supported, task switching does not affect whether or software is an Operating System.

Does Virtualization of Memory define what makes an Operating System?

Again, using MS-DOS as an example, although support could be added for memory virtualization by running extenders during the loading process, it was not necessary to use them. Thus, memory virtualization also is not a prerequesite to what makes up an Operating System.

If it is stored in Firmware, is it an OS?

Some would argue that a router doesn’t use an Operating System. For example, there appears to be contention as to whether DD-WRT is considered an Operating System. Are there devices that store an Operating System in Firmware? Modern phones, iPods, and more store complex operating systems that can have programs added to them in Firmware. So, just because an OS is loaded into Firmware, this does not exclude the software in question from being considered an Operating System.

If you can’t add programs, it’s not an Operating System.

Step away from a modern smartphone. Look at a cheap disposable cell phone. It has an Operating System stored in Firmware, but you cannot add programs. It runs as it is, and only with the functionality that is offered. You navigate through the menus as you would any other OS, you choose what you want to do (play games, etc) and with a good number of them from a few years back, they did not have the ability to add any additional software.

If it is not modern, is it not an Operating System?

The point in history at which the OS was created and launched has no bearing on whether or not it is an Operating System.

So, the BIOS may not be pretty, and it may not offer you extreme functionality. However, it is still an Operating System.

18
  • 3
    The definition of Operating System on wikipedia is questionable itself. (I heard some others) But anyway you are totally missing out on [...] provides common services for computer programs, which I think is essential for an OS.
    – Baarn
    May 15, 2012 at 17:37
  • 1
    I lean more towards firmware than OS. A bios has no intelligence, it just communicates with hardware at a very low level and passes that info to the OS. UEFI is changing the game though.
    – Moab
    May 15, 2012 at 17:46
  • 1
    Its a fine line between firmware and OS, subjective as hell.
    – Moab
    May 15, 2012 at 17:50
  • 1
    OK, I give in, its a biOS, you may now lop my head off.. ;-)
    – Moab
    May 15, 2012 at 17:53
  • 2
    @BonGart a BIOS lacks virtual memory support and task scheduling - and thus, lacks the ability to run programs (i.e. it cannot be run concurrently with anything else). While I agree that it provides basic I/O support, it's a small program and not an operating system... Or would you classify the small piece of code on my microcontroller that receives a password and turns on an LED (thus providing basic I/O support) an operating system as well? May 15, 2012 at 18:02

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