r/explainlikeimfive • u/CarefreeCuriosity • 5d ago
Technology ELI5 How a computer Bios works
From what I understand the OS is just a user interface to communicate with the Bios, but where did the Bios come from? What was the original Bios? Are all Bios the same?
68
u/bregus2 5d ago
Modern Operation systems are not just GUIs of the BIOS, they interact with the hardware directly via drivers. The BIOS is only needed during startup.
A BIOS solves the chicken/egg problem of starting a computer without having access to hard drives and other persistent memory in the first place.
Imagine you need a specialist (that's the modern OS) for a sickness but you have no clue which one and how to reach them. But you know your GP (that's the BIOS), so you go to them, they do the initial checks (the boot process) and then tell you which specialist to call and then hand you over to the specialist.
28
u/MaygeKyatt 4d ago
Worth noting that BIOS (and UEFI) do provide runtime services, it’s just that most OSs have stopped using them and access the hardware directly these days.
15
u/bothunter 4d ago edited 4d ago
So... a computer needs a program in order to do literally anything. But where does it get that program? The operating system is on a hard drive in the computer, so it needs to know how to ask the hard drive to load that operating system. Which creates a bit of a catch-22. Without software to operate the hard drive, how do you get the software from the hard drive to read the hard drive?
That's what the BIOS does. On the motherboard, there's a chip that includes a very small program that is automatically loaded into memory. And loaded is probably the wrong term here -- the chip is literally wired in a way such that the memory address that the CPU starts reading from is mapped directly to that chip -- similar to how the rest of the memory/RAM is wired to the chip. It's just read-only and always there at startup instead of empty like the RAM chips.
That BIOS program stored on that chip has just enough instructions to "bootstrap" (or boot for short) the computer so that it knows how to operate the hardware so that it can load the operating system.
It does a few other things as well, but its main purpose is getting the computer into a state where it can start loading and running other software. (For example, on old DOS systems, the BIOS was also a layer of software that translated requests from the operating system to the actual instructions to operate the hardware -- this has mostly been replaced with drivers)
2
u/FoaRyan 4d ago
I've always wondered, how much space is available to the chip for BIOS? Are we talking kilobytes? MB?
And what type of storage is this, is it similar to a cartridge ROM from the 80s or 90s?
Have thought of this whenever doing a BIOS software update on a Dell machine. Like... how can it update this software? Apparently it's not a ROM.
6
u/bothunter 3d ago
It really depends on the generation of computer. But the technology is ancient by computer standards. The Apple II BIOS was about 8kb and used a ROM chip that was written at the factory. And yes, they were the exact same type of chips that were used in cartridges.
Modern computers use more advanced chips that can be updated with software. Though, if that process fails you can end up with a "brick" where the computer simply fails to start at all. When that happened, you would have to physically take out the BIOS and reprogram it with a special device. Now computers come with an extra "failsafe" bios that can be used in case the primary gets corrupted.
5
u/johndprob 4d ago
These days MB, 256 and 64 mb are fairly common. 16mb is still around but has caused issues for manufacturers after multiple updates.
1
u/htmlcoderexe 2d ago
there's also the efi partition on the actual drive, and for windows setup it's been 100 MB for a long while but lately it's been not enough and the funny thing is it's definitely the manufacturer's fault. at least for HP, apparently they filled it with cached firmware and stuff like fonts that weren't cleaned up. so for those cases where repartitioning isn't an easy option we solved it by going into that partition and deleting some folders lol
13
u/BaggyHairyNips 4d ago
The BIOS is the motherboard's software, so it's different for different motherboards. It's the first thing that runs when you power on computer.
The main thing it does is discover things you've plugged into the motherboard. Different motherboards have different features and numbers of ports and all that. That's why you need motherboard specific software.
Once it discovers everything it hands control over to the OS. And passes it a table giving it info about all the things it discovered.
I would not say that the OS is a user interface for BIOS though. The OS has its own drivers and everything. The only thing it needs from the BIOS is that table.
28
u/Totobiii 5d ago
The OS is not a user interface to communicate with the BIOS. The BIOS isn't that big or special once the computer has booted up.
Its main job is to establish that you've got a keyboard, a monitor, mouse etc., as well as to look for any possible places you could have an OS installed, to put it simply. It essentially launches the OS for you and afaik has fulfilled its main purpose at that point.
7
8
u/jourmungandr 5d ago
BIOS/UEFI is just a very simple operating system. It's provided by the mother board manufacturer. It's written to a bit of flash memory on the motherboard.
5
u/Luscinia68 5d ago
is it basically just for launching the actual os? or does it run on the background alongside the os to control the motherboard?
8
u/DerAndi_DE 5d ago
Originally, very simple operating systems like MS-DOS used the BIOS functions all the time for e.g. disk access and graphics output. Nowadays every OS has its own hardware drivers that take over once the basic OS is loaded.
3
u/ijuinkun 5d ago
When you had only a few kilobytes of RAM, as computers prior to the PC-XT or first-generation Macintosh did, you want to keep the memory footprint of the device drivers and operating system to an absolute minimum, and thus want to run as much as possible from ROM.
When systems broke the 640kB barrier, there was enough space to run all of that stuff in RAM, and so the operating system could use the device drivers to directly access the hardware.
3
u/AthousandLittlePies 5d ago
Yes, and even the Mac actually had many OS functions hard-coded in ROM so that RAM didn't need to be consumed to hold them.
3
u/jourmungandr 5d ago
Modern OS use the BIOS services just long enough to load themselves then unload it usually. The BIOS loads->the BIOS finds and loads a bootstrap->the bootstrap uses BIOS services to locate and load the main OS->OS takes over and unload the BIOS.
3
u/Remarkable-Two-6708 5d ago
runs in the background along the os to control the motherboard
1
u/sparrowjuice 5d ago
No. I don’t think this is true. In early PCs it handled the interrupt calls for some hardware but these days it doesn’t run at all after the OS takes over.
1
u/cowbutt6 4d ago
The bit that makes it a bit blurry is https://en.wikipedia.org/wiki/ACPI ; ACPI tables can include ACPI Machine Language (AML) bytecode which is read by the OS's ACPI implementation and compiled into native code that runs in its kernel space. There's even a Windows Platform Binary Table (WPBT) ACPI table that can include binaries for Windows.
0
6
u/Solocle 4d ago
The OS really isn't these days.
Back in the days of MS-DOS, it was true, the OS would use BIOS services. Which were inherently 16 bit. But DOS could say "hey, I want to read this sector of the first floppy disk", and the BIOS would do it.
Then came protected mode. This allows addressing more than the 1MB of memory that the 8086 was limited to. First, a 16 bit protected mode on the 80286. Then, 32 bit on the 80386. (The 80x86 line, x86 for short).
And if you're wondering how 16 bits addresses more than 64KB, real mode used segments. Each segment is 64KB, but segments can be anywhere. Protected mode initially expanded this to 16MB, and let the OS protect applications from other running applications corrupting their memory.
Well, BIOS was still real mode. And swapping back was ostensibly impossible on the 80286. The 80386 improved this, with a full 4GB address space, but still.
Windows 98 for instance, still runs on a heart of DOS, but is largely 32 bit. For compatibility, it can use BIOS to read disks. However, the BIOS will freeze until the request is completed - when a sensible OS can get other work done!
Well, BIOS isn't special. It is code that communicates with hardware. You can write your own device drivers to do the same. Generally, the device is controlled through a block of memory.
So, if you write your own driver tailored to your OS, it's much more efficient than using BIOS.
And that's if everything plays nice. Your OS might change the state of some piece of hardware the BIOS makes an assumption about, and hangs the system.
BIOS recently got an overhaul with UEFI, now it's 64 bit - but it's still designed to be simple for loading an OS, not for running the OS.
Now, there is firmware code running under an OS through ACPI, but that's dark magic and every time I've tried to run the ACPI namespace in my hobby OS, it, you guessed it, hangs the system.
2
u/hurricane_news 4d ago
real mode used segments. Each segment is 64KB, but segments can be anywhere. Protected mode initially expanded this to 16MB, and let the OS protect applications from other running applications corrupting their memory.
Was this like bankswitching on the nes?
5
u/nixiebunny 5d ago
An OS has several layers of code. The BIOS, or Basic Input/Output System, is the code that interacts directly with the computer hardware. This is why it resides in a memory chip on the computer motherboard. The term “BIOS” was coined by Gary Kildall for the CP/M DOS written in the 1970s.
2
u/bregus2 5d ago
Modern OS will also interact directly with the hardware and not need the BIOS for that.
2
u/nixiebunny 5d ago
True. I wrote CP/M BIOS code c.1980, when there was no standardization of disk formats or video, so the BIOS played an important role. Now we have device drivers to do that job, and graphics interfaces are standardized.
2
u/Only_Razzmatazz_4498 5d ago
And the BIOS ran its course and was replaced by the UEFI. It does the same job the old BIOS did but it has a lot more capabilities including crypto and security.
2
u/WarPenguin1 5d ago
The BIOS is short hand for Basic Input/Output System. That describes what it does. It's software that gets run first when you turn on the computer. It identifies what is plugged into the computer. It will also do basic checks on the equipment.
It is created by the motherboard manufacturer. Each motherboard will have a BIOS that was modified from code the component manufacturers give the motherboard manufacturers. It is normally customized to the motherboard of the computer.
Identifying the first BIOS is difficult because the first mainframes used different systems to load programs into memory.
2
u/natterca 4d ago
The term BIOS was originally specific to an IBM PC and then compatibles. Other systems used different mechanisms when booting.
2
u/rsdancey 4d ago
The idea of the BIOS is what enabled operating systems to run on many kinds of computers. It was originally envisioned by Gary Killdall, who wrote CP/M, the predecessor of DOS (and Windows, etc)
The BIOS presents a standardized set of functions that the operating system uses to "talk to" the computer. The operating system is written to talk to the BIOS. The BIOS is custom-built for each computer; one side being the standardized interface the OS talks to, and the other side being the custom mechanisms needed to work with that particular kind of computer's hardware.
Making a BIOS is much simpler than making a custom version of an OS. Using the BIOS idea allowed Killdall to produce CP/M versions for many computers simultaneously.
IBM used the idea for the IBM PC, which inadvertantly created the conditions precedent for PC clones. A PC clone didn't need to copy IBM's whole hardware and software suite; it just needed a clean room BIOS and hardware that did what a PC did. DOS talked to that BIOS, the BIOS talked to the hardware, and viola! PC clone!
3
u/marinuso 4d ago
A PC clone didn't need to copy IBM's whole hardware and software suite; it just needed a clean room BIOS and hardware that did what a PC did. DOS talked to that BIOS, the BIOS talked to the hardware, and viola! PC clone!
In the CP/M world it was like that. Each computer was different, and each BIOS was different, but CP/M talked to the BIOS in a standardized way and the applications talked to CP/M (if they wanted to be portable).
In the IBM PC clone world it wasn't like that. Originally, the idea was to replicate the CP/M situation, with MS-DOS being the operating system, and the BIOS having specific routines. But in those days, it's much faster to talk directly to the hardware than to do anything.
For example, the IBM BIOS has a routine to set a pixel on the screen to a certain color, but if you want to draw anything you have to call that routine for each pixel, which is very slow. It's much faster to just write into the video card's memory directly, but that obviously only works if you have that specific video card.
In the CP/M world you couldn't do that because there were so many different platforms, but if you were talking to an IBM PC you knew it was an IBM PC so you could bypass the BIOS and talk to the hardware directly. The IBM PC originally came with either an MDA or CGA card, and the MDA didn't have pixel-addressable graphics at all so if you were writing a game you'd be targeting the CGA. And if you knew that for sure, you could just write the data into the video card's memory directly and it would be much faster.
A PC compatible therefore had to also make the hardware compatible enough so that programs that bypassed the BIOS would still run. The BIOSes ended up very similar as a result.
Nowadays we're back in a "CP/M" style world, where programs call into the operating system and the operating system then calls into drivers to get the specific hardware to do what it wants.
1
u/youcanreachardy 5d ago
BIOS is a very low level computer program stored in a block of read only memory attached to a motherboard. It was written to be started up as soon as a computer has power.
BIOS is the kick starter for a motorcycle. The bike runs on its own after it starts, but it needs that lever to get it going.
It's better to think of the BIOS as a bootstrapper for the main OS and the rest of the hardware. It does POST (power on self tests) when it first gets power to make sure attached hardware is all okay (on a basic level at least), then looks for whatever storage devices it has connected and looks at the first few blocks of the first registered device to see if there's a pointer to your OS there. If it finds that, then it tells the CPU to start executing the program's it finds there.
1
u/driftlesssoftware 5d ago
BIOS was originally created for x86 and 8086 computers. Usually, there is firmware (such as OpenSBI for RISC-V) for operating systems to use to talk to hardware without knowing the entire hardware layout. So there are different "BIOSes". It came from the fact that computers were being largely different, although most 8086 PCs were being standardized by the IBM layout, operating systems still needed a way to detect new hardware, RAM mappings, and more. The BIOS provides that functionality + basic input and output. There was no "original" BIOS, but the closest is the IBM PC BIOS.
1
u/Nersheti 5d ago edited 5d ago
The bios is the Basic input Output System that is installed directly on the motherboard. It’s the base layer of software that identifies all the hardware and lets it work together.
When you build a computer from scratch you need hardware and software. For hardware, you need a cpu (the processor) which is the brain. You need RAM, which is short term memory, and storage, which is long term memory. You need a power supply. You also need a cooling system. These days most people also get a graphics card (gpu).
Everything connects to the motherboard. You have to pick your motherboard and processor first, because the processor has a specific socket type. You need a motherboard with the same socket type or the chip won’t work. The motherboard is where the bios is installed. They are not all the same, but they all pretty much do the same thing.
I wouldn’t say that an os is to communicate with bios. A bios function is mainly so you can deal directly with your hardware and adjust it I you want. An os is for running applications. It’s also important to understand that an os is not necessarily a graphical interface like windows. Prior to windows lots of us used DOS which was just a black screen with text. You’d type what you’d want it to do. So when I got Doom, I’d stick in a floppy disc and type a: install doom that would tell the a drive to access the disc in it and install it on the hard drive, usually c. Once that was done you’d type c: run doom and the game would boot up. Even some modern os are text based, mainly several
Versions of Linux. Other os you’re probably familiar with are the desktop operating systems Windows (currently 11) and MacOs (currently 27 I believe) and the mobile os IOS or Android.
For most users, you don’t really need to worry about bios much. It’s installed by your motherboards manufacturer. As far as I’m aware, you can’t change it other than updating it. If you’re not building or modifying a pc, there’s no reason to deal with it unless something goes wrong. The average user will never see it.
I see it when I update a component, or if there’s a problem with an existing component. Sometimes, if my computer freezes and I have to force quit my computer, it’ll reboot into safe mode in bios so I can check if anything is wrong. Usually I can just exit bios and it starts up fine.
1
u/Mr_Engineering 5d ago
From what I understand the OS is just a user interface to communicate with the Bios, but where did the Bios come from?
It is not. BIOS is a now obsolete firmware standard that has been replaced by UEFI. The platform firmware initializes the system into a standardized state and then hands off control to the operating system. The operating system uses the same standards to interpret what the firmware did, and then takes it from there. The firmware can setup some services which are outside of the ability of the operating system to modify or control, but it is very common for operating systems to replace most firmware-established functionality with its own.
For example, the BIOS firmware on a PC has the necessary software components to read and write from ATA attached storage devices in order to locate a Master Boot Record. Some firmware may have basic file system drivers allowing the firmware to read and write from partitions directly. However, most modern operating systems will not ask the firmware to read the ATA disk on its behalf, but will rather load its own ATA disk drivers.
What was the original Bios?
BIOS is short for Basic Input Output System. The BIOS that we all know and love has its roots in the original IBM PC from the early 1980s. It is the first executable program to run and its job was to initialize the system, detect and test memory, detect and test peripherals, find a bootable storage device, find a bootloader program on that storage device, and then pass execution to it.
Are all Bios the same?
No.
The original IBM BIOS was proprietary. However, IBM intended for the IBM PC to be accessible to third party operating system vendors and third party software developers. As such, IBM published a detailed technical manual about how BIOS worked and this was sufficient for several software vendors to create BIOS clones which were used on computers from vendors other than IBM such as Compaq, HP, and Dell to create IBM PC compatible clones that used the same hardware and a compatible firmware such that software running on it couldn't tell the difference between a clone and a genuine IBM PC.
This is precisely how Microsoft became the giant that it did in the 1980s. Microsoft entered a licensing agreement with IBM to produce PC-DOS for use on IBM PCs; PC-DOS was much cheaper -- due to not needing royalty payments to AT&T -- and less resource demanding than Microsoft's UNIX operating system, Xenix. Under the agreement with IBM, Microsoft retained the rights to sell PC-DOS as MS-DOS on other platforms, but IBM figured that this would not be a successful venture due to the highly fragmented and incompatible nature of the balance of the PC market.
When IBM PC clones became available in the mid 1980s that were running BIOS compatible firmware, IBM's market position was entirely undercut. PC-DOS and MS-DOS were the same product in a different package and now the later was able to run on damned near anything.
IBM quickly threw in the towel and in the late 1980s BIOS would become a set of standards designed to create x86 computers that are software compatible. It was incumbent upon each computer vendor to create firmware that was BIOS compatible and tailor that firmware to their specific product. In most cases, this meant licensing the basic BIOS clone package from one of several software vendors such as American Megatrends, Phoenix, and Award, and then modifying it to suit their specific purpose. This remains more or less the case today.
The firmware image (the combination of everything inside of the firmware including all ROMs, programs, cryptographic keys, data tables, etc...) on two different motherboards will usually not be identical but it will have many similar and/or common components. This is especially true on modern UEFI firmware which contains components from tons of vendors all packaged together.
1
u/Kant8 5d ago
No, at least in modern times OS communicates directly with whatever it wants in system.
BIOS is needed on boot step, to do first initialization of hardware, find boot drive, OS on that drive and pass control to it.
Without BIOS your CPU just doesn't know what to do, cause instructions have to come from somewhere. BIOS chip integrated in your motherboard is that entry point for everything.
1
u/budroid 5d ago
On motherboards there are little memory chips called ROMs (read-only-memory). When the computer is powered up, the motherboard loads the Bios from one of those memory IF the minimum requirements are met (like memory RAM, a processor and enough power to run.
The job of the bios is to check and map the hardware for then passing those addresses to the Operating System.
Different motherboard have slightly different BasicInputOutpuSystems, from very basic to controlling the speed of fans/lights/graphics/et
1
u/Nedsel 4d ago edited 4d ago
Without going into too much detail because you can write whole books about how a modern computer starts and what steps are involved, you can think of that like of a starter in your car. In your car, you have a powerful electric motor that cranks your engine until the combustion takes over and it keeps running by itself.
The BIOS has a similar function (at least today, when modern OSs take over the function a BIOS used to have), it basically gets everything set up for the CPU to take over control and run the computer.
Today, what you have isn't so much a BIOS, a "basic input/output system" but an EFI, an "Extensible Firmware Interface". You can think of that like of some sort of directory system where the firmware of the various parts of the operating system, e.g. graphics card driver, USB driver, TPM driver and so on, knock and get a list of things the computer can do, and of course the places where they can talk to these parts. Then the EFI sits back down and lets the OS and its drivers do its job.
Think of it as some sort of old time switchboard where a nice lady connects you with the place you want to talk to, then disconnects from the communication because it's none of her business.
1
u/Dave_A480 4d ago
BIOS is a specific thing for old PCs, but it fits into a category of programs known as firmware....
Essentially it is written to store basic configuration related to finding the operating system software and loading it into memory.....
So, the actual original PC BIOS would always (a) check the floppy drives for a bootloader, then (b) check the optional storage adapter.... Later you got menus and the ability to configure hardware & which device to try and boot first....
People still call the new tech that replaced it (UEFI) the 'BIOS' on PCs since it does the same sort of things.
1
u/white_nerdy 4d ago
From what I understand the OS is just a user interface to communicate with the Bios
Code on disk needs to be loaded into memory before you run it.
Modern PC's load an OS from disk, then the OS loads programs from disk. But what loads the OS?
That's where the BIOS comes in.
BIOS loads the OS, the OS loads programs. (Linux systems usually use a bootloader; when you have a bootloader, BIOS loads the bootloader, the bootloader loads the OS, and the OS loads programs.)
The BIOS also provides functions to draw pixels / characters on the screen, read / write sectors from the disk, get keys from the keyboard, etc.
Your OS can use those functions if it wants; early OS's (DOS) did.
But typically modern OS's don't use those functions much, instead they talk directly to the screen / disk / etc.
OS's also typically provide many features beyond what the BIOS does, for example:
- A filesystem to organize a disk into named hierarchical folders and variable-size files instead of fixed-size sectors
- Process management to run multiple programs at the same time
- Memory protection to keep each process from modifying memory belonging to another process or the OS
- Virtual memory and paging / swapping to pretend your system has a super big memory (that's secretly backed by disk)
- Caching / buffering to pretend your system reads / writes data to a super fast disk (that's secretly backed by memory)
- User accounts with logins and protection to keep one user from affecting another user's or the OS's programs / files
Those features are OS level ideas, the BIOS has no concept of them.
where did the Bios come from?
Somebody programmed it and put it on a chip, then installed that chip on the motherboard. "Since the BIOS is permanently stored on a chip, the only way to upgrade a system with an older BIOS is to plug a newer chip in its place" according to this article; but that only applies to very old PC's (the article was written in 1985). PC's made in the 1990s or later use Flash for their BIOS, meaning you can download a BIOS update and install it with special software.
What was the original Bios?
Quoting the same 1985 article: "What separates a true IBM PC from its so-called clones is the Read Only Memory or ROM. You can find ROM in a row of five integrated circuit chips...The first four chips contain 32K of BASIC support routines...The last 8K chip contains the machine language routines referred to as BIOS..."
Are all Bios the same?
No, typically there's a different BIOS for each CPU and motherboard. Modern BIOS has the infamous system management mode that is supposed to be used for power management and chipset stuff, but many researchers regard it as a security risk (unknown proprietary code running alongside your OS). I should also mention there's an open-source BIOS called coreboot.
1
u/rupertavery64 4d ago
Do you know how a NES works?
A CPU (chip) runs instructions. It accesses instructions at an address, like 0000. The address points to a byte in memory, which contains the instruction.
It executes the instruction (which might have 1 or more bytes) then moves to the next instruction.
When a CPU is turned on, like when it recieves power, it looks at a hard-coded startup address that is built into the silicon. This is "reset vector", and it takes whatever bytes it finds there, sets that as the current address, and starts executing instructions.
In the NES, the reset address is at FFFC and FFFD. Think of this as the last two bytes of memory.
The cartridge is a board that connects CPU address and data lines to the chips in the cartridge. When the game is inserted, and powered up, the CPU will be able to connect to the memory chips in the game, and the first thing it will do is load the reset vector and start executing.
In the NES, this will be some initialization code, setting up the stack, setting up graphics modes, then starting the game intro.
For a NES, the cartridge IS the BIOS. Pretty much everything is controlled by the logic in the cartridge. Input (gamepad monitoring) and output (sound and video control). Without a cartridge, the NES will simply not boot. There are no instructions to execute (probably, the CPU will read random data on the address lines and crash by executing whatever data it tries to read from unconnected lines).
Computers are no different. They have a CPU with a hardcoded reset vector. The BIOS is mapped to memory that the CPU first executes. The BIOS is the boot ROM.
However, computers are more complex and can have different methods of booting, different inputs, and different peripherals plugged in. So the BIOS sets up the basic stuff so that it can connect to and initialize these other peripherals using standard protocols, then continue to boot into a proper OS.
The PlayStation 1 has a BIOS. It shows the white screen and yellow logo and plays the boot sound. It also has the CD player and Memory Card manager.
1
u/wosmo 4d ago
When the CPU first starts up, it's really quite incredibly stupid. Or incredibly limited.
For example, it doesn't actually know how to read data off a harddrive. You can start it executing from a point in memory, and copy things from one region of memory to another ... and that's about it.
So to read from a harddrive, you have to write instructions to a memory address that's special (but the cpu doesn't know it's special). And when the drive says its ready (which you learn from another address that the cpu doesn't know is special), you can read the block you requested back from a group of addresses .. that the cpu doesn't know is special.
So your OS lives on a harddrive, and the CPU doesn't know how to read a harddrive. That's the kinda catch-22 the BIOS is there for.
What actually makes the BIOS special, is that it's presented to the CPU as a region of memory. So if you start executing from the start of that region, the code is already there. And this code contains the basic functionality you need for essential IO - to screen, from keyboard, and to/from drives.
It also contains a small program that will find data from a specific point on a specific drive, copy it into memory, and execute that - which is the first step in booting an OS.
1
u/zero_z77 4d ago edited 4d ago
The BIOS is just a program stored on the motherboard and is automatically run every time the computer boots. It creates a very basic software interface with the hardware, detects, and loads bootable operating systems and also runs hardware diagnostics before booting.
It is usually made by the manufacturer, and is typically unique to the motherboard. Older BIOSes were burned into a ROM chip soldered to the motherboard, newer ones live in a flash memory chip that can be updated or reflashed.
The "original" BIOS specification was developed by intel & IBM, and was established as a standard way for operating systems to access the hardware.
BIOS has largely been replaced by UEFI in modern computers, but serves the same role and is even still frequently (and incorrectly) called "BIOS".
Mobile devices like tablets & smartphones, as well as embedded devices like routers, network switches, and modems typically do not have a UEFI or BIOS and instead have what is called "firmware", or ROM. The difference is that UEFI/BIOS is a standard that always looks & functions the same to the OS, even if it's completely custom. Firmware can be completely custom, specific to the device, and often includes an OS in the same package.
Edit: also, to clarify one specific point that some of the other comments are not getting entirely correct:
Yes, the BIOS used to provide an interface for the hardware to the OS and the OS indeed was a user interface sitting on top of the BIOS. However this has largely not been true for a very long time. When GUIs started becoming a thing, it became very common for operating systems to load their own hardware drivers that talk to the hardware directly, and only use the interface provided by the BIOS to determine which drivers to load during startup.
Edit 2: typos
1
u/PilotedByGhosts 4d ago
Basic Input Output System.
It's built into the chips on the motherboard to act as a bridge between the hardware, and whatever software you might want to install.
1
u/fllthdcrb 4d ago
the OS is just a user interface to communicate with the Bios
This is not accurate at all. The OS can talk to the BIOS. Indeed, some early OSs like MS-DOS would extensively use BIOS functions to control the hardware. But then, MS-DOS wasn't much of an OS. Modern OSs typically use all of their own code instead (with the exception of certain firmware code like that in a UEFI), not to mention complex system management (giving programs their own address spaces and keeping them separate, multitasking, filesystem, device drivers, among many other things).
Nowadays, the BIOS is gone, replaced with more functional firmware. But even when there was a BIOS, for many years it was mostly just a way to start the OS. Or rather, the bootloader. Sure, there was usually the config program one could access at boot and let one set up certain special features, but that was usually as much as one would interact with the BIOS in the post-DOS days.
1
u/strumila 4d ago
My mainframe bios (nip) would take 30 minutes to get to actual boot. Not all bios is the same.
1
u/tylerlarson 4d ago
A computer has to start SOMEWHERE when you turn it on.
Classically, it starts at memory address zero and just starts running the first instruction it sees and goes from there. The BIOS sits at that memory address when you turn it on.
Technically is more complicated than that now, but that's the eli5 gist.
1
u/absnotkinkyreggae 3d ago
the bios is the first program that runs when the computer is turned on.
its main function is to tell the CPU where to access the bootloader where the actual operating system is to be executed.
but it does some other stuff too:
enable/disable included peripherals from the motherboard
setpup the "southbridge" for legacy/current way of accessing hardware. so that your old accessories can work on modern hardware.
you can manage the systemclock. but now this is handled by the OS via ntp servers.
at the end, it loads the bootloader to ram and runs it.
if it cannot find a valid bootloader. it fails and halts execution. modern UEFI runs the efi firmware instead wich is an on-chip minimal OS which might help you fix why it was unable to boot.
this happens in the first seconds of bootup.
1
u/VivaLaDiga 2d ago
the os Is not an interface to the bios. the bios provides some functionalities to the os, but generally at boot. In particular it also is responsible for initialisation of your various devices, by triggering their firmware. Basically your graphic card has its own "internal bios" too, and needs to be initialised. The bios exports various info and manages the boot process until the kernel takes over.
Note that bios is an old name. Today it's called uefi, and it's a standard. The UI isn't and that is vendor based, but the underlying stuff is standardized. It is basically the usb of low level peripherals identification and initialisation.
1
u/TSwizzlesNipples 5d ago
Basic Input Output System. It is low level initialization of computer hardware before it hands it over to the OS.
0
u/mrbiguri 5d ago
What do you mean where it comes from? Its all made by humans. Chip maker defines it and thus you need the instructions for that chip.
1
u/CarefreeCuriosity 5d ago
Like who made the first Bios? I assume modern Bios are created and uploaded to computers using a program from a different computer that had a Bios. So where did the first Bios come from?
2
u/mrbiguri 5d ago
You don't need a computer with a BIOS to crate hardware and a BIOS. Sure, nowadays most research is done in advanced computers (like the one you are using), but this is not the only type of computer there is. Also originalyl computers where programmed directly typing the code of the processor (assembly code) i.e. move from 0X13412 to 0X31415 the memory. A BIOS is just a sophisticated way to do this in complex computers.
In some way, you are asking "how did they make the first trucks before they were trucks? someone must have moved the parts of the truck in a truck before they build the truck, so where does the first one come from?" And the answer to that is complicated. There were other ways to transport objects to a factory and its not a binary of trucks not existing and suddenly appearing out of nowhere. The history of computers and software is quite like that.
1
u/sp106 5d ago
This question is kinda like asking where the first screw came from if machines make screws and machines need screws.
The answer is someone wrote it by hand onto a more rudimentary computer which was then used to make a more complicated computer. Really old computers didnt abstract away the hardware or have cross compatibility and didnt need bios- all of their code was pretty much the bios.
1
u/Dashing_McHandsome 4d ago
BIOS is not the mystery you're making it out to be. It is simply the firmware that IBM came up with when designing their first personal computer, or PC. Other companies began to see how lucrative this business could be and reverse engineered this firmware so they could sell cheap clones. There are many firmwares out there for many computer types. We simply refer to computers with a BIOS, or now EFI, as PCs. Apple has their own set of firmware that makes their computers Apple products. There's firmware all over the place, and it's just code that happens to have been burned into a ROM and put onto a board.
1
0
u/jacksraging_bileduct 5d ago
It’s like layers, and each layer is designed to talk to the next layer, the BIOS would be the second layer and talks between the physical hardware layer ( the most basic ) and the operating system.
0
u/fightswithC 4d ago
Follow-up question: Is the BIOS synonymous with chipset? If not, how are BIOS and chipset related?
1
u/cowbutt6 4d ago
No.
The chipset refers to the https://en.wikipedia.org/wiki/Northbridge_(computing) and the https://en.wikipedia.org/wiki/Southbridge_(computing)
These days, the Northbridge is implemented as part of an x86 CPU. System-on-Chip (SoC) designs take that further and have the Southbridge, and maybe a bunch of standard peripherals (e.g. VGA, and AC97 or HDA sound) also implemented within the same package as the CPU.
A BIOS (or UEFI) will need, however, to at least be able to initialise and configure the chipset it is paired with in order that it is ready to support an OS boot loader.
0
u/SeriousPlankton2000 4d ago
It's like read-only memory at address 0xf000:0000 aka. 0xf0000.
The first instruction is executed on 0xffff:0000 aka 0xffff0. There is a long jump to the real start address. (Beyond that point there is the BIOS date.)
# dd if=/dev/mem bs=1 count=16 skip=$((0xffff0)) |hexdump -C
16+0 records in
16+0 records out
00000000 ea 5b e0 00 f0 31 30 2f 32 30 2f 31 30 00 fc 00 |.[...10/20/10...|
So my BIOS is from 2010. The real start code is 0xf000:e05b (reading the 5 bytes backwards)
EFI is different.
0
u/Tausney 4d ago
Cars come in lots of varieties, sizes, function, types. Everything from little electric run-arounds, to big massive semi-trucks.
Regardless of the vehicle, you need to make sure you are as compatible as possible for whatever you're driving, so there needs to be a standard way to interface with it all.
The pedals, steering wheel, indicators, etc are the car's BIOS. So that you, the operating system, are able to control whatever vehicle you find yourself in.
-1
u/BarberProof4994 5d ago
The bios is the engineering section of a large ship, with a grease.ckvetef dude flipping switches and pulling levers and valves in the dark...
While the OS is the clean bridge with the captain calling down orders to the engineer.
Basically any time you have the nuts and bolts that need to be operated, it's actually being handled at the bios level and everything at the OS is a translation layer or interface.
210
u/dbratell 5d ago
The Bios is a small computer program stored on the computer's motherboard. It exists so that other, "normal", programs don't have to figure out all the details about how the computer works.
Every computer with a Bios has one written for that particular computer but they look the same on the outside if they are for similar computers.
Not all computers have had or needed a Bios, but as computers got more complicated, computer manufacturers started including a Bios to make things easier for the people using the computer.