<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Sun, 29 Oct 2006 21:16:42 +0000
From   : jgh@... (Jonathan Graham Harston)
Subject: Accessing GoMMC as a storage device

>Message-ID: <2e00544e0610260717v597dae42q7e03d4233a9dd298@...>
 
"adam colley" <hideki.adam@...> wrote:
> PS: If anyone has any technical information on the GoMMC, particularly
> the details one might need to go about patching other filesystems or
> writing ones own firmware, I'd be quite interested in hearing them,
 
You need to replce the code in your filing system that accesses
the media with calls to OSWORD &B0, see the file 'OswordB0' in the
documentation. In summary:
 
A=&B0
XY=>control block
XY?0  : &12 - Input control block length
XY?1  : &12 - Output control block length
XY?2  : &04 - Command "read/write current disk"
XY?3  : &00 to read, &01 to write
XY?4  : Return byte - Set to &01 on entry. Supported calls will
       return &00. Unsupported calls will return &01 or leave left
       set to &01.
XY?5  : Extra return byte
XY!6  : Address
XY!10 : Disk byte address
XY!14 : Number of bytes
 
Frinstance, HADFS does:
\ ------------
\ GoMMC DRIVER
\ ------------
\ Daddr-6=>Osword &B0 control block
\ Daddr!0=address
\ Daddr!5=sector number
\ Daddr?9=number of sectors
\ action=&00/&FF for read/write
.DiskMMC                                 :\ GoMMC driver
LDY #0
STY Daddr+11:STY Daddr+10:STY Daddr+8    :\ Length=&0000nn00
STY Daddr+4:INY:STY Daddr-1              :\ MMCaddr=&xxxxxx00
LDA action:AND #1:STA Daddr-3            :\ Command 0/1 for read/write
LDA #&03:STA Daddr-4
LDA #&12:STA Daddr-5:STA Daddr-6         :\ Fill rest of control block
LDX #(Daddr-6)AND255:LDA #&B0:JSR OswordY:\ Call MMC driver
LDA Daddr-1:CMP #&01:BEQ MMCabsent       :\ Not found
LDA num:JSR UpdateScAd:LDA #0:RTS        :\ Return OK
.MMCabsent
LDA #&FE:RTS                             :\ Return DriveAbsent
 
-- 
JGH
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>