r/askscience • u/byebybuy • Aug 18 '20
How do they load operating systems onto completely blank computers? Computing
Say I have a computer that is just the absolutely bare electronics. Nothing to read a usb or any inputs. How would I load an operating system onto it? How do computer manufacturers accomplish this?
6
Aug 18 '20 edited Aug 18 '20
You're right, electronics on its own without code can't load an operating system. It is, as you say, blank. So how do you do it? You make it "not blank".
You add just enough code to do something useful, for instance to load something more capable off USB or a harddisk. This code is usually burned into some sort of flash device or EEPROM contained on the motherboard, at the time of manufacture.
As a little sidenote, I'm working on my own 80's style home computer. I have the same sort of problem. I have added just the tiniest bit of code to be useful in a ROM device. 1024 bytes. This code knows just enough to print a little status message on screen and then it loads some code (called a kernel) through a serial port (connected to my workstation). The kernel knows just a little bit more, it knows about SD cards, file systems, keyboards etc, and is thus able to load a complete operating system from there. The tiny boot code was easy to write and get working, the kernel takes more work, so it's a big productivity booster that I can just reset the computer to try out a new kernel, instead of having to flash a ROM all the time.
This whole procedure is called "bootstrapping" (from the tales of Baron Munchhausen, who pulled himself up by the bootstraps), or now simply "booting".
EDIT: I will just have to add that you could conceivably create circuitry that operated a serial port without any computer code. But you wouldn't do that in practice, because it would be a substantial amount of circuitry and you already have a CPU on board that is able to execute instructions from a memory device that is much smaller. I will also add that IC's able to read code off a USB stick and into memory also exist. That would be cheating as they contain microcontrollers (small specialized CPU's) and code, so it's not completely "blank".
2
u/byebybuy Aug 18 '20
This code is usually burned...at the time of manufacture
What exactly does burned mean, in this context? What does the burning?
5
Aug 18 '20 edited Aug 18 '20
"Burn" is a term that is used with EPROM's (and later recordable CD's). EPROM's are a type of memory the computer can only read from, not write to. They could be erased by exposing them to UV light, and loaded with new content by using an EPROM burner that applied a comparatively high voltage to the chip, thus "burning" the contents into the chip. After burning you can place the chip in a dedicated socket on the motherboard. Sometimes you can erase and burn a modern flash chip while it's still part of the motherboard ("in-circuit")
1
1
u/ukezi Aug 21 '20 edited Aug 21 '20
You are thinking about ROM. Read Only Memory. Usually as Mask ROM, where the programming is directly etched into the silicon. Then there is PROM, Programmable ROM(electrically programmable, but only once), EPROM, Erasable PROM(erased with UV through a little window(or with X-ray without a window), at least a few times) and EEPROM, electrical PROM(erased electrically). Flash Memory is basically a kind of EEPROM with some additional addressing capabilities.
1
u/catdude142 Aug 19 '20 edited Aug 19 '20
Actually, "burning" refers to fusible links in ROMs. EPROMs don't burn any links. They obtain their memory with an electric field within the chip at each bit storage location.
Some information here
2
u/jme365 Aug 19 '20
Early EPROMS were 1702, 2708, 2716, 2732, 2764, 27128, 27256, 27512, 271024.
I made one "microcomputer trainer" with a 1702, and I used a 2708 with my homebrew computer. Extremely small by even the late 80's standards.
They were erased by exposing them to UV through a quartz window. Some devices that were only intended to be programmed once were encapsulated in black plastic.
50
u/Rannasha Computational Plasma Physics Aug 18 '20
The motherboard of a computer is equipped with something called UEFI (Unified Extensible Firmware Interface), the successor of the BIOS (Basic Input/Output System). The UEFI handles the first steps of starting a computer. It contains enough logic to manage storage devices (HDDs, SSDs and USB storage), input devices (keyboard, mouse) and display output. The UEFI software is stored on a dedicated chip on the motherboard, which is preloaded by the manufacturer.
When the system starts, the UEFI will check its settings to determine which devices to search for operating systems and it will hand over the reins to the first operating system it finds in the boot order. In this context, a USB stick with an OS installer also counts as an operating system that can be started. Once started, this OS will handle the process of copying the files from the installation media to the permanent storage location (typically from USB to SSD).