Go Back One

 
Presented by: Only On Saturday Night

 
  • Notes for NitrOS-9: 
  • I replaced the BOOT module in the track-34 data packet. 
    • This BOOT module boots directly to IDE, in 8-bit LBA mode. 
    • Use KUtil to do the BOOT replacement. 
    • Use BUtil to check it's correctness.
  • Do, COBBLER -K /DD (or /H0) 
    • That puts the file OS9Boot on your root device. (IDE) 
    • Now you can test the floppy disk with the new BOOT. 
  • Remember, the OS9Boot file must be on the root device !!!
    • This process only gets the old track-34 out.
    • Then jumps to the IDE for OS9Boot.
    • Floppy drive not needed at all. (for booting)
  If the OS9BOOT file is fragmented, keep COBBLER'ing until it isn't.
  • Patch the cc3-rom where the picture is, $C405 to $D604. 
    • With the track-34 data packet. 
    • That's roughly $1200 bytes of data. 
  • Patch the cc3 picture mover code. 
    • There's plenty of room to do it 6809 style, also. 

 
c1f0 :                       BOOTIDE - FOR OS9 (6809)
                             ;  FFDE = Map RAM/ROM
                             ;  FFDF =     all RAM
c1f0 : b7ffde           [ 4]  sta  $FFDE    ; RomRam Mode
c1f3 : 8ec405           [ 3]  ldx  #Picture
c1f6 : 108e2600         [ 4]  ldy  #$2600
c1fa :                       Loop
c1fa : ec81             [ 8]  ldd  ,x++ 
c1fc : ee81             [ 8]  ldu  ,x++
c1fe : eda1             [ 8]  std  ,y++
c200 : efa1             [ 8]  stu  ,y++
c202 : 8cd605           [ 3]  cmpx #$D605   ; end of track-34 +++
c205 : 25f3             [ 3]  bcs  Loop
c207 : b7ffdf           [ 4]  sta  $FFDF    ; AllRam Mode
c20a : 7e2602           [ 3]  jmp  $2602    ; just like the DOS command

 
c1f0 :                       BOOTIDE - For NitrOS-9 (6309)
                             ;  FFDE = Map RAM/ROM
                             ;  FFDF =     all RAM
c1f0 : B7FFDE           [ 4]  sta  $FFDE        ; go to RomRam mode
c1f3 : 10861200         [ 4]  ldw  #$D605-$C405 ; length
c1f7 : 8EC405           [ 3]  ldx  #C405        ; from here
c1fa : 108E2600         [ 4]  ldy  #$2600       ; to here
c1fe : 113812           [  ]  tfm  x+,y+        ; move track-34
c201 : B7FFDF           [ 4]  sta  $FFDF        ; go to AllRam mode
c204 : 7E2602           [ 3]  jmp  $2602        ; just like the DOS command
It boots really fast!
Thanks to: Alan DeKok
         nam   Boot 8-bit LBA Mode Only!
         ttl   NitrOS-9 System Module 

* Disassembled 94/06/25 11:37:47 by Alan DeKok
* ReDone by Paul T. Barton 99/08/17, for 8-bit IDE
*
* Uses only the low 8-bits of each 16-bit sector.
*
Port     equ $FF70 still leaves room for SSPak & SSP & MPI
Status   equ 0 Results of read/write
CmdIde   equ 0 Commands
DevHead  equ 1 0,1,0,DEV,0,0,0,0
CylHigh  equ 2
CylLow   equ 3
SecNum   equ 4
SecCnt   equ 5 always =1
ErrReg   equ 6 Has the errors
RData    equ 7 data 0..7
WData    equ 7 data 0..7

ReadCmd  equ $20
Diagnos  equ $90

BusyBit  equ %10000000 BUSY=1
DrdyBit  equ %01000000 drive ready=1
DscBit   equ %00010000 seek finished=1
DrqBit   equ %00001000 data requested=1
ErrBit   equ %00000001 error_reg has it
RdyTrk   equ %01010000 ready & over track
RdyDrq   equ %01011000 ready w/ data
Master   equ %01000000 LBA MODE

         ifp1
         use   /dd/defs/os9defs
         use   /dd/defs/rbfdefs
         use   /dd/defs/6809defs
         endc

tylg     set   Systm+Obj6309
atrv     set   ReEnt+rev
rev      set   $02

         mod   eom,name,tylg,atrv,start,size

* on-stack buffer to use
         org   0
size     equ   .

name     equ   *
         fcs   /Boot/
         fcb   $06 

start    orcc  #$50       ensure IRQ's are off.
         pshs  x,d        save 4 bytes of junk
R.D      equ   0
R.X      equ   2

         clr   >$FF40     stop the disk
         lbsr  Init

         ldd   #$0001     request one byte (will round up to 1 page)
         os9   F$SRqMem   request the memory
         bcs   L00AE      exit on error

* U is implicitely the buffer address to use

         ldx   #$0000     X=0: got to sector #$0000
         bsr   GetSect    load in LSN0, U = buffer start
         bcs   L00AE

         lda   #'0        --- loaded in LSN0
         jsr   <D.BtBug   ---

         ldd   <DD.BSZ,u  size of the bootstrap file
         std   R.D,s      save it on the stack (0,s is junk)
         ldx   <DD.BT+1,u get starting sector of the bootstrap file
         pshs  x          save the starting sector number

         ldd   #256       one page of memory
         os9   F$SRtMem   return the copy of LSN0 to free memory

         ldd   R.X,s      get size of boot memory to request
         os9   F$BtMem    ask for the boot memory
         puls  x          restore the starting sector number
         bcs   L00AE      no memory: exit with error

         stu   R.X,s      save start address of memory allocated
         ldd   R.D,s      and the size of the boot memory
         beq   L00A7      if no memory allocated, exit

SectLp
         pshs  x,d        save sector #, size of boot
         bsr   GetSect    read one sector
         bcs   L00AC      if there's an error, exit

         lda   #'.        dump out a period for boot debugging
         jsr   <D.BtBug   do the debug stuff
         puls  x,d        restor sector, size of boot

         leau  256,u
         leax  1,x        go to the next sector
         subd  #256       take out one sector, need value in B, too.
         bhi   SectLp     loop until all sectors are read

L00A7    clrb             clear carry
         puls  d          return size of boot memory to user
         bra   L00B0      and go exit

L00AC    leas  $04,s      remove X,D off of stack
L00AE    leas  $02,s      kill D off of the stack

L00B0    puls  x          restore start address of memory allocated
*        leas  size,s     remove the on-stack buffer
L00BA    rts 

* GetSect: read a sector off of the disk
* Entry: X = sector number to read
* Memory: U = where to put it
*
* Uses only the low 8-bits of each 16-bit sector.

GetSect
 pshs y
 ldy  <Address,pcr grab the device address
 bsr  ChkBusy

RdyHuh1
 lda  Status,y  is IDE ready for commands?
 anda #DrdyBit  ready ?
 beq  RdyHuh1   loop until Drdy =1

 lda  #Master
 sta  DevHead,y 0L0d/0hhh device=LBA
 ldd  #$0100    only one at a time
 sta  SecCnt,y  only one at a time
 stb  CylHigh,y bits 23-16
 tfr  x,d       sector number to read
 sta  CylLow,y  hi-byte
 stb  SecNum,y
 leax ,u        where to put the sector
 clrb           256-bytes counter
 lda  #ReadCmd  command to read one sector
 sta  CmdIde,y  finish process

Blk2
 lda  Status,y  is IDE ready to send?
 anda #DrqBit   DRQ, data request
 beq  Blk2      loop while DRQ =0

BlkLp
 lda  RData,y   A <- IDE (8-bits only)
 sta  ,x+       into RAM
 decb           256 each 8-bit xfers
 bne  BlkLp     go get the rest

 lda  Status,y  check for error-bit
 clrb
 puls y,pc
* ------------------------------------------

ChkBusy
 lda  Status,y
 anda #BusyBit  1xxx-xxxx
 bne  ChkBusy   if =1 then loop
 rts            exit when BUSY =0

Init
 pshs d,y
 ldy  <Address,pcr
 bsr  ChkBusy    could be spinning up...
 lda  #Diagnos   hits all drives
 sta  CmdIde,y   ./
 bsr  ChkBusy    wait 'til both done
 clrb            no errors
 puls d,y,pc

Address  fdb     Port

 fcb  0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
 fcb  0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
 fcb  0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
 fcb  0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
 fcb  0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
 fcb  0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
 fcb  0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
 fcb  0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
 fcb  0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
 fcb  0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
 fcb  0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
 fcb  0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
 fcb  0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
 fcb  0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
 fcb  0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
 fcb  0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
 fcb  0,1,2,3,4,5,6,7,8,9

         emod
eom      equ   *
 

Hosted by www.Geocities.ws

1