0

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.

Xcode23
  • 161
  • 2
  • 7
  • 1
    Depends on the hardware. In the original IBM-PC that had ROM Basic, if there was not bootable media it would drop you into Basic with a rudimentary editor. In theory you could have coded the start of an OS by poking into memory and then jumping to that code. – Michael Petch Dec 02 '16 at 14:10
  • Consider this... Obviously, someone actually had to *do* this at some point in the past. However, an OS for a new hardware platform is typically created on an existing platform and cross-compiled for the new platform. – David Hoelzer Jan 09 '17 at 01:43

2 Answers2

1

Well, you do have to supply the machine code to do so, so without help of any other program you can either hope that your bios has some commands for that (I wouldn't know) or you take a high precision laser and write the machine code by hand.

On modern hard disk, the latter is impossible for humans, because the disks are much to fine. We can't hold still enough.

Also, assuming you could get the code onto the disk and your bios execute it, you would still have to write it. A text-editor on assembly-level from scratch is an unbelievable hard task, because you would have to write the drivers for your keybord and monitor first. EDIT: Okay, depending on your BIOS it may already deliver some mundane drivers. What's probably missing is the Assembly-Compiler, without it you can just write 0's and 1's for programming.

If you are looking for something more satisfying in terms of DIY-Computer-making, I would recommend Raspberry Pi.

GreenThor
  • 456
  • 5
  • 14
  • Actually whether the firmware provides commands that allow programming is precisely what I wanted to know. perhaps I should edit my question. How would things be different in the raspberry pi in regards to my question. Isn't the firmware in the pi more limited than the bios? I would expect that if it can't be done in the bios it shouldn't be doable in the pi, am I wrong? – Xcode23 Dec 02 '16 at 10:11
  • Well, I guess it depends on the firmware? And I mentioned Raspberry Pi because it is the closest to DIY-Computer-making I could think of. Better than lasering the hard disk, I thought. I don't know enough about BIOS firmware to go into more detail, I'm sorry. – GreenThor Dec 02 '16 at 11:12
1

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

enhzflep
  • 12,927
  • 2
  • 32
  • 51
  • I'm aware that this was possible historically. I want to know if it's possible today. Even if I can run programs without an OS including programs to make a new OS like a text editor/assembler(hex editor?) this point is moot if these programs don'l already come packaged with the firmware. If I need to make or download these programs in another computer I'm back where I started. I want to know if given a newly made modern computer empty hdd, the stuff that comes packaged with the firmware is enough to get this whole process going. – Xcode23 Dec 12 '16 at 11:34
  • I'm unaware of any modern systems on which this is possible.I suspect Michael Petch's comment mentions one of the most if not _the_ most recent example that facilitated this. – enhzflep Dec 12 '16 at 18:33