Skip to content

Writing your first C Program for NitrOS‐9

Andrew Diller edited this page Oct 5, 2024 · 4 revisions

Building Hello World in C

Equipment:

  • Macintosh running OSX

    • will run the c compiler (cmoc)
    • will host the DriveWire server
  • Foenix 256x (jr or K) with 6809 CPU and Nitros9 installed

Software:

Building Tools

  • download and they should compile with OSX command-line-tools, make, sudo make install etc...
  • drivewire server requires Xcode, so make sure you have it downloaded. It runs on the latest, 16 in Sequoia.

Builing OS9 Apps

Create the input file:

#include <cmoc.h>

main()
	{printf("hello world\n");}

Compile and link it:

$ cmoc -v
cmoc (cmoc 0.1.86)

$ cmoc --os9 hello.c

Prepare a disk to host with drivewire:

/usr/local/bin/os9 format hello.dsk

/usr/local/bin/os9 copy hello hello.dsk,hello

/usr/local/bin/os9 attr -epe hello.dsk,hello

/usr/local/bin/os9 dump hello

/usr/local/bin/os9 ident hello

Hosting and Running the App

  • mount hello.dsk in DriveWire Server (xcode app- run xcode, load project and then run it)

  • Connect Macintosh to Foenix via USB to Serial Adapter

  • boot F256, dir /x0 and you should see your hello program on the hosted disk image.

To Do:

  • Directions on how to host your apps on FujiNet Drivewire!