What happens if you start a computer without a operating system?
I’m going to answer the question you actually asked and then answer the question I believe you intended to ask. The key point is all computers are made up of a CPU, main memory and an I/O system. Different computers vary in how these components are put together but they all have them. Without software the computer useless itself. Further, generally without an operating system or OS, and other programs that run on top of that OS plus training to use them, the computer is still not very useful and not going to do much for you when you turn it on.
The reality is when you turn on a computer, it is a very expensive bunch of hot rocks and it does not do anything. Nothing, nada.. inanimate, useless, dead, about as much as fun as a ‘brick’ (more in a minute). So, … to make a computer useful you need to a few more things besides just the hardware (the parts):
- a program written in the “instruction set” of that particular CPU;
- a way to get that program into the memory of the computer you have;
- a way to tell the that computer ‘start’ execution of that program; and
- knowledge what to do with when you have it.
So let’s go back a few steps and try map this to modern day Geniune Intel*64 processor or compatible, which is most likely what you just purchased. It turns out someone (most likely a firm originally in Massachusetts called Phoenix’s Technologies, or another in California called American Megatrends, Inc), wrote a few programs for these chips and licenses them. The manufacturer of your motherboard bought licensed copies and the rights to duplicate these programs and put them in a device called a Read Only Memory or ROM. ROM’s have an interesting property of being able to be written at the factory once and then ‘remembering’ the bits that has been programmed within even when the power is removed.
So, the motherboard you purchased contains a ROM that has been factory programmed with those licensed programs and, thus have been inserted into the memory of the computer, so you solved the first 2 missing pieces. And as it turns out, when the motherboard was design special circuits were added that are used at ‘power-on/reset’ to tell the processor to in fact look for a program where that ROM was placed and set the CPU ‘Program Counter’ such that it will begin execution a program using the program in that ROM.
For completeness in my answer, you do not need a ROM, and frankly for those of us of a certain age, we did not used to use computers with ROM’s in them (ROM’s had not been invented or were very expensive in those days). So how did the “initial program” appear in the computer’s memory. In the old days, we had toggle switches on the front on the computer and loaded the “initial boot loader program” into memory, which typically was a simple program that knew how to read a block or two of memory from an I/O device, which had on it another programmer, that could do more, etc. This was called ‘booting’ the computer because it was similar to a climber going up a rope using his bootstraps. It was very slow and a tad tedious.
The truth is that you could do the same thing today if you replaced the ROM with some way to insert a program into the main memory, just as we did in the 60s and 70s. Since modern computers lack toggle switches and a ‘console’ like the old systems, you need to figure some way to get load up the first program (i.e. solve step 2).
Anyway, starting with computers being built in the late 70s, boot ROM’s became standard such as as you have today. The contents of that ROM in a modern computer has a name (i.e. the software programs inside). It is called the BIOS or Basic I/O System for the computer. Although, if you are using an Intel*64 or compatible, it is most like in the key of UEFI or Unified Extensible Firmware Interface [the differences are beyond the scope of this answer]. But the point is that contents of ROM are programs that are written, license and supplied with the motherboard and executed at CPU turn on.
So now comes the question you intended to ask. The problem is that is probably the computer as configured is not going to be useful to you. You could replace the contents of ROM yourself and program the HW raw and use the computer hardware directly. Chances are if you try that, you will have another ‘brick’ when you are done. In fact, the process of trying to develop and load new firmware on devices you will hear or see the term ‘bricking’ the computer - which is refering to that process.
That said, very experienced programmers, often with other tools, such as the programmers at Phoenix or at Intel themselves, this is exactly what they are doing. But that probably not what you want to do… you are more likely want to use the ROM’s you have to load an operating system (OS) and then to run programs that run on top it. So …
- you need to supply an OS;
- you need to store it somewhere; and
- you need to load it into memory from some place.
Many people use a Microsoft flavor of an OS and for that you will need to go to the usual places. It used to be the you purchased it from them, although frankly I’m not sure if that is still possible. Please check with Amazon, NewEgg or the like. Frankly, I’m one of the original UNIX authors so I’m not even sure how you do that, as I do not run what is often referred to as ‘Winders’ by my peers. Similarly, Mac OS can also be obtained from Apple if you have proper licenses and accounts, although I believe that you will need an Apple System to download it to start - so you need to look around (google is your friend) if you want to build a so called “Hackintosh” assuming you have the proper HW. And I caution that the legality of running Apple’s OS on anything but Apple HW is questionable, so I’m not telling you to do that, only that it is possible. I personally would recommend a current modern UNIX implementation such as FreeBSD or Linux - again google is your friend if you want the details of how but again the scope is beyond this answer - I’m trying to explain what would/could happen.
So I am going to assume you have an OS to run such a FreeBSD, Linux, Mac OSX, Winders or the like to answer the rest of the question. The question now is where do you store the OS and how do you load it into the computer?
The OS must be stored on an I/O device, traditionally this has been a local disk or tape or floppy drive. It does not have to be. Today’s ROMs can boot from the network using a protocol called ‘PXE’ or the Pre-Boot Execution Environment, which Intel defined a few years ago as a way to standardize network booting of Intel compatible based systems (FWIW Apple uses its own scheme which is similar called NetBoot).
In all cases, local or remote booting, the OS (which is a program) is stored somewhere on some I/O device. The ROM on your motherboard starts the execution of the CPU on power-on reset. This configures the processor, brings in the boot loader, after some steps which I’m going to skip (because each OS tends to do it a little different), eventually the OS itself is placed in memory and the CPU’s PC is set to start to execute it.
Depending on the specific OS that you are using, at some point that OS will execute a program that performs I/O to devices that interface somehow with the human user, probably either through the display and keyboard or via the network. Eventually, the OS will be instructed to execute a program at the behest of the human user, we usually refer to this as execution of a command. Now the computer is doing something ‘useful’ - i.e. running programs directly for you.
So ….
- the point is somebody wrote programs for the computer.
- They somehow got stored somewhere for you.
- You (as the human user) somehow asked that they be run for you and,
- they were somehow loaded into memory for you.
- The computer itself was just a very expensive, but hot rock. Just a brick.
- Without software, it was not possible for it to be useful.
- And finally it took some training and knowledge to learn to interface with it, get it actually do something for you that was useful. Be it play a game, edit a spreadsheet, or develop another program.
Edited 6/29 to fix a few typo’s and clarify some sentences.
No comments: