[Coco] Modifying Level1/coco1 for 6309 native mode
Robert Gault
robert.gault at att.net
Sun Jan 5 21:04:20 EST 2014
Since there have been requests for this and the challenge is interesting, I've
been looking at this problem. Here are initial results.
1) LWTools port of NitrOS-9 used for testing.
2) All level1/coco1 pertinent makefiles modified, for example
AFLAGS += -I$(LEVEL1)/modules
changed to
AFLAGS += -I$(LEVEL1)/modules -DH6309=1
or
AFLAGS += -DH6309=1
added. This will be necessary for defs, cmds, modules, and kernel.
The main coco1 makefile was modified:
CPU=6309
AFLAGS += -DH6309=1
Make sure that $(AFLAGS) gets added as needed to the makefiles or the H6309 will
be ignored.
3) It was necessary to modify level1/modules/rel.asm as native mode was not
initiated soon enough in level1, even though this source code is used for Level2
6309 and already contains one LDMD #$03.
start1 orcc #IntMasks turn off IRQ's
clr >PIA0Base+3 turn off SAM IRQ's
clra make A=0 for later
IFNE H6309
tfr 0,dp set direct page to $0000
ldmd #3 native mode !!!!!!!!!!!!!! new line
Start clr PIA0Base+3
IFNE (tano+d64+dalpha)
clr PIA0Base+1 added for Dragon, works on CoCo
ENDC
IFNE H6309 !!!!!!!!!!!!!!! 3 new lines
ldmd #3 native mode
ENDC
With the above changes, the boot process proceeds much father than without the
changes. The boot process without rel changes crashed at the first F$Link call.
The best way to test progress is with the MESS debugger. Use a version of MESS
that correctly handles coco emulation. Start coco3h (6309) emulation, as that
gives you the 6309 cpu and will run normal Level1 coco1 Nitros-9. Turn on the
MESS debugger and set a breakpoint at $2602. Enter the DOS command with your
test disk and the debugger will start as soon as rel starts running.
You should then tell MESS to start a trace, ex. trace 6309.log, and then leave
the debugger. The text file 6309.log will be generated which will make it easy
to spot where the boot process is crashing.
You can do the same thing with a normal coco1 6809 disk and compare a 6809.log
vs your 6309.log.
It would make things much easier if there are other programmers interested
enough to try this. We can compare notes and ideas. That could make Level1 6309
native mode a reality.
Robert
More information about the Coco
mailing list