What is the BIOS and who builds it ?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

What is the BIOS and who builds it ?

Minoshi
[i am just learning so please share your advice  so that i can teach myself and become better. Thank you in advance]

I am trying to build a basic operatiin system to get a deeper understanding of x86-64 platform. All the resourses start from the bootloader part of the code and skip over bios completely. As far as i have can understand BIOS is code written in x86 assembly and is stored in a chip. This code is used to set up the system and check for devices and test them.
My questions are:

1) since different companies use different suppliers for wifi module and hardisk and ethernet card then bios is different for machines that have differnt hardware installed on them ?
eg: macbook use different wifi chip manufacturer than say lenovo does and when these companies change suppliesers they have to modify the hardcoded devicer  driver code in rom chip.

2) Since CPU is the one executing instructions then ARM ISA will have different bios written for it than one in x86 ?

3) How does bios code (assuming bios is aseembly/binary code ) gets copied into RAM so that CPU can execute it. Since x86 cpu puts the address 0x7C00 in it's IP after the power on how does bios code reaches there since cpu is required to do the transfer of data or to instruct the DMA to do the transfer ?
Reply | Threaded
Open this post in threaded view
|

Re: What is the BIOS and who builds it ?

ivant
First of all, I don't think this is the right forum for these questions. This one is dedicated to the https://www.nand2tetris.org related questions. But FWIW here are my answers/comments:


When IBM developed the original IBM PC in the early 1980, they used off-the-shelf hardware, like the Intel 8088 CPU and the accompanying chips. Furthermore, they created the ISA bus standard for plugging devices to the PC and they published the specs. That meant that 3rd party companies could create devices for the PC, such as Ethernet cards, sound cards, etc.

The only proprietary piece in the PC was the BIOS. It contains functions for initializing the hardware, which were called during the boot process. It also contains functions to talk to the hardware, like for example to display a character on the screen (this is in text mode), or to read the keyboard or to give access to the floppy or hard disks. These functions were meant to be used by the operating system and the programs that you run to access the hardware.

The BIOS program resided on a chip, and the code was copyrighted by IBM and was the only thing that prevented other companies from creating PC clones. That is, until Compaq reverse-engineered it and created a legal copy and the first 100% compatible PC clone. Then another company, Phoenix Technologies, also reverse-engineered it, but instead of creating a clone themselves, they started licensing it to other clone-makers.

Even back in the 1980s many programs opted not to use BIOS calls and talk to the hardware directly instead. Bare in mind that the PCs back then were much more "open" in the sense that when you run a program, it had full access to everything on the computer. There were no way for example, for the OS to limit the access to certain parts of the memory. Also, normally you'd run a single program at any given time and it will have full control over the PC while it's running.

In modern computers the BIOS is replaced by UEFI.


To answer your questions:

1. The BIOS provided functions to access the hardware that was present in the IBM PC. It also provided functions to use the ISA bus, so one could communicate with external hardware. But those functions were very low-level and didn't know anything about the specific piece of hardware that you plugged in. For that you'd also need a driver - a library of functions developed by the manufacturer, which allow their hardware to be used. Initially there were no standard for drivers either, so programs often had to have code to work with the most popular hardware. In time, this created de-facto standards, but was a huge PITA for many years, basically until Windows came along.

Macs don't have BIOS. The original Mac used a different CPU and chipset and there was no compatibility between it and the PC. It had a ROM chip with similar function to the BIOS, but it wasn't compatible with it, and it had much more and higher level functionality built in.

2. The BIOS was developed for the original IBM PC, which was using Intel 8088. Later versions of the BIOS were upgraded to use later CPUs but from the same x86 family. So there's no BIOS for ARM CPUs or for Motorola CPUs.

3. It doesn't get copied into RAM. It's on a ROM chip the CPU can access it directly from there.

----

Note that the term BIOS, which stands for Basic Input/Output System predates the PC. It was part of the CP/M operating system, which was the de-facto standard OS for Intel 8080 / Z80 computers. In that context the term refers to the part of the system that was specific for each computer, so when Gary Kildall, the creator of CP/M, needed to port it to another machine, he just needed to port this part.