NitrOS 9 - nealcrook/multicomp6809 GitHub Wiki

This page describes how to get NitrOS-9 working on Multicomp6809. It assumes that:

  • You are using CamelForth as your boot ROM
  • You have at least 64Kbytes of RAM (ie, external RAM)
  • You have a VGA VDU, PS/2 keyboard and SDcard
  • You have my mk2 memory mapping unit (though strictly speaking this is not needed yet, except to use it to disable the boot ROM)

Getting disk images

As of April 2017, the Level 1 and Level 2 ports for Multicomp6809 have been accepted into the main repository (sourceforge) so you can download a prebuilt latest-and-greatest .dsk image from there (see the wiki on the NitrOS-9 sourceforge page for links)

Alternatively, you can check out the whole NitrOS-9 repository, examine/modify the source code and build disk images for yourself. When building from source, the makefile target name is mc09 for the Level 1 port and mc09l2 for the Level 2 port. If you have mercurial and toolshed installed the build is like this:

$ hg clone http://hg.code.sf.net/p/nitros9/code nitros9-public
$ cd nitros9-public
$ # before doing a build make sure you have the latest
$ hg pull
$ hg update
$ 
$ make clean
$ make dskclean
$ make PORTS=mc09
$ make PORTS=mc09l2

The disk images are:

level1/mc09/NOS9_6809_L1_mc09_80d.dsk
level2/mc09l2/NOS9_6809_L2_80.dsk

(if there is a NOS9_6809_L2_80dxl.dsk you MUST use that instead.. the non-dxl version will not work. If there is no dxl version it means I have retired the non-working version and made the non-dxl version work)

Creating an SD card image

Next, you need to create an SDcard image and transfer it to an SDcard, using the instructions in creating an SDcard for FLEX -- those instructions cover all of the bootable images supported by the multicomp09.

You can use either the Level 1 disk image or the Level 2 disk image, but you cannot have both of them on a single SDcard (for the simple reason that the boot process from CamelForth is coded to look for the image at a particular block offset on the SDcard).

Boot

Slot the SDcard into your multicomp09 and power-up. You should get the CamelForth start-up banner. Type NITROS9 and press "return". The screen should look like this:

NITROS9 Boot NitrOS-9/6809 Level 1 V3.3.0
Multicomp09
(C) 2014 The NitrOS-9 Project
**   DEVELOPMENT BUILD   **
** NOT FOR DISTRIBUTION! **
Tue Nov 24 22:30:56 2015
http://www.nitros9.org

* Welcome to NitrOS-9 Level 1 on the Multicomp09 *

       yyyy/mm/dd hh:mm:ss
Time ? 

The only thing that you typed was the first "NITROS9". Even though you pressed "return", the computer did not echo it. You should be able to enter a date, press "return" and get to the NitrOS-9 prompt ("OS9:"):

2015/10/03 20:45:00
October 03, 2015  20:45:00

Shell

OS9:

It didn't boot

If things didn't go so smoothly, here are some tips to inspect the system and fault-find the problem. Even if it did all work, you might want to read on just to learn about the NitrOS-9 boot process.

First inspect your system disk

From CamelForth take a look at the kernelfile (track34). Reset the system and type this:

MMUMAP EFTOCD
HEX
2 SDLBA2 84C8 2600 12 SDRD256n 0 SDLBA2

This should load the kernelfile (track34) into memory at $2600 so take a look:

2600 180 DUMP

You should see something like this:

2600  4F 53 20 13 12 05 87 CD  00 5D 00 0D C1 85 A1 00  OS ......]......
2610  11 00 00 52 45 CC 05 30  8C 10 B6 FF D0 85 02 27  ...RE..0.......'
2620  F9 A6 80 27 12 B7 FF D1  20 F0 4E 49 54 52 4F 53  ...'.... .NITROS
2630  39 20 42 4F 4F 54 00 33  8D FF C5 8E 10 80 10 8E  9 BOOT.3........
2640  EE 00 A6 C0 A7 A0 30 1F  26 F8 7E EE 4D 30 8C 13  ......0.&.~.M0..
2650  EC 09 6E 8B 4E 49 54 52  4F 53 79 60 42 4F 4F 54  ..n.NITROSy`BOOT
2660  9D A0 18 87 CD 07 ED 00  0D C1 80 13 00 11 00 00  ................
2670  4B 72 EE 10 8E 00 00 10  8E 04 00 4F 5F ED 81 31  Kr.........O_..1
2680  3E 26 FA 4C 4C DD 20 CB  20 DD 22 CB 02 DD 46 CB  >&.LL. . ."...F.
2690  70 DD 44 5F 4C DD 26 9F  28 32 89 01 00 8E EE 00  p.D_L.&.(2......
26A0  9F 24 34 10 30 8D 07 42  10 8E 01 00 C6 29 A6 80  .$4.0..B.....)..
26B0  A7 A0 5A 26 F9 35 10 10  8E FE 80 17 07 13 31 8D  ..Z&.5........1.
26C0  07 8E 30 8D FF 9D 34 10  8E 00 2C EC A1 E3 E4 ED  ..0...4...,.....
26D0  81 8C 00 36 23 F5 32 62  30 8D 00 8F 9F 84 30 8D  ...6#.2b0.....0.
26E0  00 86 9F 3C 30 8D 01 31  9F 40 30 8D 00 A5 9F 3E  ...<0..1.@0....>
26F0  9F 38 30 8D 01 4A 9F 42  9F 2E 30 8D 00 A5 9F 3A  .80..J.B..0....:
2700  30 8D 00 A1 9F 81 9F 6B  31 8D 07 07 17 06 BB 86  0......k1.......
2710  C0 30 8D 07 2F 10 3F 00  10 25 FF 58 DF 2A A6 C8  .0../.?..%.X.*..
2720  1B 85 01 27 02 0C 89 9E  20 C6 F8 E7 84 4F D6 24  ...'.... ....O.$
2730  50 1F 02 50 17 04 FC 30  8D 07 0D 86 C1 10 3F 00  P..P...0......?.
2740  10 25 FF 30 6E A4 34 94  C6 18 20 13 34 94 C6 16  .%.0n.4... .4...
2750  20 0D 6E 9F 00 36 3B 6E  9F 00 38 34 94 C6 14 BE   .n..6;n..84....
2760  00 4B AE 85 AF 63 35 94  31 8C 19 4F 1F 8B 9E 4B  .K...c5.1..O...K
2770  DC 42 DD 2E DC 3E DD 38  33 E4 EF 04 A6 0D 8A 80  .B...>.83.......

The exact values may be different, but the first two bytes should be $4F $53 ("OS"). If they are not, your SDcard image is incorrect.

Finally, with the kernelfile in memory, this should boot it:

0100 DFF2 ! 0103 DFF4 ! 010F DFF6 ! 010C DFF8 ! 0106 DFFA ! 0109 DFFC !
CDTOCD 2602 PIVOT

You should see:

Boot NitrOS-9/6809 Level 1 V3.3.0
Multicomp09
...

How the boot process works

When you issue the command NITROS9 from CamelForth, it loads "track34" from the system disk (which is part of your SDcard image) into memory at $2600, sets up some vectors in RAM at $100 and then jumps to address $2602. The 'track34' code is the concatenation of a number of NitrOS-9 modules and this concatenation is called the 'kernelfile'.

The first module in the concatenation is REL. REL displays the message 'Boot', using direct access to the UART (ie, it is not using a device driver at this point). Next, REL copies the kernelfile ($2600 to $3800) to address $EE00 -- only the first $1080 bytes of it -- then jumps to code (still in REL) at the new address.

REL then jumps to KRN which sets up system variables, the system memory map, system call tables, IRQ & SWI setup. KRN uses the OS9 F$Link call to locate modules KRNP2 and INIT by name (they must be included as part of the bootfile). INIT names the boot file ('Boot') and the program to fork (to be run as the first process) ('SysGo'). It also names the boot storage and I/O devices ("/DD" and "/Term", respectively). INIT also defines the OS revision name string:

NITROS9 Boot NitrOS-9/6809 Level 1 V3.3.0

and the installation name string:

Multicomp09

both of these are referenced through entries in os9.d (refer to the section 'Configuration Module Entry Offsets').

The next step is to load the bootfile into memory. The bootfile is a concatenation of modules, in this case the minimum set of additional modules needed to get the system to the shell prompt.

The start sector and size of the bootfile are stored in the first sector (LSN0) of the boot disk image, and the bootfile must be in contiguous sectors. BOOT reads LSN0, to locate the "bootfile", requests system memory for the size of the bootfile and loads it into RAM. All this disk access (disk reads) are done using a cut-down minimal disk driver (in the module boot_sdc).

Finally, BOOT sets up pointers in low memory to reference the bootfile and then returns to KRN2. JmpBoot walks through the module that make up the bootfile and validates them.

KRNP2 sets up more system calls, links to the CLOCK module, and calls it. CLOCK sets up some more system calls, starts multitasking, and returns to KRNP2. KRNP2 then does F$Chain of SYSGO. SYSGO used the device driver for the console boot device to display the OS revision name string and the installation name string (both of which were defined in INIT) and then displays the startup banner:

(C) 2014 The NitrOS-9 Project
**   DEVELOPMENT BUILD   **
** NOT FOR DISTRIBUTION! **
Tue Nov 24 22:30:56 2015
http://www.nitros9.org

Finally, SYSGO runs the 'startup' file through a shell. The (default) 'startup' file (level1/mc09/startup in the source tree) is responsible for displaying the message:

* Welcome to NitrOS-9 Level 1 on the Multicomp09 *

and for invoking the 'setime' command.

In conclusion, if you get the 'Boot' message and nothing more it means that your 'kernelfile' loaded and started up correctly, but it does not give you any useful diagnostic about where things went wrong.

The boot process is described in more detail (but without multicomp6809 specifics) here: https://nitros9.sourceforge.io/wiki/index.php/The_NitrOS-9_Boot_Process_Explained

Back to software overview.