How does my computer work?
October 19, 2011 9:40 AM   Subscribe

I'm a proficient mac user, but I think I'd like to know more about how my machine works. Where do I go to learn more?

I've grown up with computers and while I can use them and do some troubleshooting, I think I'd like to know more about how they actually work. I have a basic idea of what the hardware components are, but operating systems are a bit of a mystery to me. I'd like to learn something about computers that won't be obsolete in a few years. I also don't want to follow blogs for the newest and tiniest changes in hardware/software. Is information about computer science what I'm looking for? Which books and/or websites should I check out?
posted by Homo economicus to Computers & Internet (12 answers total) 8 users marked this as a favorite
Computers are hugely complex beasts, and you could take this question in one of several directions:

1) How does Unix work? (OS X is built on top of FreeBSD, with some Apple-specific additions and of course the UI; you can get to the full Unixy goodness through I learned this through osmosis over 12+ years, so I have no idea how to go about learning it from scratch. Start reading manuals and how-tos, and scratch itches?

2) How do you keep computer hardware working, in general? You could look at this from a number of perspectives, from high-level (A+ would be the Microsoft cert, dunno if there's an equivalent Apple qualification), to very low-level (electrical engineering courses). You might also consider picking up an Arduino or other 8-bit microcontroller because they're much simpler (and more approachable) than the full complexity of a modern CPU. You can also semi-reasonably program AVRs directly in assembly, which provides a good low-level bridge to...

3) How does software work? You could pick up a programming language and start to learn it -- there are as many opinions as there are programmers, but I found Ruby with Why's Poignant Guide to Ruby to be a good intro text for non-programmers. You could try any of the languages, really..
posted by Alterscape at 9:48 AM on October 19, 2011

I highly recommend John Siracusa's OSX reviews. They give you a broad overview of the operating system, but also go into the technical details of some of the features.

For example, here's his section on how your Mac's operating system handles running multiple programs:

Snow Leopard review, Lion review.
posted by yodangson at 9:48 AM on October 19, 2011 [1 favorite]

One important thing to note (as, in fact, yodangson did) is that Mac OS is based on Linux. It's mostly possible, and some would say preferred, to ignore most of the crap in Mac OS that isn't Linux.

Which is to say that you might want to start out with a good Unix/Linux primer. I don't have experience with any one in particular, but Googling "Linux primer" or "Unix primer" brings up some likely options. This one seems to be of the right bent.
posted by gurple at 9:50 AM on October 19, 2011

One important thing to note (as, in fact, yodangson did) is that Mac OS is based on Linux. It's mostly possible, and some would say preferred, to ignore most of the crap in Mac OS that isn't Linux.

OS X is based on NeXTSTEP, which is based on FreeBSD and NetBSD, and a Mach kernel. It's a true Unix. There's no Linux involved.
posted by mr_roboto at 10:04 AM on October 19, 2011 [8 favorites]

You sound like the perfect candidate for building your own project computer and installing some kind of Linux on it.

Through the act of tinkering and making a few mistakes along the way, you learn a lot about the different components inside the box, what they do, what's compatible with what, and how the components all go together. Installing your own operating system on it, especially something somewhat challenging but extremely well documented (and easy if you are good at following instructions) such as Arch Linux will really give you a broad understanding of how the entire system works.

None of it is really that hard (there are a gazillion guides on the web) and you can do it over time with minimal investment. I have zero technical background but have enjoyed the process immensely.
posted by quarterframer at 10:12 AM on October 19, 2011

The terminology here is computer architecture/systems programming. A small amount of this is standard part of a CS curriculum, more can be taken at the undergraduate level but is generally taken as an elective.

You'll need some knowledge of the C language to start with. After that, the books my university uses are Computer Systems: A Programmers Perspective (for a systems class) followed by Operating Systems: Internals and Design Principles (for an operating systems class). The older editions I've linked to are fine, and used ones are a fraction of the cost . We also use OS/161 in the OS class, which is a toy operating system developed by Harvard for the purpose of teaching this stuff. It is very simplified (but functional) so that students can realistically install it, read through all of the source code and see exactly how it works, and eventually add functionality to it; there are assignments available which will help in choosing what source code to read first.

If you're highly motivated you can learn all of this on your own, but it is also somewhat overwhelming and being in a class helps.
posted by anaelith at 10:42 AM on October 19, 2011 [1 favorite]

If you don't mind paying college textbook level prices, one of the most in-depth books I've ever encountered is Operating System Concepts. You'll get an idea of what a kernel is, what a shell is, how things work at a lower level (not hardware necessarily, but the levels that sit directly above it) and programming concepts like threading. Most classes would have programming tasks to go along with this, but if I remember correctly, the book itself doesn't tackle programming.

The Siracusa OS X reviews linked above are an excellent Mac-specific resource and bridge the changes made between old Mac OS, NeXTSTEP, and the current release.
posted by mikeh at 10:48 AM on October 19, 2011

You sound like the perfect candidate for building your own project computer and installing some kind of Linux on it.

If you're going to build or buy a computer just to tinker with (which is a fine idea and I think you should, it can be done VERY cheaply these days) consider loading it up with a few different operating systems, or at least partitioning it up ahead of time with that goal in mind. Specifically you should consider a BSD variant like FreeBSD (the most popular and easiest to set up,) NetBSD, OpenBSD or the wacky new upstart DragonFly BSD. Any of these will have more in common with your Mac in terms of their internal structure than would Linux. Here's a nice article written by a FreeBSD advocate about the philosophical and organizational differences between BSD and Linux and here's a brief overview of the available BSD options.
posted by contraption at 10:51 AM on October 19, 2011

OS X is based on NeXTSTEP, which is based on FreeBSD and NetBSD, and a Mach kernel. It's a true Unix. There's no Linux involved.

To be even more precise, NeXTSTEP and OS X are based on BSD Unix, one of the two original branches of Unix (the other being AT&T Unix). FreeBSD and NetBSD are also descendants of BSD Unix, but they're cousins of OS X, not ancestors.

In addition, OS X includes a lot of GNU software (e.g., GNU tar, the bash shell, emacs), which is also present in most Linux distributions. This is all user-space stuff, though -- i.e., not the operating system kernel, but the standard programs that come with the operating system.

Agreed that the Siracusa articles are the best I've seen on the innards of OS X. I'd also second contraption's suggestion of building a BSD system to play with. However, there's no real need to build a hardware system -- if you've got VMware Fusion on your Mac to run Windows, for instance, you can very easily install as many BSD or Linux instances as you like on virtual machines and just fire them up when you want to play with them. (I'm assuming Parallels can do something similar, although I haven't used it.)
posted by McCoy Pauley at 10:59 AM on October 19, 2011

If you're willing to invest a few hundred dollars, you might also consider building a hackintosh. You'll learn more about the differences (and similarities) that Macs have with PCs, how they're put together, etc. I can guarantee that you'll come out of it with a lot more knowledge of how Macs work.
posted by The Lamplighter at 11:03 AM on October 19, 2011

If you choose to play around with FreeBSD, the Handbook is a good place to start.
posted by Bangaioh at 11:10 AM on October 19, 2011 [1 favorite]

If you want to learn how computers work, buy an Arduino board and write an OS for it, or install XCode on your mac and write a shell for it.

These things sound daunting because they are. Computers are incredibly complicated and even people who understand them really, really well don't understand a lot of things about them. For instance, the guy who designed your hard drive controller probably only has a vague idea about how your video card driver works.

I am a professional programmer who assembled (I can't honestly say "built", even though many will use that term for the same activity) my own computers starting in high school, installed linux and such on them as experiments, and eventually found myself writing C++ network code for a living. I can tell you all sorts of things about how information coming from into your computer gets moved around, formatted, parsed, reformatted, and replied to, especially in the case of HTTP and similar requests. Even still, I don't really know what happens to that information after it gets sent to your network card's buffer and prepped for output -- how it's represented as electricity on a wire, I don't really know. My personal website runs on a webserver of my own design, but I still couldn't tell you very much about the mechanism for getting data off your hard disk and into memory, for example.
posted by tylerkaraszewski at 12:13 PM on October 19, 2011

« Older We're all out of straw   |   How do I deal with all that jazz? Newer »
This thread is closed to new comments.