Thursday, October 25, 2007

Onion

Windows is like an onion - it has many layers.

There is the hardware itself. Your computer. The physical pieces that make it up. The CPU, graphics card, sound card network card and RAM.

Then there is the "Firmware" layer, software specific to that piece of hardware in your computer.

Then there is the "Hardware Abstraction Layer" or "Assembler" which can talk directly with the hardware and firmware on your computer and simplifies the language so it can allow communication between the hardware and the Kernel.

The "Kernel" is the brains of the OS. It's another abstraction layer - designed to "hide" everything complicated about the hardware abstraction layer and give an easy to understand interface to control it - allowing control of the hardware.

Of course it's not easy to understand unless you're a very talented programmer and mathematician so it requires another abstraction layer to hide everything complicated and give the kernel an easy to understand interface. So on top of the kernel sits the operating system and on top of that sits the User Interfaces and Application Programming Interfaces for things like DirectX or OpenGL.

And then on top of that are your applications - your programs and games.

With all these translations going on behind the scenes and through layers for everything you do on your computer it's no wonder that things go wrong.

Errors happen. They're bound to.

This is the way Windows is built. An not only Windows. Most operating systems are built this way. And why not? It's logical. You start with the extremely complicated hardware and then you add layers of simplification until it's easy enough to be used by Joe Average.
"Windows and Linux are designed from the core out, which is to say that they are all about layered kernels, system calls, and APIs, with each layer's purpose being to abstract the layers below it. The layers grow thicker; when a layer gets unmanageably thick, a pretty new abstraction layer is created so that people don't have to deal with the ugly one."
Apple have always approached things differently. They start by thinking about how the user interface should be and then design the hardware and software to suit. Again I'll quote from Tom Yager's "Ahead of the Curve" - someone who has had a lot of experience with a lot of operating systems.
"Everyone plugs into OS X through the frameworks, and below that lies a stable, thin, simple, and well-documented system stack. It is not the frameworks' job to abstract lower levels of software. From a developer's point of view, the frameworks are OS X. When developers write to Apple's frameworks, they inherit cross-application integration and operational and interface consistency with no effort. For example, E-Mail, the Address Book, and QuickTime are smart, autonomous objects available to all Mac apps regardless of language and requiring no optional software."
This results in a beautiful operating system. Not only beautiful to look at and use but also beautiful to develop for. And they build beautiful looking machines to run it on.

So. Windows is like an onion. OS X is like, well, an apple.

2 comments:

starez said...

"OGRES" are like onions

Jon said...

What, 'cause they stink?