[Coco] Reboot problem with latest NitrOS-9 build
Robert Gault
robert.gault at att.net
Sun Mar 18 08:04:25 EDT 2012
Boisy G. Pitre wrote:
> Robert,
>
> I think this is due to the work that Brett Gordon did to boot the OS using CoCoBoot. I noticed this behavior too.
>
> I've been unable to get hold of Brett. He hasn't been answering his emails.
> --
> Boisy G. Pitre
> http://www.tee-boy.com/
>
Boisy,
In case you are not receiving my direct email, take a look at the source code in
clock2_smart.
A1 tst ,x+
beq A2 found free page so go
incb update page counter
bpl A1 still in RAM only, then go
A2 pshs b save page #
andb #%11100000 modulo MMU blocks
lsrb convert to DAT byte value
lsrb page# * $100 / $2000 = MMU #
lsrb $2000/$100=$20 at 2 bytes per MMU
lsrb then page#/$10 gives answer
ldd b,y get the MMU value
cmpd #$333E is DAT unused
pshs cc save answer
inc 1,s update page # for a used page
puls cc,b get back answer and page #
beq A1 if unused keep going
lda #RAMinUse
sta ,-x flag the memory in use
stb <D.SWPage keep the info for Read
There is some logic here that escapes me. Why after finding a free page and that
it is unused, does the above code keep looping? Worse still, why is the page
value always updated, regardless of the $333E test?
I've found through testing that new logic is needed to correct for the
combination of clock2_smart and the Disto no-Halt drivers. It is crucial to
preserve the page #.
A1 tst ,x+
beq A2 found free page so go
A6 incb update page counter
bpl A1 still in RAM only, then go
A4 lda #2 can't find RAM only memory
leax mem_mes,pcr
ldy #40
os9 I$WritLn
puls d,x,y,u,pc
A2 pshs b save page #
andb #%11100000 modulo MMU blocks
lsrb convert to DAT byte value
lsrb page# * $100 / $2000 = MMU #
lsrb $2000/$100=$20 at 2 bytes per MMU
lsrb then page#/$10 gives answer
ldd b,y get the MMU value
cmpd #$333E is DAT unused
* pshs cc save answer
* inc 1,s update page # for a used page
* puls cc,b get back answer and page #
puls b get back page#
* beq A1
beq A6 if unused keep going
lda #RAMinUse
sta ,-x flag the memory in use
stb <D.SWPage keep the info for Read
Now the page# increases only if the $333E test fails. I still don't understand
why we need a free page with used DAT.
More information about the Coco
mailing list