Search code examples
operating-systembiososdevfirmwareuefi

Is it possible to develop an operating system without a pre-existing one?


What I mean by this is if I have an "empty" computer (nothing in the disk) can I develop a program or more specifically an operating system without first installing a pre-existing one?

The question seems to be an obvious no as you need a compiler/assembler and these are programs and as such require an operating system to run on. That being said I have been unable to find a conclusive answer to the question so I'm asking it here.

I guess the question can be simplified as, is it possible to run some kind of barebones text-editor and assembler with just the bios/uefi?

Edit: More specifically I want to know whether the firmware comes with commands that allow this, even if the firmware can run a text-editor/assembler if I need another computer/OS to get them I'm right back where I started.

Note:I'm not thinking of doing this, it would be unnecessarily increasing the complexity of the already hard task of making an OS, I'm just wondering if it can be done.


Solution

  • Of course it is. Just stop and think for a moment. We use current computers to program the next ones and did just the same thing last time and the time before it. At some point obviously, we get to a point where there is no previous computer - yet clearly it was made.

    A walk down history-lane towards some of the earliest machines shows us that computers came with toggle-switches on the front panel. Some would be used to enter an address and others could be used to set the value of a byte at that address. Use that to code a boot-loader and you can then pull start-up instructions from some kind of external media, rather than by laborious manual entry.

    That said - you actually dont need an operating system in order to run programs. The operating system merely provides facilities and routines that make a programmer's life easier - like hardware access and memory management, but it's a practical necessity rather than a theoretical one. Practical because without it, commonly used routines would need to be included in each and every program and each program would need to be aware of and include code to cope with different hardware configurations - the OS abstracts these and frees you from having to know who made your video-card, sound-card etc, etc.

    Here seems to be a reasonable entrance to the rabbit-hole that is historical computing: https://en.wikipedia.org/wiki/Front_panel