Interview with Dave Haynie

A system architect's view

Amiga to me is basically the set of design philosophies embodied in the Amiga computers. This is both HW and SW, you can't (and shouldn't) really try to separate the two, they're part of the same thing to any good system designer.

Everyone knows you are one of the best HW guys Amiga platform ever had what means you have to understand also low-level SW issues like firmware, device drivers, HAL...

Of course. Pretty early on, I learned that the HW and SW pieces were really two sides of the same coin. I learned about them both by reading the old hobbiest magazines of the 70's: BYTE, Kilobaud Microcomputing, Creative Computing, etc. Back when making your own computer was something akin to building your own HAM radio rig, you didn't specialize in HW or SW, you had to know and use both.

Phase two was college. I wasn't really sure if I wanted to major in Electrical Engineering (HW) or Computer Science (SW). So I wound up doing both. I set out to find work that involved both. Which was harder than I thought, since in many places in the world, hardware and software lived on alternate sides of some odd, artificial wall. In fact, my first job out of school was at General Electric, in a department called "Computational Design". We were the only folks in the whole freekin' company allowed to touch both HW and SW. Ok, GE was a miserable place to work, I lasted four months. From there to Commodore.

Then Commodore. On projects like the C128, it became clear to me that, even when I was doing just HW, that the two were so interrelated you'd do a horrible job if you didn't consider both pieces as one. If I design a chip without considering how it's to be programmed, it'll invariably be crappy to program.

...but you are interested also in operating systems, drive many computer languages (40?), have a clear vision how to do the computing right and in general it makes you fun to learn and design new things.


There are some people in these latitudes (mostly those who switched from AmigaOS to Linux earlier or later) who say there's nothing so special about AmigaOS, that it's just a middle 80's mutant of UNIX, but a badly implemented one - the argumentation is no memory protection, IPC done through pointer exchange is utterly a bad idea, device drivers as independent tasks may look nice but it's not such an advantage.

People can say what they like, but it won't make them right. AmigaOS has absolutely nothing to do with UNIX - not even a tiny bit of resembalance. No one holding the above view has the first clue about AmigaOS and/or UNIX.

And do realize that we are in the age of the user. Just because a person used AmigaOS for a few years and now runs Linux is no indication they have Clue #1 how either OS actually works.

They argue Linux kernel space model for drivers is faster, more efficient...

No. Actually, it's much, much slower. See, here's one example of ignorance on their part. In a UNIX-like system, you lose all kinds of performance in context switching. So a microkernel OS like Mach, in which most of the OS runs user-mode programs to do OS things, is inherently slower, all else being equal. That's because of the context switches: your I/O call switches to kernel space, then to user, then back to kernel, then back to user.

In the AmigaOS, none of that happens. There is no big context switch, simply because you're not carrying around that big protection context. OS calls in UNIX (and its clones) are always expensive, they always call up the kernel. On AmigaOS, many Exec calls run on the user's own context, and even if there is a switch to supervisor mode, it's still very light weight. This is why you can get 25,000 messages per second sent on slow Amigas (or thereabouts), whereas under Linux it's more like a few thousand, even on hardware that's many, many times faster. Everything on the Amiga is messages, not kernel calls. No one who isn't speaking to this point has a clue about how AmigaOS works.

...and WHEN written well also more secure.

That is also very ignorant. When drivers are well written, they're equally safe under Linux and AmigaOS. They're less safe than under Mach or something similar, for exactly the reasons stated above: Mach drivers usually run (or at least mainly run) in user mode, so if they crash, they don't bother anyone.

So, what do you think about these issues - actually, would you defend AmigaOS?

Of course I defend AmigaOS, but I have no mission to convert those of another religion. And believe me, people do take on their attachements to an OS (or even a text editor, sometimes), with the worst of man's ability toward zealousness. No single fact I bring up is going to change a person's opinion of AmigaOS if they are not listening and understanding the facts.

Could you please summarize where AmigaOS showed the way how to do things right?

Threads and Messages! When you have very efficient messanging and low cost threads, these become the fundamental building blocks of a good OS. Linux is so steeped in the UNIX traditions going back 30 years, it has yet to embrace much of what has been learned since the days at Bell Labs when "what do we do now that Multics is over" was the operative question.

BeOS is a good example of a modern OS that's learned from the AmigaOS. Sure, it has a POSIX interface to let it easily run UNIX code, but underneath, it's much more like a protected-mode AmigaOS - everything's done in threads and messages.

Linux now has real threads, though user-mode only (BeOS allows kernel mode threads, pretty necessary if, as in either OS, you have lost of stuff running in kernel mode). But since the Linux kernel isn't reentrant, threads in the kernel block other threads, similar to the way tasks in 16-bit Windows block other tasks. I have read comments like "no serious Linux program uses threads", which seems to be true, at least today.

AmigaOS also taught the world about dynamic design. UNIX/Linux, Windows, and most primitive OSs are static. They precompile in everything they're going to need: drivers, number-of-tasks, etc. This may be fine for the OS that's going into a toaster oven, and it was fine in the days of yore when 64K was tons of memory on your old PDP-8. But this isn't the dark ages, and there's no reason to do things the UNIX way when there are better ways, already well proven (eg, you don't have to jump into something weird like KOSH or The Hurd or Plan 9 to be able to move beyond UNIX - while, of course, keeping what you learned from it).

Where AmigaOS fails...

The two major failing of AmigaOS's design are lack of protection and (only in a few places) lack of abstraction. The protection issue is a tricky one, since while everyone wants protection, you don't want to implement it such a way that it does, in fact, drag down performance in the way your Linux people (seeing things only through Linux-colored glasses, apparently) seem to assume the AmigaOS works. There are ways this could have been done within Exec - the folks from Amiga who worked on the 3DO OS did this - but it's unlikely to be an issue, with the new OS being based on QNX (which is also a modern OS with some UNIX-friendly facade, but very much not UNIX).

...and what has been adopted (what could prove AmigaOS did it right) by other operating systems like Linux (or other UNIX clone), BeOS, or even Windows.

Well, I'm still waiting for someone to do autoconfig right. Maybe BeOS is doing this, not sure. But the others, forget about it. Windows is a half-step ahead of Linux in this, but only a half step. Users THINK that Windows is doing real autoconfig, but it is not. What happens is just smoke and mirrors. On reset, Windows starts up and reads its driver setup from The Registry (that giant file Windows puts everything into), builds a single image containing all drivers, and goes forward. Thus, much like UNIX, all drivers are statically bound, it's just that they get to do this binding without building a whole new OS image. Linux will probably get this at some point (yes, I'm familiar with the Red Hat dynamic driver loading hack; that's not it, you're just compiling driver-specific stubs into the kernel rather than the whole driver, it changes nothing).

I have read that under Linux 2.2, there's a better "module loader" facility that perhaps can load, if not unload, drivers on demand by name. I have not looked into this, and while that alone doesn't deliver autoconfig, it's certainly a necessary component of an all-over autoconfig system, and maybe even a stage beyond where Windows is today.

Why Windows seems to do autoconfig (and this would be a simple model for the Linux folks to use) is that, sometime early in the boot process, they launch a special device snooper. This is the guy that actually finds new hardware for you, assigns IRQ and DMA slots, etc. All this puppy actually does it put drivers in the right place and add their names to the registry. This is of course why you have to reboot to use them (they have to get rolled up in that gigantic driver file). This is also why a Windows system goes insane if you do something as simple as swap two PCI cards.

The AmigaOS does fully dynamic device binding. This is simple when drivers are separate modules that can be loaded at runtime. The BeOS does this too - drivers are always implemented as plug-ins (using their generic plug-in system) which can be loaded or unloaded at any time. Low-level drivers are plug-ins to the kernel (for that UNIX-like efficiency, when it matters). Some high-level stuff, as in AmigaOS, is implemented as client/server, such as graphics, but that's also true under UNIX if you're running X, and generally considered a good thing.

Where should the AmigaOS move in thell ever be for novices depends on the will of the Linux developers to depart UNIX for parts, to them, unknown.

As for Amiga and Linux, this is a middle ground. The Linux kernel needs to be fixed, certainly. But their stated intention is that all user-level stuff in "AmigaNG" programs is written to their object API, not to the Linux kernel. So if you stick to AmigaNG programs, many of the Linux problems, at user-level, should not exist. Without the kernel changes, though, you won't have real autoconfig or real multimedia. Jim Collas says kernel work will be done, and they know what should change. So it's a matter of seeing how they deliver on this, to judge the AmigaNG's use of Linux.


I think they have a rocky road, doing this. On the other hand, the Amigaification of Linux, especially if it spread through the Linux market, should have a certain degree of satisfaction to the Amiga community. And finally give Linux the abilility to compete against Windows on the desktop, simply by doing things better - which ultimately is a necessary precondition to a well waged war against Microsoft.

Note: This is a part of the interview with Dave Haynie being published in the recent issues of czech Amiga magazine 'Amiga Review'. Dave answered my questions in the beginning of June and on July 22th he commented upon the recent situation (paragraphs in italics). Published with permission.

Andrej bunta, editor