Home .. Personal .. ARTICLES .. Software .. MUD .. Links .. Search

by Eddy Carroll, January 1994

The market for books on the PC is huge, covering all the topics under the sun -- if you want a book to tell you how to produce knitting patterns on your PC, the chances are good that you can find one.
   The Amiga book market, however, is a much quieter place, offering neither the range nor choice available to PC owners. Most of the books available are aimed at the novice user, and of those aimed at programmers, many suffer from inaccuracy and promote bad programming practices.
   How rereshing, then, to come across a new technical reference that is not only detailed, accurate and comprehensive, but well written and entertaining as well. The book in question is Ralph Babel's Amiga Guru Book.
   Ralph Babel is no stranger to the Amiga, having written many of GVP's device drivers. The Guru Book is based on an earlier German book of his, Das Amiga-Guru-Buch, but has been translated into English, and at the same time, fully revised and expanded to cover the most recent AmigaDOS and Exec features up to Workbench 2.1.
   In essence, this is a reference guide which takes up where Commodore's Rom Kernel Manuals leave off. As such, it is aimed squarely at the experienced Amiga programmer. Although it weighs in at a hefty 736 pages, including a comprehensive 30 page index, there is very little waffle -- just solid information on a range of topics hithertho confined to the realm of black magic.
   Subjects covered adequately in the RKM's, such as message ports and device i/o, are not given much coverage. Instead, the focus is on what Commodore doesn't tell you.

Novice Beware!
The Guru Book begins with an overview of the datatypes used by the Amiga, including the various floating point formats. The 68040's restricted set of FPU instructions is also covered.
   This is followed by a detailed set of programming guidelines (40 pages) which cover in depth the do's and don'ts of programming the Amiga. This isn't a simple rehash of Commodore's RKM guidelines, but covers such topics as why you don't want to use software interrupts, how to safely increase the size of your stack, and other similar items. A useful reference chart lists every function that allocates any kind of resource in the Amiga's libraries, and the matching call to free that resource.
   The first section finishes off with an overview of assembly language and C programming, along with explanations of all the amiga.lib functions. Tricks such as how to drastically reduce the size of your executable are well covered here, as is the use of the serial debugging library debug.lib and its parallel port cousin, ddebug.lib.
   The second section is concerned with the Amiga's system internals. This includes such esoteric subjects as how to access the Amiga's battery-backed clock, creating your own Kicktags (used to allow your code to survive a system reset), and the correct use of Exec's ColdCapture, CoolCapture and WarmCapture vectors. If you've ever wondered how system initialisation changed between Kickstart 1.3 and 2.04, you'll find the answer here.

DOS Dissected
The final section of the book is concerned with AmigaDOS, and at over 400 pages, is easily the largest. This in part reflects the inadequacy of Commodore's own documentation in this area, and in part, the BCPL heritage of AmigaDOS.
   Starting off with a look at BCPL itself (including sample source code for a BCPL AmigaDOS command) Ralph goes on to explain how BCPL's Global Vector affects AmigaDOS executables (now obsolete, but important if you are writing system code that must run under Kickstart 1.3).
   Another topic covered in some depth is how to create your own custom CLI, which can replace Commodore's standard offering. Commodore hint at this in the AmigaDOS documentation, but never go any further -- you'll find the important details right here. The same goes for how to open a CLI window on a custom screen under Workbench 1.3. (Actually, on second thoughts, you really don't want to know how to do that.)
   Equally comprehensive is the coverage of the AmigaDOS filesystem (both old and fast); the directory-caching option of Kickstart 3.0 isn't covered, however.
   More interesting is the discussion of how to write your own filesystem. This includes a full list of all the packets you're expected to support, along with explanations of what functionality you need to provide, and how to provide it. Lower level details such as how to avoid deadlocking your device handler when scanning the DOS device list are not forgotten. I've written several Amiga handlers in the past, and I could have saved myself a lot of anguish had this book been around back then.
   For most readers however, the most useful part of the AmigaDOS section will be the AmigaDOS reference guide, which has the most comprehensive coverage of the various dos.library functions that I've seen to date. Going beyond simply detailing the operation of each function, it includes information about ambiguous behaviour, common mistakes, system bugs, and unimplemented features that Commodore forgot to mention.
   The AmigaDOS section rounds off with a look at the DOS executable file format. As with everything else in the book, nothing is left out, and you'll find information here that is simply not available anywhere else.

All Work and No Play...
If The Amiga Guru Book simply covered the topics listed above, it would rate as a must-buy for most serious Amiga programmers. However, it also features a number of touches which make it not only readable but entertaining as well.
   Each of the 22 chapters begins with several witty and apt quotes, drawn from a wide variety of sources. In addition, there are quite a few diversions regarding the history behind certain Amiga features. And finally, the writing itself is just plain readable. On top of this, it's plain that the author knows his material inside out -- though I had my eyes peeled, I didn't spot a single factual error. My only criticism would be that many of the example programs assume SAS/C 5.1, while SAS/C 6 has been available for quite some time now.
   Other factors contribute to the book's usefulness as well. Throughout the text, unobtrusive symbols are used to highlight items that are now obsolete, or which were introduced with Kickstart 2.0. Also, footnotes are frequently used to expand on topics that stray from the main subject.
   Typographically, the book is well up to par. TeX was used for the typesetting, and the result is well formatted text that's easy on the eyes. The binding allows the book to lie flat when opened at most pages, which is convenient for referring to it from the keyboard. There's even a thoughtful Ultimate ASCII Chart on the back page, which covers the entire Amiga ISO character set.
   As I mentioned earlier, this book is not intended for the novice Amiga programmer. Advanced programmers will find it invaluable. However, intermediate level programmers will also find much of interest. In particular, the explanation of how Lattice C and SAS/C integrate with the rest of the system is essential reading, as is the coverage of Commodore's assembly language macros and FD files. The comprehensive DOS function reference is also a must-read.
   If you're serious about programming your Amiga at the system level, you need this book. And as a bonus, you'll find out exactly why the Amiga 1000 startup tune sounds the way it does.

(You may have some trouble tracking down The Amiga Guru Book. I ordered my copy from Hirsh & Wolf in Germany for DM79 + postage. You can contact them on +49-2631-83990.)

Home .. Personal .. ARTICLES .. Software .. MUD .. Links .. Search

Last updated 26 November 2000. Comments to ecarroll@iol.ie.