Retrocomputing
GIMIX computer
OS-9 Level 2 booting
OS-9 Level 2 booting on GIMIX (ADM-5 terminal)

Installing OS-9 Level II on GIMIX

This kernel has been run with success on a computer with a GoTek floppy emulator and a DAT card from Corsham Technologies.

OS-9 Level 2 has been reconstructed to run on a GIMIX with an enhanced DAT. The original code comes from assembler listings that were saved from the factory when Dragon Data went bankrupt in 1984. The DAT provides four extra address lines to the 16 that a 6809 MPU has. The ROM and I/O devices must be installed so that they are addressed when the four extra lines are all one's - I.e. at from $F0000 and up. The DAT will then be told to map these blocks into the 16 bit address space when needed.

Hardware configuration

The disk controller card must have certain dipswitches set. S2-10 must be on to enable extended addressing through the DMA. Switches S1-1 to S1-5 must be on to enable extended addressing. When using DMA to transfer to/from RAM, the access does not go through the DAT. If the driver has received a buffer from OS-9 at e.g. $DF00, which is a logical address, then this must be translated into a physical address and entered into the DMA in the DMA address register for the lower 16 bits, and the DMA control register for address bits 16-19.

Example: Imagine a system with 128 KB RAM. The device driver has requested a 256 byte buffer for data transfer. The kernel has found a free block at physical address $14000, which it has mapped into the logical address $D000 via Dynamic Address Translation (DAT). The device driver is told to find the buffer at address $D000. If it stores this address in the FDC's DMA address register, the DMA will write the data to some other process that is using the physical block $D000. The device driver must therefore translate the logical address $D000 back to the physical address $14000 and put this in the DMA address register. The DAT is a 16 byte array, one byte per $1000 block, and the mapping is done by looking up index $D to find the value $14. The top 4 bits of $D000 must therefore be replaced with $4 so that the 16 bit DMA address register get $4000, and the lower 4 bits of the DMA control register are set to $1.

Configuration of disk controller

DAT initialization

When GMX Level 2 boots, the first action is to initialize the DAT. It takes RAM block 0 for the OS, and sets up the I/O and ROM blocks. Since the real-time clock keeps time using a battery when the system is powered off, it also starts to send interrupts to the CPU when it is turned on. The last step is therefore to cancel interrupts from the RTC before interrupts are enabled on the 6809 CPU.

This is the initialization routine:

*
* Initialize DAT registers for task 0
*
DATInit  clra
         tfr  a,dp
         ldb  #SysTask
         stb  DAT.Task
         ldy  #DAT.Regs
         clr  0,Y        RAM block at $0000
         lda  #IOBlock
         sta  $E,y
         lda  #ROMBlock
         sta  $F,y
         clr  $E220+17   Clear m58167 interrupts
         lbra COLD

Creating the ROM

OS-9 Level 2 is to be installed into a 4 KB ROM. This ROM must be addressed at $FF000. The DAT will always map the top 256 bytes into $FFxx. The ROM will contain the OS9p1 and Boot modules. Align the top of OS9p1 containing the interrupt vectors with the top of the ROM. Align the beginning of the Boot module with the beginning of the ROM. The unused middle space is conventionally filled with $39, which is the RTS instruction on the 6809. In case you want to use the default configuration, then use the ROMG68.bin file.

Boot disk

The rest of the kernel will be loaded by Boot from the 'OS9Boot' file on the boot disk. The disk here contains the bare essentials to boot OS-9 and the tools that are different from Level 1. When the boot works you can add more files to it.

The image file must be converted from raw format to either a real floppy disk or an image format that can be read by your emulator. The G68 drive uses FM encoding, a sector interleave of 3 and no skew. If you have a working OS-9 Level 1 then you will be able to read the disk. If you want to make modifications to the OS9Boot file, then you will probably have to install it on an empty disk and then copy the other files over with 'dsave'.

Here are the files:

File nameDescriptionSizeLast updated
ROMG68.bin 4 KB ROM for Booting OS-9 L2 from GIMIX #68 drive 4,096 2020/10/03
OS9p1.bin OS9p1 - Part 1 of the kernel 3,383 2020/09/13
BootG68.bin Boot module for a G68 floppy disk 622 2020/10/03
gimix-l2-boot-dsk.zip OS-9 Level 2 boot disk for GIMIX in raw format 44,243 2020/10/01
gimix-l2-boot-hfe.zip OS-9 Level 2 boot disk for GIMIX in HFE format 132,882 2020/10/01
ss80t-empty.dsk Single-sided 80-track empty disk 204,800 2020/09/13
rammer-hfe.zip RAM disk for GIMIX - Copy your system disk to RAM 43,223 2020/11/02

The disk images are formatted as single-sided, 80 tracks, 10 sectors/track and sector size 256.

Source files

These source file have partly been reverse-engineered and then augmented with text from Level 1 files.

Boot module for G68 floppy disk drive (boot)
Reads the first sector of the disk, then loads the OS9Boot file. Since the DMA feature in the G68 doesn't go through the DAT, the extended address must be set in the G68 before the operation.
Device driver for G68 floppy disk drive (g68)
The G68 floppy disk drive controller card was sold for the GIMIX systems
System definitions (sysdefs.gimix)
The sysdefs file contains the characteristics of the specific architecture, such as the definition of the MMU, devices etc.
Systype file (systype.gimix)
Systype defines the CPUType and CPUSpeed.

See also sources for Common OS-9 Level 2 modules.