Building NitrOS-9 on Mac OS X

Since I have to relearn all the steps, I thought I would post them as I go through them. The NitrOS-9 website has a tutorial on building it, but here are my steps with some specifically for Mac OS X:

  1. Install the Command Line Tools for Mac OS X.
    We need the command line versions of the Mac OS X compiler so we can build the tools that are then used to build NitrOS-9. If you have XCODE installed, you may already have them. An easy way to do this is from a Terminal prompt:

    xcode-select --install

    That will launch the Apple Mac App Store installer and get the tools for you. Cool.

    Installing the Mac OS X command line tools.

    Installing the Mac OS X command line tools.

  2. Download Mercurial.
    The NitrOS-9 repository uses Mercurial as version control. You will need to download Mercurial. I had 3.2 the last time I did this, and currently it looks like 3.8 is available. There are several ways to download it using various package managers (Fink, MacPorts, etc.) but I don’t have this installed so I am just using the standalone installer:
    https://www.mercurial-scm.org/wiki/Download
    Depending on your Mac OS X security settings, it may complain that this is from an unknown developer and refuse to run. If you get this message, go in to your System Preferences “Security & Privacy” control panel and tell it to allow the installer to run:
    Screenshot 2016-05-01 17.26.21(Strange. The last time I did this, “Open Anyway” would let me bypass the security settings I am using. This time, it refused, and I had to temporarily allow “Anywhere.” Not sure what’s up with that.) After the install, you will have the “hg” command available.
  3. Download LWTools. These are the cross-compiler tools used to build 6809 source code from Mac/Windows/Linux systems. From a Terminal prompt, find a directory you want to download the lwtools to. I chose a poor location — “CoCo” inside my Downloads folder:
    alsmbpro:lwtools allenh$ pwd
    /Users/allenh/Downloads/CoCo

    From this directory, use the “hg” command to obtain and build the tools. It will build the directory you specify from the command line (“lwtools”):

    hg clone http://lwtools.projects.l-w.ca/hg/ lwtools
    cd lwtools
    make
    sudo make install
    cd ..
  4. Build Toolshed.
    Next we want to build Toolshed. This is a series of command-line utilities that operate on CoCo/OS-9 disk images (like those used with emulators and the CoCoSDC interface). Once again, I do these steps from my “Downloads/CoCo” directory:

    hg clone http://hg.code.sf.net/p/toolshed/code toolshed
    cd toolshed
    sudo make -C build/unix install
    cd ..

    (Note: I had to use “sudo make…” here to get it to build on my system.) The different build/make process shows the different styles of the various developers that made these tools. (Note: Mine seems to fail looking for a command “markdown” at the very end. Not sure what this is, but it seems to be building HTML documentation or something.)

  5. Build NitrOS-9.
    Now we are ready to download and build NitrOS-9. Once again, I start in my “Downloads/CoCo” directory, and issue the following hg commands to download all the NitrOS-9 stuff:

    hg clone http://hg.code.sf.net/p/nitros9/code nitros9
    cd nitros9
    make dsk
    This will build absolutely everything, including tons of ports and disk images you likely do not want. (i.e., if you are only interested in a CoCo 3 6809 setup, why build all the CoCo 1/2 and Dragon versions, or any of the 6309 stuff?). I always build everything, but you can also specify to build just a specific port. For my CoCo 3/6309 build, I could do this instead:
    make dsk PORTS=coco3_6309

    After this, you will have all the sources, and have built all (or some) of the sample disk images for various types of hardware (CoCo 1/2, CoCo 3, 6809 or 6309, CoCoSDC controller versus floppy or IDE hard drive, etc.).

  6. Updating NitrOS-9 and the Tools.
    Later, if you want to update your sources, you can use this comment from the “nitros9” directory:

    hg pull
    hg update
    make dsk

    I do this occasionally to get the “latest and greatest.” You can do this for the other tools, too, by changing in to their directory then issuing the “pull” and “update”, then the appropriate make command.
    If you get a merge conflict because you changed something locally, you might see this:

    alsmbpro:nitros9 allenh$ hg update
    abort: outstanding merge conflicts

    You can use this command to see what files have been changed on your local repository that conflict with the master files. This happens if, for instance, you tweak a makefile or build list or source code:

    alsmbpro:nitros9 allenh$ hg resolve -l
    U 3rdparty/utils/tlindner/sdir.asm

    This reminded me that I already Tim’s “sdir” source code (for CoCoSDC) so enable built in help and such. I have to revert those changes if I want to update, or learn how to use the merge too… I forgot!

These steps should get you everything you need to begin playing with NitrOS-9 on a real CoCo with the CoCoSDC interface, or an emulator. If you plan to use real floppies, you can use toolshed utilities to format and then copy disk image .DSK files over to the physical floppy, but I don’t have any way to hook a 360K Floppy drive to my Mac so I have never done this. CoCoSDC is the way to go there ($40!).

More to come…

 

One thought on “Building NitrOS-9 on Mac OS X

  1. Pingback: CoCo Cross Development, part 2 – Vintage is the New Old

Leave a Reply