Skip to main content

Recommended reading for the Amiga Developer

Developing software takes a lot of knowledge. The thirst for information is endless. In this post we will make our recommendations on what to read, and they can all be found online in pdf format. The AmigaOS 3.2 Native Developer Kit The NDK contains autodocs and include files, but also examples and some documentation. Get it from the official Hyperion website  or from  Aminet . Amiga ROM Kernel Reference Manual: Libraries This is the first part of the Technical Reference Series by Commodore covering Release 2 of AmigaOS. and it comes with our highest recommendations. This is without a doubt the most important book to have. It deals with every library of the 2.04 except dos.library, which is covered in The AmigaDOS Manual listed below. It is not a holistic tutorial, but as the title suggests a reference manual. It is however written in an explanatory manner with for example a whole chapter about Exec Lists and contains many examples written in C. It can be found  here Amiga ROM Kernel R

NDK Setup for the SAS/C compiler

Although its development has been discontinued some years after Commodore went under, SAS/C Version 6 still is one of the best and recommendable C-compilers for classic AmigaOS development until today.


If you don't have the package, you may find it second hand or on the net. The extensive manual is a must read, comes in two large volumes and can be found here and here. We won't cover the installation of the compiler in this article, so please refer to the manual instead. Also please make sure to apply all updates up to Version 6.58. 

When the compiler's installation script has concluded and you reboot for the first time, have a look at the S:User-Startup file. It should have the following additions, if you installed the compiler to the "Work" device/volume:
;BEGIN SAS/C
assign sc: Work:sc
assign lib: sc:lib
assign include: sc:include
assign cxxinclude: sc:cxxinclude
path sc:c add
;END SAS/C

The files which need to be replaced are found in the directories pointed to by the "lib:" and "include:" assignments.

Start with the files which are used by the compiler and its assembler and delete only those which will be replaced by the 3.2 header files:
delete all include:clib
delete all include:datatypes
delete all include:devices
delete all include:diskfont
delete all include:dos
delete all include:exec
delete all include:gadgets
delete all include:graphics
delete all include:hardware
delete all include:intuition
delete all include:libraries
delete all include:pragmas
delete all include:prefs
delete all include:proto
delete all include:resources
delete all include:rexx
delete all include:utility
delete all include:workbench
delete include:all.gst
delete include:all.gst.info

Now change to the directory where you placed the NDK's drawer and copy the replacement files from "NDK3.2" to the "include:" directory:
copy NDK3.2/Include_H/#? include: all
copy NDK3.2/Include_I/#? include: all

Finally, copy the new link libraries:
copy NDK3.2/lib/#?.lib lib:

And that should be it. :-)
Note that the "include:all.gst" file is deleted as a precaution so that you do not use it by mistake. It contains all the old Kickstart/Workbench 3.1 header files in a precompiled form which can be helpful to cut compilation time. But we just replaced all the 3.1 header files with the 3.2 versions...

I recommend not to use "include:all.gst" file but to generate that precompiled global symbol table file in each of your projects as needed. The compiler options you use to generate these header files may have an impact on what is generated, and that may not be a file which works well with a different set of compiler options.


Let's enter a small C program to verify the procedure. You can use any text editor of your choice, but we'll use TextEdit now to create the file for demonstration purposes:
Textedit HelloWorld.c

Enter the following lines:
#include <dos/dos.h>
#include <proto/dos.h>

int main()
{
    Printf("Hello, World!\n");
    return(RETURN_OK);
}


Save, close Textedit and compile & link the program with:
SC LINK HelloWorld.c
The program uses the Printf() function of dos.library instead of the compiler-supplied printf(). So you'll be fine, if it compiles successfully.

Comments

Popular posts from this blog

Recommended reading for the Amiga Developer

Developing software takes a lot of knowledge. The thirst for information is endless. In this post we will make our recommendations on what to read, and they can all be found online in pdf format. The AmigaOS 3.2 Native Developer Kit The NDK contains autodocs and include files, but also examples and some documentation. Get it from the official Hyperion website  or from  Aminet . Amiga ROM Kernel Reference Manual: Libraries This is the first part of the Technical Reference Series by Commodore covering Release 2 of AmigaOS. and it comes with our highest recommendations. This is without a doubt the most important book to have. It deals with every library of the 2.04 except dos.library, which is covered in The AmigaDOS Manual listed below. It is not a holistic tutorial, but as the title suggests a reference manual. It is however written in an explanatory manner with for example a whole chapter about Exec Lists and contains many examples written in C. It can be found  here Amiga ROM Kernel R

NDK Setup for the VBCC Compiler

vbcc is a highly optimizing portable and retargetable ISO C compiler by Volker Barthelmann. It supports ISO C89 and a subset of C99. It's also still being developed and offers a variety of target distributions and cross-compiling options. Best of all: It's free. The AmigaOS distribution of vbcc is maintained by Frank Wille and can be downloaded here . Frank added support for the NDK3.2 in vbcc 0.9h, so you'll have to get this version or a later one. Installation of the compiler is simple: You'll have to download the vbbc main archive suitable for your system plus at least one Amiga-related target archive, first. We'll assume you want to compile on Amiga natively, so we choose: Main archive - AmigaOS 2.x/3.x 68020+ binaries Target Archive - Compiler target AmigaOS 2.x/3.x M680x0 (download by right-clicking the link & select "save as") Open a shell. We assume you have lha installed. If not, get it here (download by right-click