changeset 168:3a847d2b4492

Cobbler, OS9Gen and format are all hardware dependent.
author roug
date Thu, 11 Jul 2002 18:57:35 +0000
parents 51cb8573849f
children 2748e53f293c
files level1/cmds/cobbler.asm level1/cmds/cobbler_cc.asm level1/cmds/format.asm level1/cmds/format_d64.asm level1/cmds/os9gen.asm level1/cmds/os9gen_cc.asm
diffstat 6 files changed, 186 insertions(+), 168 deletions(-) [+]
line wrap: on
line diff
--- a/level1/cmds/cobbler.asm	Thu Jul 11 16:53:58 2002 +0000
+++ b/level1/cmds/cobbler.asm	Thu Jul 11 18:57:35 2002 +0000
@@ -5,7 +5,7 @@
 *
 * Ed.    Comments                                       Who YY/MM/DD
 * ------------------------------------------------------------------
-*  5     Original Microware distribution version
+*  5     Original Dragon Data distribution version
 
          nam   Cobbler
          ttl   Make a bootstrap file
@@ -20,15 +20,15 @@
 rev      set   $01
          mod   eom,name,tylg,atrv,start,size
 u0000    rmb   1
-u0001    rmb   3
-u0004    rmb   1
+DevFd    rmb   3
+BTLSN    rmb   1
 u0005    rmb   2
-u0007    rmb   2
-u0009    rmb   20
+BtSiz    rmb   2
+sttbuf   rmb   20
 u001D    rmb   2
 u001F    rmb   10
 u0029    rmb   2
-u002B    rmb   32
+devnam   rmb   32
 u004B    rmb   16
 u005B    rmb   1
 u005C    rmb   7
@@ -57,86 +57,86 @@
          fcb   C$LF 
          fcc   " This disk will not bootstrap."
          fcb   C$CR 
-L00F6    fcc   "OS9Boot "
+BfNam    fcc   "OS9Boot "
          fcb   $FF 
 start    equ   *
          clrb  
-         lda   #$2F
+         lda   #'/
          cmpa  ,x
-         lbne  L0237
+         lbne  Usage
          os9   F$PrsNam 
-         lbcs  L0237
-         lda   #$2F
+         lbcs  Usage
+         lda   #'/
          cmpa  ,y
-         lbeq  L0237
-         leay  <u002B,u
+         lbeq  Usage
+         leay  <devnam,u
 L011A    sta   ,y+
          lda   ,x+
          decb  
          bpl   L011A
          sty   <u0029
-         lda   #$40
+         lda   #'@
          ldb   #$20
          std   ,y++
-         leax  <u002B,u
-         lda   #$03
+         leax  <devnam,u
+         lda   #UPDAT.
          os9   I$Open   
-         sta   <u0001
-         lbcs  L0237
+         sta   <DevFd
+         lbcs  Usage
          ldx   <u0029
-         leay  >L00F6,pcr
-         lda   #$2F
+         leay  >BfNam,pcr
+         lda   #'/
 L0140    sta   ,x+
          lda   ,y+
          bpl   L0140
-         lda   <u0001
+         lda   <DevFd
          pshs  u
          ldx   #$0000
          ldu   #$0015   probably DD.BT
          os9   I$Seek   
          puls  u
          lbcs  Exit
-         leax  u0004,u
+         leax  BTLSN,u
          ldy   #$0005
          os9   I$Read    Read bootstrap sector + size = 5 bytes
          lbcs  Exit
-         ldd   <u0007
+         ldd   <BtSiz
          beq   L017B
-         leax  <u002B,u
+         leax  <devnam,u
          os9   I$Delete 
          clra  
          clrb  
-         sta   <u0004
+         sta   <BTLSN
          std   <u0005
-         std   <u0007
-         lbsr  L0261
-L017B    lda   #$02
-         ldb   #$03
-         leax  <u002B,u
+         std   <BtSiz
+         lbsr  UpLSN0
+L017B    lda   #WRITE.
+         ldb   #UPDAT.
+         leax  <devnam,u
          os9   I$Create 
          sta   <u0000
          lbcs  Exit
          ldd   >$0068
          subd  >$0066
          tfr   d,y
-         std   <u0007
+         std   <BtSiz
          ldx   >$0066
          lda   <u0000
          os9   I$Write  
          lbcs  Exit
-         leax  u0009,u
-         ldb   #$00
+         leax  sttbuf,u
+         ldb   #SS.OPT
          os9   I$GetStt 
          lbcs  Exit
          lda   <u0000
          os9   I$Close  
-         lbcs  L0237
+         lbcs  Usage
          pshs  u
          ldx   <u001D,u
          lda   <u001F,u
          clrb  
          tfr   d,u
-         lda   <u0001
+         lda   <DevFd
          os9   I$Seek   
          puls  u
          lbcs  Exit
@@ -145,13 +145,13 @@
          os9   I$Read   
          lbcs  Exit
          ldd   <u0063,u
-         lbne  L024C
+         lbne  Fragd
          ldb   <u005B,u
-         stb   <u0004
+         stb   <BTLSN
          ldd   <u005C,u
          std   <u0005
-         lbsr  L0261
-         lbsr  L0228
+         lbsr  UpLSN0
+         lbsr  SkLSN1
          leax  <u004B,u
          ldy   #$0100
          os9   I$Read   
@@ -159,30 +159,32 @@
          lda   ,x
          anda  #$3F
          eora  #$3F
-         bne   L025A
+         bne   NotAllo
          lda   $01,x
          eora  #$FF
-         bne   L025A
+         bne   NotAllo
          lda   $02,x
          anda  #$90
          eora  #$90
-         bne   L025A
-         ldx   #$F000
-         ldy   #$0F00
-         lda   <u0001
+         bne   NotAllo
+         ldx   #$F000    Address of kernel in RAM
+         ldy   #$0F00    Amount to write
+         lda   <DevFd
          os9   I$Write  
-         bcs   L0253
+         bcs   ETrack
          os9   I$Close  
          bcs   Exit
          clrb  
          bra   Exit
-L0228    pshs  u
-         lda   <u0001
+
+SkLSN1   pshs  u
+         lda   <DevFd
          ldx   #$0000
          ldu   #$0100
-         os9   I$Seek   
+         os9   I$Seek   Seek to allocation map at LSN 1
          puls  pc,u
-L0237    leax  >L0015,pcr
+
+Usage    leax  >L0015,pcr
 wrerr    pshs  b
          lda   #$02
          ldy   #$0100
@@ -190,23 +192,30 @@
          comb  
          puls  b
 Exit     os9   F$Exit   
-L024C    leax  >L00B6,pcr
+
+Fragd    leax  >L00B6,pcr
          clrb  
          bra   wrerr
-L0253    leax  >L004E,pcr
+
+ETrack   leax  >L004E,pcr
          clrb  
          bra   wrerr
-L025A    leax  >L006A,pcr
+*
+* Write warning
+NotAllo    leax  >L006A,pcr
          clrb  
          bra   wrerr
-L0261    pshs  u
+*
+* Update the identification sector on LSN 0
+*
+UpLSN0   pshs  u
          ldx   #$0000
-         ldu   #$0015
-         lda   <u0001
+         ldu   #$0015   probably DD.BT
+         lda   <DevFd
          os9   I$Seek   
          puls  u
          bcs   Exit
-         leax  u0004,u
+         leax  BTLSN,u
          ldy   #$0005
          os9   I$Write  
          bcs   Exit
--- a/level1/cmds/cobbler_cc.asm	Thu Jul 11 16:53:58 2002 +0000
+++ b/level1/cmds/cobbler_cc.asm	Thu Jul 11 18:57:35 2002 +0000
@@ -20,17 +20,17 @@
 rev      set   $01
          mod   eom,name,tylg,atrv,start,size
 u0000    rmb   1
-u0001    rmb   3
-u0004    rmb   1
+DevFd    rmb   3
+BTLSN    rmb   1
 u0005    rmb   2
-u0007    rmb   2
+BtSiz    rmb   2
 u0009    rmb   7
-u0010    rmb   3
+sttbuf   rmb   3
 u0013    rmb   17
 u0024    rmb   2
 u0026    rmb   10
 u0030    rmb   2
-u0032    rmb   32
+devnam   rmb   32
 u0052    rmb   16
 u0062    rmb   1
 u0063    rmb   7
@@ -55,131 +55,131 @@
          fcb   C$LF
          fcc   "on track 34 - this track"
          fcb   C$LF
-	 fcc   "not rewritten."
+         fcc   "not rewritten."
          fcb   C$CR
 L00CF    fcb   C$LF
          fcc   "Error - OS9boot file fragmented"
          fcb   C$CR
-L00F0    fcc   "OS9Boot "
+BfNam    fcc   "OS9Boot "
          fcb   $FF 
 
 start    equ   *
          clrb  
-         lda   #$2F
+         lda   #'/
          cmpa  ,x
-         lbne  L02CA
+         lbne  Usage
          os9   F$PrsNam 
-         lbcs  L02CA
-         lda   #$2F
+         lbcs  Usage
+         lda   #'/
          cmpa  ,y
-         lbeq  L02CA
-         leay  <u0032,u
+         lbeq  Usage
+         leay  <devnam,u
 L0114    sta   ,y+
          lda   ,x+
          decb  
          bpl   L0114
          sty   <u0030
-         lda   #$40
+         lda   #'@
          ldb   #$20
          std   ,y++
-         leax  <u0032,u
-         lda   #$03
+         leax  <devnam,u
+         lda   #UPDAT.
          os9   I$Open   
-         sta   <u0001
-         lbcs  L02CA
+         sta   <DevFd
+         lbcs  Usage
          ldx   <u0030
-         leay  >L00F0,pcr
-         lda   #$2F
+         leay  >BfNam,pcr
+         lda   #'/
 L013A    sta   ,x+
          lda   ,y+
          bpl   L013A
-         lda   <u0001
-         leax  <u0010,u
+         lda   <DevFd
+         leax  <sttbuf,u
          ldb   #$00
          os9   I$GetStt 
-         lbcs  L02DC
-         leax  <u0010,u
+         lbcs  Exit
+         leax  <sttbuf,u
          lda   <u0013,u
          bpl   L015E
          leax  >L006B,pcr
          clrb  
-         lbra  L02CE
-L015E    lda   <u0001
+         lbra  wrerr
+L015E    lda   <DevFd
          pshs  u
          ldx   #$0000
-         ldu   #$0015
+         ldu   #$0015   probably DD.BT
          os9   I$Seek   
          puls  u
-         lbcs  L02DC
-         leax  u0004,u
+         lbcs  Exit
+         leax  BTLSN,u
          ldy   #$0005
-         os9   I$Read   
-         lbcs  L02DC
-         ldd   <u0007
+         os9   I$Read    Read bootstrap sector + size = 5 bytes
+         lbcs  Exit
+         ldd   <BtSiz
          beq   L0193
-         leax  <u0032,u
+         leax  <devnam,u
          os9   I$Delete 
          clra  
          clrb  
-         sta   <u0004
+         sta   <BTLSN
          std   <u0005
-         std   <u0007
-         lbsr  L02F4
-L0193    lda   #$02
-         ldb   #$03
-         leax  <u0032,u
+         std   <BtSiz
+         lbsr  UpLSN0
+L0193    lda   #WRITE.
+         ldb   #UPDAT.
+         leax  <devnam,u
          os9   I$Create 
          sta   <u0000
-         lbcs  L02DC
+         lbcs  Exit
          ldd   >$0068
          subd  >$0066
          tfr   d,y
-         std   <u0007
+         std   <BtSiz
          ldx   >$0066
          lda   <u0000
          os9   I$Write  
-         lbcs  L02DC
-         leax  <u0010,u
-         ldb   #$00
+         lbcs  Exit
+         leax  <sttbuf,u
+         ldb   #SS.OPT
          os9   I$GetStt 
-         lbcs  L02DC
+         lbcs  Exit
          lda   <u0000
          os9   I$Close  
-         lbcs  L02CA
+         lbcs  Usage
          pshs  u
          ldx   <u0024,u
          lda   <u0026,u
          clrb  
          tfr   d,u
-         lda   <u0001
+         lda   <DevFd
          os9   I$Seek   
          puls  u
-         lbcs  L02DC
+         lbcs  Exit
          leax  <u0052,u
          ldy   #$0100
          os9   I$Read   
-         lbcs  L02DC
+         lbcs  Exit
          ldd   <u006A,u
-         lbne  L02DF
+         lbne  Fragd
          ldb   <u0062,u
-         stb   <u0004
+         stb   <BTLSN
          ldd   <u0063,u
          std   <u0005
-         lbsr  L02F4
-         lbsr  L02BB
+         lbsr  UpLSN0
+         lbsr  SkLSN1
          leax  <u0052,u
          ldy   #$0100
          os9   I$Read   
-         lbcs  L02CE
+         lbcs  wrerr
          leax  <u0052,u
          lda   <$4C,x
          bita  #$0F
          beq   L0273
-         lda   <u0001
+         lda   <DevFd
          pshs  u
          ldx   #$0002
          ldu   #$6400
-         os9   I$Seek   
+         os9   I$Seek      Jump to LSN 612
          puls  u
          leax  u0009,u
          ldy   #$0007
@@ -216,58 +216,64 @@
          bne   L02ED
          ora   #$FC
          sta   <$4E,x
-L028C    bsr   L02BB
+L028C    bsr   SkLSN1
          leax  <u0052,u
          ldy   #$0064
          os9   I$Write  
-         bcs   L02CE
+         bcs   wrerr
          pshs  u
          ldx   #$0002
          ldu   #$6400
-         os9   I$Seek   
+         os9   I$Seek   Jump to LSN 612
          puls  u
-         ldx   #$EF00
-         ldy   #$0F80
+         ldx   #$EF00    Address of kernel in RAM
+         ldy   #$0F80    Amount to write
          os9   I$Write  
-         bcs   L02E6
+         bcs   ETrack
          os9   I$Close  
-         bcs   L02CA
+         bcs   Usage
          clrb  
-         bra   L02DC
-L02BB    pshs  u
-         lda   <u0001
+         bra   Exit
+
+SkLSN1   pshs  u
+         lda   <DevFd
          ldx   #$0000
          ldu   #$0100
-         os9   I$Seek   
+         os9   I$Seek   Seek to allocation map at LSN 1
          puls  pc,u
-L02CA    leax  >L0015,pcr
-L02CE    pshs  b
+
+Usage    leax  >L0015,pcr
+wrerr    pshs  b
          lda   #$02
          ldy   #$0100
          os9   I$WritLn 
          comb  
          puls  b
-L02DC    os9   F$Exit   
-L02DF    leax  >L00CF,pcr
+Exit     os9   F$Exit   
+
+Fragd    leax  >L00CF,pcr
          clrb  
-         bra   L02CE
-L02E6    leax  >L004F,pcr
+         bra   wrerr
+
+ETrack   leax  >L004F,pcr
          clrb  
-         bra   L02CE
+         bra   wrerr
+
 L02ED    leax  >L008C,pcr
          clrb  
-         bra   L02CE
-L02F4    pshs  u
+         bra   wrerr
+
+UpLSN0   pshs  u
          ldx   #$0000
-         ldu   #$0015
-         lda   <u0001
+         ldu   #$0015   probably DD.BT
+         lda   <DevFd
          os9   I$Seek   
          puls  u
-         bcs   L02DC
-         leax  u0004,u
+         bcs   Exit
+         leax  BTLSN,u
          ldy   #$0005
          os9   I$Write  
-         bcs   L02DC
+         bcs   Exit
          rts   
          emod
 eom      equ   *
--- a/level1/cmds/format.asm	Thu Jul 11 16:53:58 2002 +0000
+++ b/level1/cmds/format.asm	Thu Jul 11 18:57:35 2002 +0000
@@ -768,7 +768,7 @@
          clra  
          os9   I$ReadLn 
          bcc   L052C
-         cmpa  #$D3
+         cmpa  #E$EOF
          bne   L0508
 L0525    leax  >Aborted,pcr
          lbra  L066D
--- a/level1/cmds/format_d64.asm	Thu Jul 11 16:53:58 2002 +0000
+++ b/level1/cmds/format_d64.asm	Thu Jul 11 18:57:35 2002 +0000
@@ -766,7 +766,7 @@
          clra  
          os9   I$ReadLn 
          bcc   L052F
-         cmpa  #$D3
+         cmpa  #E$EOF
          bne   L050B
 L0528    leax  >Aborted,pcr
          lbra  L0676
--- a/level1/cmds/os9gen.asm	Thu Jul 11 16:53:58 2002 +0000
+++ b/level1/cmds/os9gen.asm	Thu Jul 11 18:57:35 2002 +0000
@@ -32,7 +32,7 @@
          mod   eom,name,tylg,atrv,start,size
 u0000    rmb   2
 u0002    rmb   1
-u0003    rmb   1
+DevFd    rmb   1
 u0004    rmb   1
 u0005    rmb   1
 u0006    rmb   2
@@ -100,13 +100,13 @@
          decb  
          bpl   L0175
          sty   <u002F
-         lda   #$40
+         lda   #'@
          ldb   #$20
          std   ,y++
          leax  <u0031,u
          lda   #$03
          os9   I$Open   
-         sta   <u0003
+         sta   <DevFd
          lbcs  L035B
          ldx   <u002F
          leay  >L0143,pcr
@@ -131,7 +131,7 @@
          ldx   #$0000
          stx   <u0006
          ldu   #$4000
-         ldb   #$02
+         ldb   #SS.SIZ
          os9   I$SetStt 
          lbcs  L036C
          ldu   <u0000
@@ -180,7 +180,7 @@
          lda   <u0002
          ldx   #$0000
          ldu   <u0006
-         ldb   #$02
+         ldb   #SS.SIZ
          os9   I$SetStt 
          lbcs  L036C
          ldu   <u0000
@@ -190,7 +190,7 @@
          lda   <u0025,u
          clrb  
          tfr   d,u
-         lda   <u0003
+         lda   <DevFd
          os9   I$Seek   
          ldu   <u0000
          lbcs  L036C
@@ -200,7 +200,7 @@
          lbcs  L036C
          ldd   <u0069,u
          lbne  L036F
-         lda   <u0003
+         lda   <DevFd
          ldx   #$0000
          ldu   #$0015
          os9   I$Seek   
@@ -246,7 +246,7 @@
          std   <u000B
          ldx   #$0000
          ldu   #$0015
-         lda   <u0003
+         lda   <DevFd
          os9   I$Seek   
          ldu   <u0000
          lbcs  L036C
@@ -254,7 +254,7 @@
          ldy   #$0005
          os9   I$Write  
          lbcs  L036C
-         lbsr  L0376
+         lbsr  SkLSN1
          leax  <u0051,u
          ldy   #$0100
          os9   I$Read   
@@ -270,9 +270,9 @@
          anda  #$90
          eora  #$90
          lbne  L0385
-         ldx   #$F000
-         ldy   #$0F00
-         lda   <u0003
+         ldx   #$F000    Address of kernel in RAM
+         ldy   #$0F00    Amount to write
+         lda   <DevFd
          os9   I$Write  
          bcs   L0354
          os9   I$Close  
@@ -292,12 +292,14 @@
 L036F    leax  >L00FC,pcr
          clrb  
          bra   L035F
-L0376    pshs  u
-         lda   <u0003
+
+SkLSN1   pshs  u
+         lda   <DevFd
          ldx   #$0000
          ldu   #$0100
-         os9   I$Seek   
+         os9   I$Seek   Seek to allocation map at LSN 1
          puls  pc,u
+
 L0385    leax  >L00B0,pcr
          clrb  
          bra   L035F
--- a/level1/cmds/os9gen_cc.asm	Thu Jul 11 16:53:58 2002 +0000
+++ b/level1/cmds/os9gen_cc.asm	Thu Jul 11 18:57:35 2002 +0000
@@ -23,7 +23,7 @@
          mod   eom,name,tylg,atrv,start,size
 u0000    rmb   2
 u0002    rmb   1
-u0003    rmb   1
+DevFd    rmb   1
 u0004    rmb   1
 u0005    rmb   1
 u0006    rmb   2
@@ -128,7 +128,7 @@
          decb  
          bpl   L020E
          sty   <u003A
-         lda   #$40
+         lda   #'@
          ldb   #$20
          std   ,y++
          lda   #$01
@@ -136,7 +136,7 @@
          leax  <u003D,u
          lda   #$03
          os9   I$Open   
-         sta   <u0003
+         sta   <DevFd
          lbcs  L0503
          leax  <u001A,u
          ldb   #$00
@@ -171,7 +171,7 @@
          ldx   #$0000
          stx   <u0006
          ldu   #$3000
-         ldb   #$02
+         ldb   #SS.SIZ
          os9   I$SetStt 
          lbcs  L0514
          ldu   <u0000
@@ -194,7 +194,7 @@
          beq   L02E2
          lda   #$01
          lbsr  L0517
-         lda   <u0003
+         lda   <DevFd
          ldx   #$0000
          ldu   #$0000
          os9   I$Seek   
@@ -242,7 +242,7 @@
          lda   <u0002
          ldx   #$0000
          ldu   <u0006
-         ldb   #$02
+         ldb   #SS.SIZ
          os9   I$SetStt 
          lbcs  L0514
          ldu   <u0000
@@ -252,7 +252,7 @@
          lda   <u0030,u
          clrb  
          tfr   d,u
-         lda   <u0003
+         lda   <DevFd
          os9   I$Seek   
          ldu   <u0000
          lbcs  L0514
@@ -262,7 +262,7 @@
          lbcs  L0514
          ldd   >u0218,u
          lbne  L0577
-         lda   <u0003
+         lda   <DevFd
          ldx   #$0000
          ldu   #$0015
          os9   I$Seek   
@@ -328,7 +328,7 @@
          std   <u000B
          ldx   #$0000
          ldu   #$0015
-         lda   <u0003
+         lda   <DevFd
          os9   I$Seek   
          ldu   <u0000
          lbcs  L0514
@@ -345,7 +345,7 @@
          lda   <$4C,x
          bita  #$0F
          beq   L04AE
-         lda   <u0003
+         lda   <DevFd
          pshs  u
          ldx   #$0002
          ldu   #$6400
@@ -394,8 +394,8 @@
          ldu   #$6400
          os9   I$Seek   
          puls  u
-         ldx   #$EF00
-         ldy   #$0F80
+         ldx   #$EF00    Address of kernel in RAM
+         ldy   #$0F80    Amount to write
          os9   I$Write  
          bcs   L04FC
          os9   I$Close  
@@ -455,11 +455,12 @@
          clrb  
          bra   L0507
 L057E    pshs  u
-         lda   <u0003
+         lda   <DevFd
          ldx   #$0000
          ldu   #$0100
          os9   I$Seek   
          puls  pc,u
+
 L058D    leax  >L00F6,pcr
          clrb  
          lbra  L0507