[Coco] 6309 running in a Coco 1

Robert Gault robert.gault at att.net
Fri Jan 3 10:45:43 EST 2014


Luis Antoniosi (CoCoDemus) wrote:
> I tried building a coco1 6309 now and after fixing few syntax errors
> (maybe mamou wasn't so assertive) the system will hang on boot. I
> tried on mess coco3h. Can't test on real hardware as I'm bed ridden
> for a while. As Xmas gift I broke my ankle...i might be naughty :(
>

Luis,

It is not surprising that coco1 6309 version hung. Ignoring other issues 
regarding coco1 video at 2MHz that are not relevant here, the coco1 code 
particularly in the kernel does not correctly handle stack stuffing.
To be more precise, the extra registers in 6309 native mode change the content 
of the stack when all registers are pushed.

6809     6309
cc       cc
a        a
b        b
dp       e
x        f
y        dp
u        x
pc       y
..       u
..       pc

So the 6809 stack has 12 bytes and the 6309 native has 14. OS-9 frequently will 
transfer user stacks to system modules, change the contents, and return the 
stack to the user. The Level1 code has not been written to compensate for the 
location of registers. It is also written "hard coded" such as std 4,s instead 
of std R$X,s which means you won't get a correction just by setting a 6309 flag 
in a makefile.
All the kernel files in level1/module/kernel need to revised to accommodate the 
6309 native mode. Some of the other modules very likely must be rewritten. At 
the very least, all stack stuffing routines and all routines using rti will need 
to be checked.

Robert




More information about the Coco mailing list