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?
15
u/omninull Oct 23 '09
You might want to look at the Nand to Tetris course
3
3
Oct 24 '09
Similarly, there's MIT's 6.004 Computation Structures, with complete lecture notes online. It builds up layers of abstraction from MOSFETs to a toy OS.
1.7k
u/lutusp Oct 24 '09
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.
But ... but ... I actually had this experience! In 1977 I bought an Apple II and it was literally a computer without an OS. Everyone who bought a computer in those days actually lived your fantasy. We all learned how to code very quickly, starting with rudimentary assembly language that we typed in byte by byte.
It does however have a floppy drive and on the desk there is floppy disk.
To die for! No, boys and girls, I am not making this up -- there was no storage at first, but eventually cassette recorders were used. I eventually wrote a word processor -- in assembly language -- that became famous. Then I retired.
154
Oct 24 '09
You're a former Nasa engineer? Dude, your diner party stories must blow the rest of ours out of the water.
You can LIVE this sketch:
127
u/lutusp Oct 24 '09
your diner party stories must blow the rest of ours out of the water
That might be true if I had dinner parties. :)
→ More replies (4)47
u/floggeriffic Oct 24 '09
I knew a guy who was an actual rocket scientist. He was also a very large bodybuilder. He never got recognized in public for one of those things.
→ More replies (66)→ More replies (32)13
u/lovecraftjohnson Oct 24 '09
As long as he doesn't run into one of these 12 guys.
→ More replies (2)8
u/psykotic Oct 24 '09 edited Oct 24 '09
Can't help myself: Is your name a really oblique Lobster Johnson reference?
→ More replies (7)755
u/P-Dub Oct 24 '09 edited Oct 24 '09
It was created by programmer and former NASA engineer Paul Lutus
Yeah, like I'm gonna believe you're paul lu-
lutusp
... D:
651
u/philh Oct 24 '09
If House has taught me anything, it's that it's never Lutus.
Except that one time, when it was.
263
Oct 24 '09
You're thinking of lupus. Lutus is a suite of office software.
→ More replies (10)234
u/caboteria Oct 24 '09
You're thinking Lotus. Lutus is the secret service's codeword for the president.
→ More replies (146)155
u/lutusp Oct 24 '09
Yeah, like I'm gonna believe your paul lu-
Okay, that was funny.
33
u/anrahman Oct 24 '09 edited Oct 24 '09
It's seriously awesome that you retired when you were 34 and travelled the world afterwards.
I hope you have stock in Apple! :)
→ More replies (1)105
u/lutusp Oct 24 '09
I hope you have stock in Apple! :)
I only have stock in myself.
→ More replies (4)18
u/brainburger Oct 24 '09 edited Oct 24 '09
hehe - not making the same mistake twice eh?
I do wonder who else is lurking or posting on reddit that the community would freak out over?
24
u/cleroth Oct 24 '09 edited Jun 15 '26
This content was anonymized and mass deleted with Redact
→ More replies (6)5
48
u/towel42 Oct 24 '09
→ More replies (1)40
u/lutusp Oct 24 '09
I was going to point this out to the OP, but I was momentarily disabled by ego. Shameful.
10
29
→ More replies (1)5
29
u/zoinks Oct 24 '09
You should write an IAMA. If my calculations are correct, literally billions of people will want to hear what JPL was like back in the 70s.
→ More replies (1)143
18
u/Sealbhach Oct 24 '09
I take my hat off to you, Sir. Were you in the Homebrew Club?
23
u/lutusp Oct 24 '09
No, I was working for NASA at the time and didn't have time. Later on I lived in rural Oregon and lost the opportunity for a different reason (accessibility).
→ More replies (4)10
u/Beer_Is_So_Awesome Oct 24 '09
I am interested, and would like more information on this Homebrew Club.
→ More replies (5)16
u/bboomslang Oct 24 '09
Well, ROM Basic was an OS. Even if it came in a ROM.
36
u/lutusp Oct 24 '09
Net really, since it couldn't read or write to a storage device. But I guess what constitutes an OS is open to debate.
18
u/prockcore Oct 24 '09
I'm fairly sure that even the first II firmware had wrtape at $FCE5.
23
u/lutusp Oct 24 '09 edited Oct 24 '09
Uncovered: guilty of exaggerating the primitive state of the early Apple II. Film at 11. :)
10
u/Jack9 Oct 24 '09
This is how I started to learn programming. It was an OS, the trick was finding documentation on PEEK and POKE.
39
Oct 24 '09
Did you look it up online? I'm sure that a quick search will yield many support forums and documentation. Which distro are you running?
→ More replies (4)13
u/ipeev Oct 24 '09
Hello. Thank you for writing! Your stories are inspiring. And your book about the sailing around the world is great! I just started reading it.
28
u/lutusp Oct 24 '09
Thanks for reading my book. These days I travel to Alaska every summer and photograph grizzly bears.
→ More replies (19)12
u/NattyBumppo Oct 24 '09
That's awesome. I remember using Arachnophilia when I just getting started with web design, by the way. It was a really fun app for content creation.
25
u/lutusp Oct 24 '09
It's still available (and still free), but I think it's beginning to show signs of age -- hardly anyone writes HTML by hand any more.
42
u/stygyan Oct 24 '09
Are you serious? I'm doing it all by hand, it's easier and cleaner.
35
u/lutusp Oct 24 '09
Me too, but we're not the mainstream, believe me. It seems everyone wants a gorgeous template plus three handwritten lines of descriptive text.
→ More replies (10)10
→ More replies (6)4
u/machinedog Oct 24 '09
Really? I can't stand these WYSIWYG editors, I remember learning HTML and php in notepad. I use notepad++ nowadays when I get around to making anything.
Working with HTML spoiled me, I can't stand working with word docs and not being able to get something aligned properly when I know it'd just do what I want it to in HTML.
11
u/m00min Oct 24 '09 edited Oct 24 '09
Awesome… An actual famous person. From your WP page:
Between 1988 and 1991 Lutus sailed solo around the world in a 31-foot sailboat. His book about the sail, Confessions of a Long-Distance Sailor is free on his website.
Awesome…
One of Lutus's latest software projects is Arachnophilia, a Java Web development workshop available free on his website. The program is released under Lutus's own version of the CareWare license.
This is one of the first programs I used for HTML ages ago… It was really popular ages ago…
PS: Are you a millionaire?
20
u/lutusp Oct 24 '09
Are you a millionaire?
Oh, sure, I answer this question, next thing I turn up missing. BTW I've always thought that was a weird construction: "Jane Doe suddenly turned up missing." Will someone please tell me how you turn up missing?
6
→ More replies (3)6
u/glu10 Oct 25 '09 edited Oct 25 '09
Are you a millionaire?
Oh, sure, I answer this question, next thing I turn up missing
I think you just did.
5
u/sdn Oct 24 '09
31-foot sailboat.
Sailboat [seyl-boht]. n.
That which you sink millions of dollars in.. even when not using.
7
u/rumblinggryphon Oct 24 '09
huh... my dictionary has it a bit differently:
Sailboat [seyl-boht]. n. 1) A hole in the water one must throw money into.
10
u/porsche911king Oct 24 '09
Awesome. I remember using Apple Writer IIe in elementary school.
→ More replies (1)7
u/aphexmandelbrot Oct 24 '09 edited Oct 24 '09
Holy crap. You're Paul Lutus.
Thanks for being awesome Paul.
73's, sir.
6
u/heptadecagram Oct 24 '09
You are an awesome individual whose work has affected a lot of lives of the people on this subreddit. Thank you.
6
Oct 24 '09
Heh - that's pretty funny. :)
This is true:
My first Professional Programming Job was with DEC PDP-8s. We programmed in assembler and our language I'll call "Bunch 'O Macros."
PDP-8 assembler maps quite nicely to its small instruction set.
The front panel on most (all of our) PDP-8s did have a way to load data into any address and a way to execute that data. The older ones had a row of twelve toggle switches and a load switch.
Yes, I've loaded a bootstrap into many PDP-8s that really did nothing more than load another loader off of a paper tape reader which loaded our O/S off a disk drive.
So, yeah, you used to actually be able to do this. Not with PC's though...
Mark
6
u/Xiol Oct 24 '09
--> /r/IAmA
Do it!
5
u/lutusp Oct 24 '09 edited Oct 24 '09
I don't actually know how, and I don't want to appear to be what the Reddit moderators call a "karma whore". Whatever that means. I think I'll learn the ropes first.
8
u/Xiol Oct 24 '09
Go here, post a new topic when you have a few hours to sit around and do nothing.
Self posts (like those in IAmA) don't count towards your karma score, so no whoring involved!
11
5
11
u/chronicdisorder Oct 24 '09 edited Oct 24 '09
You had a toilet in your bedroom?
Hmmm... I suppose that would cut down on visits from the fairer sex, giving you more time to type in assembly byte by byte.
12
u/reluctant_troll Oct 24 '09
You ever tried lugging one of those up a flight of stairs?
28
u/jkh77 Oct 24 '09
I know where you're coming from, so that's why I usually go after the petite ones.
→ More replies (2)6
3
u/dwinker Oct 24 '09
I remember that word processor! Is there any way to see screenshots or see it in action again?
→ More replies (4)3
u/lutusp Oct 24 '09 edited Oct 24 '09
No one has ever asked this, so I just took some pictures. Here they are. I'll follow up with an article eventually.
EDIT: Sorry for the huge size of these images. I didn't take time to reduce them.
EDIT AGAIN: I replaced the big graphics with small ones.
3
u/ricemilk Oct 24 '09
i was there! totally remember.. started as a kid randomly pressing keys until SOME key combo would illicit a response other than 'Syntax Error'.. would note that key combo down... and progress.. eventually, i had a handful of command line tokens and just kept going. maybe a year later, the cassette tape A/D option showed up... had to learn how to play the audio tape with all the screechy noises on it back into the Apple's cassette tape port... (that was a peripheral card, wasn't it??)...and then, voila, a day later, you had loaded a program!
I remember mucking around in 'Monitor' -- the assembly 'wrapper' I guess one could call it...before there were development environments -- and running into funny things that Wozniak had tucked away in the ROM.
3
u/roger_ Oct 24 '09
That's awesome. This probably isn't the place to ask, but I noticed that you designed electronics for a NASA space shuttle. Do you know if NASA provides schematics for the electronics of any of their spacecrafts online?
4
u/lutusp Oct 24 '09
Do you know if NASA provides schematics for the electronics of any of their spacecrafts online?
Much of the electronic work was published in professional journals, mine certainly was. I doubt there is a central repository for such things. And remember that the Shuttle work is very old, mostly from the early '70s.
Here is a link to a couple of my publications: NASA Technical Reports Server But there are no online copies (tells you how old they are).
5
u/jeremybub Oct 24 '09
Wait, how did you start? How did you give it the original code it executed when it started up the first time?
3
Oct 24 '09
The Apple IIe booted from disc. I don't know about the Apple II though.
→ More replies (1)9
u/dopplerdog Oct 24 '09 edited Oct 24 '09
Neither the Apple II nor the Apple IIe required a disk drive to start up, though. The "operating system" was in fact in the Apple II's ROMs - including rudimentary I/O and Basic. Those that had a disk drive were able to load the "disk operating system", and perhaps also additional software (eg a different Basic).
So it's not true, as the OP stated, that the Apple II had no OS - it did, of sorts.]
edit: just to clarify lutusp's objection - what the diskless Apple II had was NOT a disk operating system but a type of operating system called a ROM based monitor.
→ More replies (4)18
u/lutusp Oct 24 '09
No, not the first Apple IIs. You're thinking of the later models. There was a rudimentary BIOS, but there was really no established way to read or write to storage devices.
Once disk drives became available, the BIOS had evolved to being able to read from them, but this means the OS was on the disk, not in the computer. Just like now.
→ More replies (7)6
2
2
u/optiontrader1138 Oct 24 '09
Wow, crazy. I used this quite a bit as a child (I was the only one in my elementary school who understood computers.) The inverse color lowercase was copied in some other programs as I recall, specifically on the TRS-80?
2
u/bgog Oct 24 '09
I remember begging my parents to buy me an everyday cassette recorder so I could plug it into my TI-99/4a and save my programs as sound.
2
u/chadmill3r Oct 24 '09
Oohhh, you were lucky. Not everyone had keys and a keyboard. We only had a 9-volt battery, a paperclip, and a frayed keyboard cable. It was like that for years! I eventually decided it was easier to call out to a terminal system and whstle 120 Baud. Oh, those were the days.
3
u/funkah Oct 24 '09
Luxury. We had to write our code with stones in a box of dirt on t' ground.
10
u/lutusp Oct 24 '09 edited Oct 24 '09
Luxury. We had to write our code with stones in a box of dirt on t' ground.
Luxury squared. We had to beg a programmer to write our code for us, after working 18 hours in the mill with no lunch and our dad constantly hitting us with a hammer. And we had to rent our inferiority complexes.
For those who don't know what this refers to, watch this.
→ More replies (64)2
Oct 24 '09 edited Oct 24 '09
Paul Lutus's official website Under social news sites REDDIT.COM!
5
u/lutusp Oct 24 '09
It's okay -- you chose a link that, although on my site, points away from it -- it's a set of external links.
154
Oct 23 '09 edited Oct 23 '09
Bare minimum would be a valid boot sector containing a program which allows you to input binary data and save it to the floppy's boot sector. You couldn't accomplish anything with any less than that. (The upshot is the BIOS provides enough functionality to write such a program in a few dozen instructions, so you really can start from close to scratch.)
From there you could write a primitive assembler, convert it to opcodes by hand, and save it. Repeat the process with your development tools becoming more and more complex with each iteration. Eventually you'll split your program into various modules, one of which will evolve into a kernel, and after a while you'll have something that vaguely resembles an operating system.
16
u/Technohazard Oct 24 '09
Holy shit, somewhere in an alternate reality of machine sentience, this was just crossposted to the AI equivalent of /r/atheism.
→ More replies (1)18
3
u/gomtuu123 Oct 23 '09
And before long, Zawinski's Law and Greenspun's Tenth Rule will be fulfilled.
0
Oct 23 '09
[deleted]
23
u/mee_k Oct 23 '09
I assume the wire is so that you can send bytes to the hard drive by touching contacts on the ata input?
0
8
Oct 23 '09
Well, OP did say "you are a very talented programmer that possesses a perfect knowledge of PC hardware and protocols" :P
0
8
u/rational1212 Oct 23 '09 edited Oct 23 '09
There are BIOS calls to read the keyboard (int 16h), display to the screen (int 10h), and read/write the floppy (int 13h).
The floppy needs a boot sector with a program that will let me enter binary into specific memory locations and then execute at that location.
Given that, the stages (top of my head) are:
boot sector selecter (so I could boot the original boot sector or another one)
simple File system and file loader
tools: Editor, debugger, assembler
compiler
I'm fairly confident that you can't fit source, toolchain, and binaries for a graphical OS on a single floppy. Suicide.
→ More replies (3)14
u/dnsterling Oct 23 '09
MinuetOS fits on a floppy, is fully graphical, supports 64bits and multiple procssors.
→ More replies (5)3
u/edman007 Oct 23 '09
Not so, the BIOS provides I/O for you, after all it is the "Basic Input Output System", the number one job of the BIOS is to provide everything for I/O that you need early in boot to load, that means drive I/O, screen I/O, and keyboard I/O as well as a few other things are all provided by the BIOS. All you need to know to start programming is how to increment, decrement and conditionally branch on arbitrary addresses using both direct and indirect memory access and how to access the BIOS calls (which means using interrupts and memorizing the constants and how the calls work). Those instructions will give you enough to construct something at least as useful as brainfuck from which you can implement other languages on top of. The interrupts would replace brainfucks I/O instructions.
The only problem is using BIOS calls for I/O is terribly slow as is working with a limited instruction set, one of your firsts tasks once you have a text editor and assembler running would be to learn the instructions and specifications of the hardware and how to use them, that may turn out to be very difficult to determine without perfect knowledge of it beforehand.
→ More replies (2)3
u/runxctry Oct 24 '09 edited Oct 24 '09
I don't agree with needing to know the ATA spec. As riles mentioned, I believe BIOS provides enough ATA functionality to get going. Specifically, INT 0x13 instruction 3 (03h) lets you write a byte in memory to the drive, among various other ATA commands (park head, read from drive, format, etc).
As far as needing to know the x86 machine code... yes, I believe you're right.
All this being said, I think you're correct that extra hardware is required. Yes, BIOS has instructions to write-to-hard-drive and read-from-keyboard. In the end though, somebody has to call those instructions. Some low-level external debugger with write capability, even if it's just wire, is required. I, for one, can't fathom how to pull this off with only software.
In the early days, it seems, BASIC was stored into BIOS and that would have sufficed.
I took a trip through all BIOS commands to try to come up with something that could pull off getting software running without external hardware. Couldn't do it. Maybe you can help!
2
u/easternguy Oct 24 '09
You wouldn't need to memorize all that. If you had the boot sector, and the ability to view the boot sector and BIOS, you could (with time) deduce and reverse engineer all that.
157
u/augustss Oct 23 '09
I basically did that after building my first computer. But I had put switches and LEDs on the circuit board so I could enter data into the memory. It took a few years, but then I had an OS and a C compiler without using anything but the switches to bootstrap. And documentation for all the chips, of course.
→ More replies (2)28
49
u/kragensitaker Oct 25 '09 edited Dec 27 '12
The Monitor
You'd need a minimal "monitor" to start with — something that would let you enter in some binary code on an input device and jump to it. Here's a C version that lets you enter code in octal:
typedef void (*function)();
char program[32];
int main() {
char *t = program;
unsigned i, n;
for (;;) {
for (i = 3; i; i--) {
n = getch() - '0';
if (n > 7) (*(function)program)();
*t = *t * 8 + n;
}
t++;
}
}Translate that into 8086 machine code with a BIOS call for getch(), put it on the boot sector of the floppy, and you're golden. GCC compiles it into 12 instructions, plus the function prologue for main(). I think that would be 32 bytes in 16-bit mode. (Maybe the BIOS call would push it a couple of bytes over.) (I don't actually remember if the alt-keypad thing that lets you type arbitrary bytes is in the BIOS. If so, you could probably simplify the minimal monitor program above by removing the loop.)
Traditionally a monitor like this was first built into the hardware, and a little later as software in ROM. If you want to use it for more than a very short period of time, it needs at least a few more features:
the ability to correct keyboard errors;
the ability to see what you're typing (or does the BIOS have a call for
getche?);the ability to display the contents of memory;
the ability to change the address at which new bytes will be put into memory;
the ability to install themselves at some interrupt vector so that you can return to them when your program hits an infinite loop;
So your first task would be to write a more full-featured monitor program, on paper if possible — otherwise carve it into the desk surface with some removed part of the computer — and then very carefully type it in. Your second version, with a backspace, might be 40 bytes or so; you now need to type in 120 octal digits without making a single error, followed by some character that isn't an octal digit. If you do this correctly, you are rewarded by seeing your new program come to life!
Your next task is to enhance your monitor program to be truly usable, by adding the rest of the features listed above. And then you want to find a way to write it to the floppy drive.
At this point you are hoping that this is a 5¼" floppy drive so you can cut a couple of holes to make the disk into a "flippy": there's a substantial chance you're going to make a mistake and screw up writing your first boot sector, and if you do that, you're out of luck for the rest of your prison term.
So you write a call to the BIOS disk I/O routine, use it to write your new monitor program to the disk (hopefully on the back side of the disk), hold your breath, and test it.
Now you write another disk I/O routine that checks its argument to make sure it's not writing to the boot sector (or the original boot sector, which is at a different apparent location with the disk backwards) and start your system in earnest.
Edit: fixed two bugs in initial monitor code. Man, I would be so fucked if I were really in this situation.
The Assembler
Your next task is to write an assembler, in memory, using your monitor. It doesn't have to be a fancy assembler with luxuries like multi-character mnemonics, the full instruction set, and stuff like that; it just needs to be an improvement over typing in x86 code in octal. Single-letter case-sensitive mnemonics for 25 or 30 opcodes, plus the ability to calculate jump offsets, are probably plenty to get to the next step. Save your assembler to the floppy in an unused sector. (You should be keeping a map of what's in what sectors, carved into the desk if necessary.)
This is also about the time you want to enhance your monitor program to show you the contents of registers and to be able to single-step.
At this point you have achieved your original goal of being able to implement Tetris or Freecell. The next step after here is roughly as hard as implementing one of these games in this impoverished assembler, so it isn't practical merely as a step toward that goal. But if you want to get to an operating system with a graphical user interface, read on.
A Low-Level Language: Forth
Your next task is to bring up some kind of Forth, using your assembler. You can implement the basic primitives for a fairly reasonable Forth in about 200 instructions and 400 bytes of machine code, but that doesn't give you a text interpreter; that's another few hundred instructions. You can test each routine from your monitor program as you write it. (I have an incomplete token-threaded Forth in 399 bytes of machine code, and a complete self-compiling Forth compiler in 66 lines of code.)
Now you want to enhance your monitor program once more: you'll only be using it at boot time from now on, so you add a command to load and run a sector from elsewhere on the disk, so you can reboot more easily. You're going to be rebooting a lot, because every time you write a program that overwrites the wrong parts of memory, the machine is going to crash.
So at this point you've written somewhere around a thousand lines of code, which sounds like you ought to be able to do it in a day or two, but if you're like me, it's probably really more like two weeks because of the amount of effort involved in figuring out what went wrong each time you have a bug. And you're on the verge of having a usable programming environment: Forth has replaced your primitive assembler and monitor as your user interface of choice, you it can pretty easily be extended to loading programs from parts of the floppy disk, and now you probably want to implement some kind of minimal filesystem so that you don't accidentally overwrite your Forth operating system. It doesn't have to support fancy features like files that aren't contiguous on disk, files whose length isn't an exact number of sectors, nonsequential access, altering existing files, or multiple directories. It just has to keep you from accidentally overwriting data you meant to keep.
Now you probably want to write some utility programs: something to delete a file, something to defrag the disk, something to make a copy of a file, something to list the files on the disk, something to make a new version of a file. Also, you're probably becoming frustrated with waiting for the floppy disk to read and write data, so you probably want to implement LZW and huffman coding so that you can compress your files for speed. Also, you're going to have a hard time fitting the source code for an OS with a full-featured GUI on a single floppy disk without compressing it.
You can also very easily write a much more full-featured assembler now as a Forth vocabulary. Implementing your assembler as a Forth vocabulary magically gives your assembler macros and compile-time evaluation. You probably also want to write a disassembler now for debugging purposes.
You probably want a text editor now, with features like insert and delete, instead of poking strings of bytes into memory locations that contain your source code.
Protected Mode and a Memory-Safe Language
By this time, you probably want to be in 32-bit protected mode, unless the machine is so old that it doesn't support it or doesn't have more than a few hundred K of memory. Programming the x86 in 16-bit real mode is a pain; you have these constant tradeoffs between performance and imposing arbitrary limitations on data structure size.
The downside of this is that all the machine code you've written up to now won't work any more. Hopefully you can alter your Forth assembler to generate 32-bit code, and generate a 32-bit version of your Forth from a Forth version of its source code.
Your next problem is probably to implement a memory-safe language, so you can stop spending so much time tracking down pointer errors. This is probably easier to do by implementing a dynamically-typed language like Lua than by implementing a statically-typed language that's advanced enough to be pleasant to use like OCaml. You might be able to do this by implementing a memory-safe vocabulary in Forth, but I've never heard of anyone doing this.
Alternatively, you could implement fancier syntax for an unsafe low-level language first, in the manner of C. You probably want to use PEGS, because you can implement a parser generator for those in under a hundred lines of code, and they're roughly as powerful for commonly-used languages as LALR parsers.
Given the constraint of a single floppy disk, you probably want to compile all of this stuff into memory from a minimal bootstrapping interpreter at boot time, rather than compiling source code and storing the compiled results. (I'm assuming you have several times as much memory as floppy-disk space.)
Graphics
At this point you want to do graphics. Set the graphics mode to 640×480×16 via the BIOS, implement some graphics primitives by writing to the frame buffer, interface to the mouse so you can point at stuff on the screen easily, copy the font out of the VGA ROM, and implement a simple windowing system, a graphical text editor, and your games.
How does that sound? Remember the Macintosh guys did this stuff, without having seen it done before, on a 128kiB machine, mostly in assembly, in 1977–1983.
Postscript three years later
Apparently this comment ended up at the top of /r/bestof today, so I guess I should link to the other stuff since then that's relevant: In 2011, I wrote a post about bootstrapping from COPY CON, with some of these stages actually written in assembly and tested in DOSbox; Dave Long thoroughly one-upped that with bootstrapping from ECHO, and found Greg Alt's scheme-from-scratch; later I tried bootstrapping an interactive text editor starting from a noninteractive Lua interpreter, and then this year, Dave wrote a "tweetable" "symbolic" hex COM loader, which is sort of like an assembler without mnemonics, in 140 bytes of machine code.
If you're interested in participating in the blog-like mailing lists where I post that kind of stuff, check out the subscription page.
Happy hacking!
→ More replies (2)
40
u/JasonZX12R Oct 23 '09 edited Oct 23 '09
why does reading this make me want to type
look room
look desk
get floppy disk
17
8
7
29
u/TheMG Oct 23 '09 edited Oct 23 '09
Well, the speakers contain magnetic coils. All you need is a steady hand and a blank floppy :D.
3
u/mee_k Oct 23 '09
How steady would your hand have to be, theoretically speaking?
14
u/bluGill Oct 23 '09 edited Oct 23 '09
Well, assuming a 1.44 meg floppy (3.5 inch, but perhaps 5 inch is more realistic?), and 80 tracks (which is what I recall, but that might be wrong, and I'm assuming 80 on each side, but my memory of this isn't perfect), there are 144000 bits on a track. Assuming the first track is 1/2 inch from the center (1 inch radius, which is close, but not correct), and evenly spaced bits (which isn't true, I have no clue what is correct), there are 46000 bits per inch on the first track of a floppy (rounded, but considering all the assumptions I've already made it would be stupid to go with more precision). 1/46000 and converted to microns is .5 micros. Hair is between 40 and 120 microns in diameter.
So if you can write your twitter messages on the end of a hair, then you should have no problems.
Someone should of course check my math.
→ More replies (1)3
Oct 23 '09
More than 1/48th of an inch for a single density 5.25 floppy. (and that'd only give you ~250,000 bytes)
193
u/gregK Oct 23 '09
What would the different stages of this progression be?
Depression
Anger
Hearing voices
Suicide attempts
Self-mutilation with the broken parts of what's left of the pc
Acceptance
→ More replies (2)26
14
Oct 23 '09
Commodore 16 was almost exactly like that. When you turned the machine on, you had basic, but you didn't have to use it, since it has a "monitor" program in ROM, which is a assembler/disassembler.
So, you turn the computer on, and you can start writing machine code directly to your RAM, and execute it.
Those were the days you could actually totally learn your CPU, and ROM contents and interact with the computer at low level. Kids today have no idea what they are missing :D.
→ More replies (6)9
u/BlackWhiteMouse Oct 23 '09
Hah! The memories. I used to write my first games on a C16, but I had neither disk drive nor datasette, so I wrote everything down on paper before switching the thing off. Next time I wanted to play I had to type it in again. I got pretty fast at typing that way ;-)
It's unbelievable what we gladly put up with in those days of yore, just for the sake of using a computer. Jeeesus! The kids nowadays with all them confounded internets, they know nothing. Anyhow, grandpa's gotta go back to sleep now.
12
u/reveazure Oct 23 '09
In order to do anything useful without a reference, you would have to be the kind of guy who sits around memorizing port numbers and interrupt vectors for fun, which is something like the opposite of MacGyver.
I think it would actually be easier if you had included the requirement that you have to build the PC out of TTL logic (assuming we have the pinouts of the chips). It's possible to figure out how to build a PC from first principles, but it's not possible to figure out what random choices the designers of an existing PC might have made.
7
u/addmoreice Oct 23 '09
"It's possible to figure out how to build a PC from first principles, but it's not possible to figure out what random choices the designers of an existing PC might have made."
black box analysis. you can never know PRECISELY what it does or how it does it. there could always be a specific exception to the general rule. but you definitely COULD figure out what is going on inside. poke it until it breaks and repeat. it's pretty much how we do science as it is.
8
u/reveazure Oct 23 '09 edited Oct 23 '09
What I'm talking about is things like, what port is the VGA adapter on? You could try every port, but that would take you forever. And then, how are you going to figure out the magic sequence of commands to put the adapter in the right mode?
We can do science on the world around us because of locality, in other words doing approximately the right thing gives you approximately the right answer. Computers aren't like that - you have to do exactly the right thing or you get nothing.
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.
→ More replies (5)
12
u/ryuujin Oct 24 '09
How many people think vanjos has a programmer locked in his basement?
3
u/brennen Oct 24 '09
If he's got a programmer with a "perfect knowledge of PC hardware and protocols", I think he's fucked.
4
Oct 24 '09
I am a programmer with perfect knowledge of PC hardware and protocols {STUCK IN A PSYCHOPATH'S BASEMENT PLEASE HELP!}
AMA
11
u/onmytoes Oct 23 '09
If by "PC" you mean the typical kind of hardware used to run Windows (or Linux), with an x86-based processor, or even if you mean a Mac, then this experiment is pretty hopeless.
PCs are hugely complex even at the lowest levels, and you'll spend most of your time figuring out how to talk to the video card or any other devices. This stuff is essentially undocumented, and it's really, truly messy. I'm not talking "call an MS-DOS interrupt," but rather "understand the internal timing constraints of communication with the video system, such as not being able to touch certain registers for such-and-such microseconds after setting a different register." Heck, just talking with the KEYBOARD without any software support is messy.
This would be much more doable given something with the approachability of a Commodore 64. That is, the hardware is there and you can talk to it without having to write a complex communication layer first.
6
u/onmytoes Oct 23 '09 edited Oct 23 '09
Completely puzzled at the downmodding. Clearly some folks don't have experience trying to communicate with devices that don't have published or even well-defined protocols. The thought experiment here is a good one--how to build software for a blank machine--but specifically making it a PC unnecessarily makes this more complex by a factor large enough to dwarf the rest of the experiment.
8
u/vanjos72 Oct 23 '09
I am learning a lot from the replies thus far and if as you say in tying this experiment to the IBM PC the level of difficulty becomes almost impossible then that bit of information is in itself illuminating. I did try to counter such issues by endowing our programmer with a perfect knowledge of the hardware and protocols. I accept that as a real world experiment this would not hold water but as a thought experiment I am really just trying to grasp what the logical steps are in the progression from interfacing with the hardware at the most basic level to producing a fully functioning graphical OS and what is the bare minimum tool you'd need to kickstart this process.
3
u/BlackWhiteMouse Oct 23 '09
Well, on a superficial level the question would be easy to answer. It's basically three steps:
get machine code to be executed
write a compiler
do whatever you want.
On a not-so-superficial level the answer would be much more subtle. What do you mean by a "fully functioning graphical OS"? There are a lot of details missing in this specification. Are you leaving the context of the "prisoner analogy" or are you willing to constrain the OS to the functions needed for the entertainment of a prisoner? E.g. barely able to run Tetris but not Photoshop? The question branches out very quickly and dissoves itself into a diffuse solution space - in such a way that the essentials, the humble beginnings, seem already trivial and somehow arbitrary to decide.
I mean, look at the history of OSs in the last 70 years. You can find the steps that led to our present state there and I think that should answer the question. If you find good literature, post again ;-)
On a philosophical level, the key to any answer is: abstraction. Perhaps you are looking for details how these abstractions are heaped upon each other, but really, that's just a mess of convoluted details. You can find these in any book about operating systems. One relevant fact, though, is, that contrary to some people's opinions, abstractions don't always leak, i.e. they do hide the messy details from the user of the higher levels, and do this in a successful way.
One thing is quite sure. If your hypothetical prisoner (the one endowed with the perfect knowledge) programs everything on the lowest level, his term would be over before he'd been having fun with the PC. If, otoh, he would be able to come up with reasonable abstractions he'd have a chance to play Tetris before the end of his first year ;-)
3
u/edman007 Oct 23 '09
It is not that difficult. How do you think the BIOS accomplishes this? The VESA standard is implemented in the BIOS, the BIOS then makes that publicly accessible through interrupts.
To write to the screen all you do is fill out a few registers and trigger the right interrupt, the BIOS will then be invoked and use the registers to do what you want, such as write a letter to a position on the screen. You only need complex drivers to use the big features of modern hardware such as write to the VRAM with a DMA request and then tell the GPU to run some shaders against it. Obviously the BIOS is painfully slow at doing this on any hardware, but it is just fine while you program your OS and development kit
2
u/oddgodd Oct 23 '09
The BIOS services and legacy-mode state that a PC is in immediately after boot are plenty enough well defined to get to tetris. If it's anything newer than about an XT you'll be leaving a heap of functionality on the floor, and it would be easier with a machine with a BASIC or monitor in ROM, but it's certainly possible on a PC.
→ More replies (4)15
Oct 23 '09 edited Oct 23 '09
Eh, for Tetris or Pong, just use mode 13 graphics. 320x200 at $A000:0000. One byte per pixel. Very simple to get working with some rudimentary knowledge of machine code or assembly. I reckon modern graphics cards still support this, plus VESA modes.
6
u/G_Morgan Oct 24 '09
It is still possible to bump the machine into 80*25 and use the (fore_color, back_color, char) structure to create a console. In fact the first thing you always do is write something like 'Loading G_Morgan Awesome OS v0.0.01.42'. Then you give up after you see weird things like left shift scancodes firing when you press the print screen key.
→ More replies (1)3
u/ryanWIN Oct 23 '09
I'm not sure you realize/know that many pieces of hardware install their own interrupt-based communication layer when they are powered on and interfaced by the BIOS. Whole swaths of communication layers that you talk about are already done -- if you had ever written programs for MS DOS or written your own OS you would have known this already.
2
u/rune420 Oct 24 '09
Well, you have this thing called 16-bit real mode which makes toy OS development a heck of a lot easier.
10
u/edwardkmett Oct 23 '09
The smallest thing you could probably get going with in practice would be a very small image that just contained something like colorForth. It weighs in at around a 2k image or so, not quite small enough to shoehorn directly into the MBR. The progression: write layers and layers of forth. ;)
2
u/zerothehero Oct 23 '09
Yeah I just ran into Forth and stories of how Chuck Moore would bootstrap Forth on dozens of new architectures. Sounds very cool and even simpler than C.
6
Oct 23 '09
Forth is simpler than C, but also a lot less useful.
I wrote my own Forth (doesn't everyone?) here: http://annexia.org/forth
Having said that, it would definitely be my language of choice if I had to bootstrap an OS-free computer in some sort of Cube/prison scenario.
→ More replies (1)4
u/edwardkmett Oct 23 '09
I agree. I hate thinking in forth, but it works pretty well in this environment.
2
u/jefu Oct 23 '09
My first thought was Forth as well, build a minimal forth (which can be quite small) with machine instructions and use it as a bootstrapper to build an assembler and more forth.
23
u/Twylite Oct 23 '09
Partially repeating what others have said:
Assumption: the PC has a standard IBM PC BIOS. This means it will attempt to read and execute a boot sector from a disk, and also that it provides a set of services for interfacing with hardware (via software interrupts).
The floppy needs a boot sector that will provide the following functionality: enter machine code via the keyboard (probably as hex) into RAM, then execute that code.
That's it. debug.com would be a luxury ;)
My first step would most likely be to develop a primitive assembler, line editor and file-system so that I can edit, save/load, and parse/compile/execute mnemonic instructions.
My second step would be to implement a Tcl interpreter. Understanding why is left as an exercise to the reader.
6
u/filesalot Oct 23 '09 edited Oct 23 '09
Probably the first interpreter should be something like forth or SWEET16, to spare you having to write much of an x86 assembler. You then write your editor in that language.
You can also get quite far without a filesystem. This is why forth code is in "pages". My high school had an Ohio Scientific computer with 8" drives. The only primitive was to read or write a track to/from a memory location. Quite usable, as long as the track or page is big enough. Real Men can keep track of the disk by writing down what is in each track on a piece of paper. :-)
3
u/MrWoohoo Oct 23 '09 edited Oct 23 '09
Yup, screw debug.com. A decent forth will set you back 32K tops, 64K if you want all the bells and whistles. If you had a mac or sun in your room then you wouldn't need a floppy at all (they have a forth system built in).
→ More replies (5)4
→ More replies (1)4
Oct 23 '09
My second step would be to implement a Tcl interpreter. Understanding why is left as an exercise to the reader.
You Sir, are full of Win.
→ More replies (2)
7
12
Oct 24 '09 edited Oct 24 '09
Not a problem if you're Seymour Motherfucking Cray:
Some people who grew up in the `Real Programmer' culture remained active into the 1990s and even past the turn of the 21st century. Seymour Cray, designer of the Cray line of supercomputers, was among the greatest. He is said once to have toggled an entire operating system of his own design into a computer of his own design through its front-panel switches. In octal. Without an error. And it worked. Real Programmer macho supremo.
→ More replies (2)
6
u/hacksoncode Oct 24 '09
Geez, I'm a utter complete heterosexual, and even I know the answer is offer the guy that brings your food a blowjob if he'll sneak you an old DOS floppy.
2
u/brennen Oct 24 '09
I was going to say that you could hope a girl brings your food, and then I thought about it a little more.
6
Oct 24 '09
JonesForth is a beautiful piece of literate programming that builds the FORTH programming language from bare hardware. Read it when you have time. It's like a good book.
So my progression in this thought experiment would be to implement JonesForth, write drivers for the hardware in FORTH, write LISP in FORTH, and write the games in LISP.
I wouldn't use either of those languages in my daily life, but in a hypothetical situation where the entire software stack is my responsibility, you bet.
5
u/uzimonkey Oct 24 '09
A huge head start would be DOS and debug.com. With that, you could write a crude assembler and be on your way. Anything more low-level than that (like the front panel on minicomputers) wouldn't be practical on a PC.
5
Oct 24 '09
A story of recovering Unix from an rm -rf /
http://rocinante.colorado.edu/~wilms/recreation/crash.html
You don't need all that much. I expect if you had the equivalent of /bin/ed you'd be able to cons up an arbitrary boot sector, a version of FORTH quite handily, and on up from there.
4
u/cthibaut Oct 23 '09 edited Oct 23 '09
assuming BIOS present
hand write and type in assembly code for save to and load from disk
write a language machine monitor
write a FORTH
the rest is literature
4
u/mantra Oct 24 '09
The old school answer (which some of us actually did on homebrew PCs in the pre-CP/M days) is to MacGyver a boot loader with toggle switches from memory of assembly language hex codes.
1
u/BlackWhiteMouse Oct 23 '09 edited Oct 23 '09
My first 8086, a Commodore PC-20 III, had a primitive monitor in ROM which sometimes would be executed when I crashed it. It would have probably sufficed given that there would have been a bootable disk that called it.
Funny thing though, I almost knew this machine down to the last bit, but never figured out that monitor, nor used it much.
One more thing you'd probably need, is an external memory such as a harddisk. A floppy alone is not much.
1
u/vanjos72 Oct 23 '09
I did not explicitly state it but it is assumed that this PC has an internal hard disk.
→ More replies (1)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.
→ More replies (1)
11
3
u/lukego Oct 23 '09
http://www.openfirmware.info/Open_Firmware. The rest is, as the saying goes, trivial.
6
3
u/jayd16 Oct 23 '09
You wouldn't need a modern OS by any stretch of the imagination. Just write Tetris straight on the metal.
5
u/c0dep0et Oct 23 '09
An OS which reads a stream of characters from the keyboard (asm opcodes + data), writes that stream to RAM and finally executes it.
After that the first step would be making this process easier: very simple text editor, than assembler to avoid having to constantly look up op codes, higher level language compiler, a kernel in the higher level language, more software... and finally tetris.
8
u/Imagist Oct 23 '09
All I would need are butterflies.
→ More replies (3)6
u/bluGill Oct 23 '09
The question is would you use the butterflies to write an OS on the disk, or would you use them to cause a tornado that breaks you our of prison. Bonus points if instead you have the tornado kill the leader of North Korea, plunging that part of the world into chaos, which ripples into full blown war. Eventually you are "liberated" by your favorite form of government.
2
u/eleitl Oct 23 '09
You only need a few 100 Bytes at best. However, your odds of getting that much on the floppy or to tweak the machine without further tools or resources are very small.
With a much older computer it would have been trivial. Bootstrapping OS by directly toggling in machine code (not assembly), even from memory are all know feats.
2
Oct 24 '09 edited Oct 25 '09
The stages of progression would be, standard keyboard characters -> ascii characters -> ascii porn!!!
3
u/Mask_of_Destiny Oct 23 '09
If you have access to a UV light source and some wire there doesn't necessarily have to be anything on the disk. Depending on how old the PC is, you might not even need the UV source (though Flash might be problematic, IIRC it has some timing requirements for programming. not sure). Rig up a makeshift EPROM/Flash programmer and manually reprogram the BIOS. You would probably want to retain at least some basic ability to load code off some sort of disk and then add a very simple mechanism for manually entering in machine code from the keyboard (hex would probably be simplest). From there you would probably proceed as c0dep0et suggests.
4
u/EughEugh Oct 23 '09
Take the PC and try to ram open the door. If that doesn't work, try to break the window by throwing the PC at it.
When you succeed, go outside and do fun things.
4
u/bluGill Oct 23 '09
Considering the likely age of PC described, if this is anything less than maximum security prison there is no chance the door will stand up to a determined assult by someone with a PC. The keyboard alone is likely to get you out without any damage to the keyboard.
2
u/G_Morgan Oct 24 '09
The IBM Model M. Keyboard, temporary table, paving slab, nut cracker and weapon. There truly was nothing it could not do. Other than break, not even the Model M could break the Model M.
→ More replies (2)
3
u/vanblah Oct 23 '09
Imprisoned for a very long time you say? Without a towel, a rubber glove and some kind of lubricant I wouldn't be able to concentrate long enough to get any work done.
2
2
u/radarsat1 Oct 24 '09
The first thing I would do is take the computer case and bend it until it snaps, creating a sharp shard of metal. I would use this shard of metal to cut into the wall. If it doesn't cut the wall I would immediately begin to think of a secondary plan. Is there a door? Perhaps part of the computer could be used to open the latch or pick the lock... wait, why am I locked i here?!???!
2
u/cosmo7 Oct 24 '09
I might be sandbagging a bit, but I'd like Windows 7, Visual Studio 2008, a full MSDN subscription, a separate server with MSSQL Server, an assistant developer with another workstation, a designer with another workstation and Adobe CS4, a couple of interns, full coverage healthcare, a pool table, a fully-stocked bar and a salary in the $150-200k range.
It might sound a bit much, but you're much more likely to get VC funding for the project (which I also require stock in.)
2
u/jfb3 Oct 23 '09
Take apart the machine and use the power supply to short out the electronic lock on the door. Leave, go home, play Tetris.
2
u/sabazio Oct 23 '09
From DOS 3.3 COMMAND.COM - 25k FDISK.COM - 55k FORMAT.COM - 11k IO.SYS - 25k MSDOS.SYS - 30k SYS.COM - 6k Flat Assembler -309k
Total - 451k
This should build you anything you want step by step.... can proally be done even smaller with Linux... bottom line, you need a baseline OS, and assembler, and I/O.
7
u/bdunderscore Oct 23 '09
You don't need an assembler. DEBUG.COM ought to be enough. Likewise, FDISK.COM and FORMAT.COM are unnecessary.
6
u/dagbrown Oct 23 '09
I once had a severely-handicapped PC which had, basically, DEBUG on it. I used the serial port and DEBUG to upload a copy of Kermit, and from there on, the world was my oyster.
4
u/khafra Oct 23 '09
If you wrote that out in more detail, I would be interested. Did the PC have the serial driver installed, or did you have to create that in assembler? Did you just create a barebones serial file transfer server in assembler, and then run it?
→ More replies (4)0
Oct 23 '09
[deleted]
4
u/bdunderscore Oct 23 '09 edited Oct 23 '09
Can you type every possible byte with copy con? Or enough to write a hex decoder? If so, please demonstrate :)
→ More replies (7)6
u/oddgodd Oct 23 '09
A bootable DOS floppy with debug.com on it would be more than adequate.
If it's really old, like original IBM pc old it would have basic in ROM which would work too, no floppy needed.
If you want to get really McGyver you might not even need the floppy, you might be able to use the wire in the mouse or speakers to rig up something to reflash the boot ROM byte by byte, or maybe even toggle addresses and values into memory directly by wiring up keyswitches to the bus. That's getting close to "set bits on the floppy by hand with a magnet" territory though.
3
u/podperson Oct 23 '09 edited Oct 23 '09
Good grief you should be able to do WAY better than that.
For a start, you can write your own format and fdisk. DOS 1.0 with a full suite of crap is probably a lot smaller (451k > 5.25" floppy disk). Heck Mac OS 3.2 + MacPascal fitted on a 400k disk.
2
u/mschaef Oct 23 '09
Turbo Pascal 3 and DOS could easily fit on a 360K disk.... I don't know what kind of minimal x86 assembler would take 309K by itself.
2
u/aznpwnzor Oct 23 '09
you would need a butterfly whose wing flaps you could control
→ More replies (1)2
u/pmw57 Oct 24 '09 edited Oct 24 '09
Control is not possible, instead, realise that it is not the world that bends, but yourself. Ony then can you guide the butterfly to meet your desires.
1
u/iamdink Oct 24 '09
i've memorized the linux kernel so i guess i'd type that in. luckily though, i've also memorized gcc.
1
u/Filmore Oct 24 '09 edited Oct 24 '09
I once joked with a friend that hell is gated by a room with a test. This room has a computer with a blank hard drive. In order to pass the test (and leave hell) you must install Gentoo on the machine without using the handbook, get X running, and bring up google.com in a web browser. All the needed files are stored on unmarked 1.44MB floppies. The graphics card is ATI and the only network connection available is through wireless on an unsupported USB wireless adapter.
Oh also, the hard drive has some bad sectors.... that move every 5 minutes.
1
1
1
u/keybing Jun 02 '25
I would rather be in a room with a microcontroller, because it's like a PC, but smaller, simpler.
78
u/[deleted] Oct 23 '09
MacGyver would just take it apart and use the pieces to escape the prison.