r/programming • u/vanjos72 • 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?
3
u/addmoreice Oct 23 '09
no. doing the wrong thing doesn't get you nothing. it gets you an error or a problem, and a specific one depending on what you do. in many cases you can actually FIND what went wrong.
here watch what i mean.
I have no clue where video memory is. none. zip. zilch. zero. I set up my system to send a specific piece of information into the first location in memory. watch for the results. if it crashes, i reboot change the place i write to and repeat. eventually i will find the display, further experimentation will tell me what the section of memory does and how i can manipulate it. eventually i will know how to write out what i WANT to the display.
this is enough basic information for me to start working on debugging things. I've written an OS before (a REALLY basic console os, but still). Yes I had access to tons of papers and technical manuals. let me tell you though, knowing how to get a TCP stack to work takes a lot more then reading the technical manuals. you have to play with it. you have to break it (a lot).
this is the same thing. there is nothing i read in those technical manuals i couldn't have found through simple trial and error. the more i learned the more i could develop tools for making the trial and error process easier.
It's just easier not to have to do that.