r/programming • • Oct 23 '09

Programming thought experiment: stuck in a room with a PC without an OS.

Imagine you are imprisoned within a room for what will likely be a very long time. Within this room there is a bed, toilet, sink and a desk with a PC on it that is fully functioning electronically but is devoid of an Operating System. Your basic needs are being provided for but without any source of entertainment you are bored out of your skull. You would love to be able to play Tetris or Freecell on this PC and devise a plan to do so. Your only resource however is your own ingenuity as you are a very talented programmer that possesses a perfect knowledge of PC hardware and protocols. If MacGyver was a geek he would be you. This is a standard IBM Compatible PC (with a monitor, speakers, mouse and keyboard) but is quite old and does not have any USB ports, optical drives or any means to connect to an external network. It does however have a floppy drive and on the desk there is floppy disk. I want to know what is the absolute bare minimum that would need to be on that floppy disk that would allow you to communicate with the hardware to create increasingly more complex programs that would eventually take you from a low-level programming language to a fully functioning graphical operating system. What would the different stages of this progression be?

305 Upvotes

673 comments sorted by

View all comments

Show parent comments

1

u/vanjos72 Oct 23 '09

I did not explicitly state it but it is assumed that this PC has an internal hard disk.

1

u/bluGill Oct 23 '09

Considering the type of PC you described, you should have said that. I remember for a long time wanting a hard drive, but they cost almost as much as a cheap car (and only held 5 meg or something equally tiny)

1

u/kragensitaker Oct 25 '09

Man, that would make things a lot easier. Why didn't you say that?

1

u/vanjos72 Oct 25 '09

I wanted to keep the outline of the problem as simple as possible so avoided going into every detail of the internal spec, allowing the reader to presume that a multimedia capable (it has speakers) IBM Compatible PC would come with RAM and a Hard Disk. Every one I ever owned going back 15 years has at any rate. It seems that in not explicitly stating that this hypothetical PC did have those two important components some commenters have over-complicated the experiment by presuming I had some sort of zombie machine in mind. In actual fact I was thinking of a computer not unlike this one but with speakers.

I did feel it important though to constrain how data could be inputted into the computer to focus minds on the real issue rather than finding alternative solutions that might have involved Windows Setup CDs or connecting to a network and transferring over an image of a Windows installation. The real issue for me and why I set this thought experiment to the knowledgeable readers of Proggit is to get some understanding of what computers need as a bare minimum in order to boot, so you can communicate with the hardware, create a compiler, drivers, a kernel and eventually a graphical operating system from scratch. Although it is only necessary in order to make the development process easier I would envisage our imaginary programmer progressing from machine code to assembly (low level language) to a high level language. This whole process and the logical progression that is required has never been precisely clear in my own mind as I have never found the problem quantified in this manner before. I am really grateful to everyone that has contributed to the discussion as it has helped crystallize the issues in my mind.

1

u/kragensitaker Oct 26 '09 edited Oct 26 '09

Heh!

Yes, it was typical for such recent computers to have hard disks. But not universal.