[Coco] NitrOS9 and 6309 code
Jeff Teunissen
deek at d2dc.net
Fri May 10 23:03:27 EDT 2019
The other day, I noticed that there were a number of modules included in my
NitrOS9/6309 installation were marked as 6809 object code. For about two
seconds, I wondered if it meant that something had gone wrong in the build
system and I was actually running the 6809 version, but a quick 'ident' on
the bootfile disavowed me of that notion.
At this point, I figured that the 6309-marked modules were the ones that
wouldn't run on a Motorola chip (hey, cool, an opportunity to do some
hacking myself), but then while reading some of the source code I saw that
some of those modules (Basic09, gshell) indeed HAD 6309 code in them, but
were still marked as suitable for a Moto system. OK, fair enough, I can fix
that.
Imagine my surprise when, having changed the module type of gshell from
Objct to Obj6309 and transferring the resulting module to my CoCo, it
suddenly started failing with Error #234 (Non-existent Module), and
wouldn't work until I changed it back.
What gives? I was under the impression that there were two flags denoting
code for Hitachi CPUs -- Obj6309, intended to prevent the code from
accidentally running on a Motorola CPU, and ModNat, intended to tell the
kernel to save and restore the extra registers when context switching. But
if that's true, shouldn't they work identically on a Hitachi system as long
as I don't set ModNat in the second field?
More information about the Coco
mailing list