Is BIOS considered an OS?

11

1

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?

Chad Harrison

Posted 2012-05-15T17:00:12.780

Reputation: 5 759

Question was closed 2012-05-18T11:16:18.303

2SU admins are not constructive – Stumbler – 2017-09-08T14:00:48.427

Answers

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

Canadian Luke

Posted 2012-05-15T17:00:12.780

Reputation: 22 162

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 – 2012-05-15T19:53:19.787

@sawdust what about enabling or disabling onboard devices? That would restrict access to hardware. – Bon Gart – 2012-05-16T00:48:48.217

@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 – 2012-05-16T03:06:17.093

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.

cp2141

Posted 2012-05-15T17:00:12.780

Reputation: 1 222

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.

Bon Gart

Posted 2012-05-15T17:00:12.780

Reputation: 12 574

@Baarn But that was the whole point of the BIOS when it was designed! Consider IBM-compatible BIOS: It provided common services for accessing the video services (int 10h), hardware enumeration (int 11h), memory querying (int 12h), low-level disc services (int 13h), serial port services (int 14h), system functions (int 15h), keyboard services (int 16h), printer services (int 17h), BASIC, RTC and PCI. As long as you stick to those, your program would run on any IBM-compatible system. Sure, it was tiny and primitive, but the whole point of it was to give a common interface to applications. – Luaan – 2016-08-01T13:03:19.777

3The 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 – 2012-05-15T17:37:21.003

No, not missing out on that. An Operating System is software that allows you to access the functions of the hardware connected to the system. A modern Router with a web interface has an Operating System. A Canon CLC 700 copier has an Operating System. – Bon Gart – 2012-05-15T17:43:03.180

1I 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 – 2012-05-15T17:46:11.437

1Its a fine line between firmware and OS, subjective as hell. – Moab – 2012-05-15T17:50:20.650

1OK, I give in, its a biOS, you may now lop my head off.. ;-) – Moab – 2012-05-15T17:53:14.750

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? – Breakthrough – 2012-05-15T18:02:40.797

I agree it is a very very low level OS of sorts, but is not flexible compared to a real OS. I mean it not like you can really do anything in a bios like you can on OS, turn things on or off, maybe tweak some bus settings, pretty rigid OS. One could argue the bios was invented first, then the term OS was coined for software that rode on top of the bios. – Moab – 2012-05-15T18:04:13.317

@BonGart you do realize that you can run full programs on DD-WRT, right? I have a lighttpd server running with full PHP-5 support on my router. It also comes with SSH support, as well as a full shell (including scripting support), and you can get many other packages (including torrent clients, vim, FTP servers, and much more). So yes, DD-WRT is an OS.

– cp2141 – 2012-05-15T18:24:29.570

@MOAB, I think OS came before BIOS, not the other way around. For example: http://www.retrotechnology.com/pdp11/pdp8i_boot.html

– RedGrittyBrick – 2012-05-15T18:44:48.253

@RedGrittyBrick, they still had to load bootstrap code? essentially a bios? Something from nothing, which is what a bios does. – Moab – 2012-05-15T18:49:36.130

@BonGart - "I would classify any software that allows you to interact with hardware to be an OS" - that's your opinion that is not shared by most if not all SW developers. It's not "interact", but "management" of HW/system resources that distinguishes an OS from any other standalone programs. The BIOS has no scheduler, no memory pool allocator nor restricts access to any hardware. It is just a standalone boot program with extensions for self test and system configuration by the user. Note that "manage" is in the definition you yourself cite, but omit from your classify requirements. – sawdust – 2012-05-15T20:09:46.180

@cp2141 - DD-WRT is not an OS. It is a bundled firmware package that includes the Linux OS with applications programs to perform router functions. The bulk of code developed as the DD-WRT project is user-land code (aka application code). The features you mention are mostly inherited from using the Linux OS. Bundling application programs with an OS does not elevate that released software to OS status. – sawdust – 2012-05-15T20:30:29.490

1edited the answer to reflect the many points brought up here – Bon Gart – 2012-05-15T21:34:55.417

I'd argue that, to be an OS, the software must provide some degree of resource management and virtualization, and, in particular, task management. But the definition of "operating system" is hopelessly confused by all of the misbegotten pieces of code (such as MS DOS) which misappropriated that title. – Daniel R Hicks – 2012-05-15T21:42:46.730

@DanH But you could allocate IRQs in a BIOS, and change whether an audio header was Intel HD or AC97. That's resource management. And virtualization wasn't present in many earlier OSes. You can control processor and fan usage in a BIOS, which falls under task management (fan always on, or temp dependent) albeit simple task management. So, again, it's not pretty or complex, but it's still an OS. – Bon Gart – 2012-05-15T22:01:40.250

You're not really "allocating" IRQs in BIOS, you're just assigning them. There's no real "management" involved. (But modern BIOSes are closer to operating systems than MS DOS ever was.) And controlling a fan is not "task management" -- "task management" is virtualization of the processor to implement multiple processor images. – Daniel R Hicks – 2012-05-15T22:10:33.747

@BonGart - Probing the hardware and en/disabling HW & features are just configuration chores. CPU clock and fan control are done by the OS in 32- or 64-bit protected-mode code in kernel drivers, and not the 16-bit real-mode code in the BIOS. Resource management implies that there is contention, that is competing users/tasks/threads for limited CPU, memory and I/O resources, and the OS is expected to dynamically allocate these resources. The OS doesn't just provide access to HW; the real job of an OS is to deal with contention for limited resources or provide exclusion. – sawdust – 2012-05-15T22:34:22.550

2

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.

Daniel R Hicks

Posted 2012-05-15T17:00:12.780

Reputation: 5 783

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 – 2012-05-15T22:03:19.250

1There 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". – Daniel R Hicks – 2012-05-15T22:12:18.283

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 – 2012-05-15T22:17:52.773

@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. – Daniel R Hicks – 2012-05-15T23:02:23.477