[Coco] Bad Driver Combination?
Robert Gault
robert.gault at att.net
Sat Mar 10 20:25:03 EST 2012
K. Pruitt wrote:
> When I make a NitrOS9 boot disk using the no-halt driver for the Disto Super
> Controller II (rb1773_scii_ff74.dr) and the smartwatch driver (clock2_smart)
> together, the Coco 3 will crash instantly when the system tries to access the
> clock chip.
>
> Anyone else had this experience and is there a solution (other than not using
> the smart watch driver, which is the solution I am currently using)?
>
> Also, when I use the getclk utility to get the date/time from the chip, date -t
> reports the date as 1912. This is confusing to me because as far as I know the
> watch chip doesn't hold the century but rather only holds the year, and getclk
> doesn't seem to be passing a "19" to F$Time - at least not as far as I can tell
> from a disassembly of getclk. Where is this 19 coming from? Does NitrOS9 default
> to 19 in the absence of a century digit? Does the NitrOS9 F$Time system call use
> the same 6 digit scheme as the OS-9 version or does it actually have space for a
> century digit? I'm using Y2K updated modules in OS-9 so there it is not an
> issue, but under NitrOS9 that 19 always shows up.
>
> Thanks for any info you might pass on.
>
>
I'll start with the date issue as that ought to work correctly with the current
NitrOS-9 version.
Clock2_smart has some code that makes an assumption about the century. The year
is read from the clock chip which comes out as 0-99. The clock module assumes
that if the year is equal or greater than 50, then the actual year is 1950-1999.
If the year is less than 50, then the actual date is 2000-2049. As Gene
mentioned in another message, I don't expect any of us need to worry about dates
beyond 2049. :)
L006F dec ,s
bne L0050 get the next byte from clock
lda 1,x get year
cmpa #50 half-assed test for century
bhs c19
adda #100 make it 20th
c19 sta 1,x
Now the date command looks at the year value and tries to make sense of the
century. It checks to see if the year is 100 or greater and if so, sets the
century to 20xx else 19xx.
lda <sysyear get year
ldb #19-1 century in B
CntyLp incb add a century
suba #100 subtract 100 yrs
bhs CntyLp until yr<0
adda #100 restore year to 00-99 range
Remember that sysyear will be >100 if clock2_smart thinks the century is 20xx.
So if the year is 2012, then sysyear should be 112 and you will get:
regA=112
regB=18
incb regB=19
suba #100 regA=12
branch as regA>=0
incb regB=20
suba #100 regA=-88
regA<0
adda #100 regA=12
Now date prints out regB and then regA so you should see 2012.
================
I can work with you by private email to solve the SC-II + Smartwatch problem. I
believe the current code should work but I can easily generate custom modules
for you.
Is the Smartwatch installed in the Disto SC-II controller or another pak in your
MPI? Are you using any other modules that might reset the active MPI slot?
If we can't get the SC-II driver and clock2_smart modules to work, I can supply
the program swread which can be set to read the Smartwatch on call or say every
5 minutes. Then you just use clock2_soft.
Robert
More information about the Coco
mailing list