changeset 172:1cd7548b534f

Moved dragon64 specific commands to have _d64 as part of name, CoCo commands are just command name
author boisy
date Thu, 11 Jul 2002 21:34:55 +0000
parents e2a68a0ff6f5
children 9fa777d31266
files level1/cmds/cobbler.asm level1/cmds/cobbler_d64.asm level1/cmds/os9gen.asm level1/cmds/os9gen_d64.asm
diffstat 4 files changed, 965 insertions(+), 218 deletions(-) [+]
line wrap: on
line diff
--- a/level1/cmds/cobbler.asm	Thu Jul 11 21:28:09 2002 +0000
+++ b/level1/cmds/cobbler.asm	Thu Jul 11 21:34:55 2002 +0000
@@ -5,12 +5,12 @@
 *
 * Ed.    Comments                                       Who YY/MM/DD
 * ------------------------------------------------------------------
-*  5     Original Dragon Data distribution version
+* 5      Original Tandy distribution version
 
          nam   Cobbler
          ttl   Make a bootstrap file
 
-* Disassembled 02/04/03 23:11:02 by Disasm v1.6 (C) 1988 by RML
+* Disassembled 02/07/06 23:26:00 by Disasm v1.6 (C) 1988 by RML
 
          ifp1
          use   defsfile
@@ -24,41 +24,45 @@
 BTLSN    rmb   1
 u0005    rmb   2
 BtSiz    rmb   2
-sttbuf   rmb   20
-u001D    rmb   2
-u001F    rmb   10
-u0029    rmb   2
+u0009    rmb   7
+sttbuf   rmb   3
+u0013    rmb   17
+u0024    rmb   2
+u0026    rmb   10
+u0030    rmb   2
 devnam   rmb   32
-u004B    rmb   16
-u005B    rmb   1
-u005C    rmb   7
-u0063    rmb   682
+u0052    rmb   16
+u0062    rmb   1
+u0063    rmb   7
+u006A    rmb   432
 size     equ   .
 name     equ   *
          fcs   /Cobbler/
          fcb   $05 
-L0015    fcb   C$LF 
-         fcc   "Use: Cobbler </devname>"
-         fcb   C$LF 
-         fcc   "    to create a new system disk"
-         fcb   C$CR 
-L004E    fcb   C$LF 
+L0015    fcb   C$LF
+         fcc   "Use: COBBLER </devname>"
+         fcb   C$LF
+         fcc   "     to create a new system disk"
+         fcb   C$CR
+L004F    fcb   C$LF
          fcc   "Error writing kernel track"
-         fcb   C$CR 
-L006A    fcb   C$LF 
-         fcc   "Warning - Kernel track has"
-         fcb   C$LF 
-         fcc   "not been allocated properly."
-         fcb   C$LF 
-         fcc   "Track not written."
-         fcb   C$CR 
-L00B6    fcb   C$LF 
+         fcb   C$CR
+L006B    fcb   C$LF
+         fcc   "Error - cannot gen to hard disk"
+         fcb   C$CR
+L008C    fcb   C$LF
+         fcc   "Warning - file(s) present"
+         fcb   C$LF
+         fcc   "on track 34 - this track"
+         fcb   C$LF
+         fcc   "not rewritten."
+         fcb   C$CR
+L00CF    fcb   C$LF
          fcc   "Error - OS9boot file fragmented"
-         fcb   C$LF 
-         fcc   " This disk will not bootstrap."
-         fcb   C$CR 
+         fcb   C$CR
 BfNam    fcc   "OS9Boot "
          fcb   $FF 
+
 start    equ   *
          clrb  
          lda   #'/
@@ -70,11 +74,11 @@
          cmpa  ,y
          lbeq  Usage
          leay  <devnam,u
-L011A    sta   ,y+
+L0114    sta   ,y+
          lda   ,x+
          decb  
-         bpl   L011A
-         sty   <u0029
+         bpl   L0114
+         sty   <u0030
          lda   #'@
          ldb   #$20
          std   ,y++
@@ -83,13 +87,24 @@
          os9   I$Open   
          sta   <DevFd
          lbcs  Usage
-         ldx   <u0029
+         ldx   <u0030
          leay  >BfNam,pcr
          lda   #'/
-L0140    sta   ,x+
+L013A    sta   ,x+
          lda   ,y+
-         bpl   L0140
+         bpl   L013A
          lda   <DevFd
+         leax  <sttbuf,u
+         ldb   #$00
+         os9   I$GetStt 
+         lbcs  Exit
+         leax  <sttbuf,u
+         lda   <u0013,u
+         bpl   L015E
+         leax  >L006B,pcr
+         clrb  
+         lbra  wrerr
+L015E    lda   <DevFd
          pshs  u
          ldx   #$0000
          ldu   #$0015   probably DD.BT
@@ -101,7 +116,7 @@
          os9   I$Read    Read bootstrap sector + size = 5 bytes
          lbcs  Exit
          ldd   <BtSiz
-         beq   L017B
+         beq   L0193
          leax  <devnam,u
          os9   I$Delete 
          clra  
@@ -110,7 +125,7 @@
          std   <u0005
          std   <BtSiz
          lbsr  UpLSN0
-L017B    lda   #WRITE.
+L0193    lda   #WRITE.
          ldb   #UPDAT.
          leax  <devnam,u
          os9   I$Create 
@@ -124,7 +139,7 @@
          lda   <u0000
          os9   I$Write  
          lbcs  Exit
-         leax  sttbuf,u
+         leax  <sttbuf,u
          ldb   #SS.OPT
          os9   I$GetStt 
          lbcs  Exit
@@ -132,48 +147,91 @@
          os9   I$Close  
          lbcs  Usage
          pshs  u
-         ldx   <u001D,u
-         lda   <u001F,u
+         ldx   <u0024,u
+         lda   <u0026,u
          clrb  
          tfr   d,u
          lda   <DevFd
          os9   I$Seek   
          puls  u
          lbcs  Exit
-         leax  <u004B,u
+         leax  <u0052,u
          ldy   #$0100
          os9   I$Read   
          lbcs  Exit
-         ldd   <u0063,u
+         ldd   <u006A,u
          lbne  Fragd
-         ldb   <u005B,u
+         ldb   <u0062,u
          stb   <BTLSN
-         ldd   <u005C,u
+         ldd   <u0063,u
          std   <u0005
          lbsr  UpLSN0
          lbsr  SkLSN1
-         leax  <u004B,u
+         leax  <u0052,u
          ldy   #$0100
          os9   I$Read   
+         lbcs  wrerr
+         leax  <u0052,u
+         lda   <$4C,x
+         bita  #$0F
+         beq   L0273
+         lda   <DevFd
+         pshs  u
+         ldx   #$0002
+         ldu   #$6400
+         os9   I$Seek      Jump to LSN 612
+         puls  u
+         leax  u0009,u
+         ldy   #$0007
+         os9   I$Read   
+         lbcs  L02ED
+         leax  u0009,u
+         ldd   ,x
+         cmpa  #$4F
+         lbne  L02ED
+         cmpb  #$53
+         lbne  L02ED
+         lda   $04,x
+         cmpa  #$12
+         beq   L025C
+         lda   <$4E,x
+         bita  #$1C
+         lbne  L02ED
+L025C    lda   <$4C,x
+         ora   #$0F
+         sta   <$4C,x
+         lda   #$FF
+         sta   <$4D,x
+         lda   <$4E,x
+         ora   #$FC
+         sta   <$4E,x
+         bra   L028C
+L0273    ora   #$0F
+         sta   <$4C,x
+         tst   <$4D,x
+         bne   L02ED
+         com   <$4D,x
+         lda   <$4E,x
+         bita  #$FC
+         bne   L02ED
+         ora   #$FC
+         sta   <$4E,x
+L028C    bsr   SkLSN1
+         leax  <u0052,u
+         ldy   #$0064
+         os9   I$Write  
          bcs   wrerr
-         lda   ,x
-         anda  #$3F
-         eora  #$3F
-         bne   NotAllo
-         lda   $01,x
-         eora  #$FF
-         bne   NotAllo
-         lda   $02,x
-         anda  #$90
-         eora  #$90
-         bne   NotAllo
-         ldx   #$F000    Address of kernel in RAM
-         ldy   #$0F00    Amount to write
-         lda   <DevFd
+         pshs  u
+         ldx   #$0002
+         ldu   #$6400
+         os9   I$Seek   Jump to LSN 612
+         puls  u
+         ldx   #$EF00    Address of kernel in RAM
+         ldy   #$0F80    Amount to write
          os9   I$Write  
          bcs   ETrack
          os9   I$Close  
-         bcs   Exit
+         bcs   Usage
          clrb  
          bra   Exit
 
@@ -193,21 +251,18 @@
          puls  b
 Exit     os9   F$Exit   
 
-Fragd    leax  >L00B6,pcr
+Fragd    leax  >L00CF,pcr
          clrb  
          bra   wrerr
 
-ETrack   leax  >L004E,pcr
+ETrack   leax  >L004F,pcr
          clrb  
          bra   wrerr
-*
-* Write warning
-NotAllo    leax  >L006A,pcr
+
+L02ED    leax  >L008C,pcr
          clrb  
          bra   wrerr
-*
-* Update the identification sector on LSN 0
-*
+
 UpLSN0   pshs  u
          ldx   #$0000
          ldu   #$0015   probably DD.BT
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/level1/cmds/cobbler_d64.asm	Thu Jul 11 21:34:55 2002 +0000
@@ -0,0 +1,224 @@
+********************************************************************
+* Cobbler - Make a bootstrap file
+*
+* $Id$
+*
+* Ed.    Comments                                       Who YY/MM/DD
+* ------------------------------------------------------------------
+*  5     Original Dragon Data distribution version
+
+         nam   Cobbler
+         ttl   Make a bootstrap file
+
+* Disassembled 02/04/03 23:11:02 by Disasm v1.6 (C) 1988 by RML
+
+         ifp1
+         use   defsfile
+         endc
+tylg     set   Prgrm+Objct   
+atrv     set   ReEnt+rev
+rev      set   $01
+         mod   eom,name,tylg,atrv,start,size
+u0000    rmb   1
+DevFd    rmb   3
+BTLSN    rmb   1
+u0005    rmb   2
+BtSiz    rmb   2
+sttbuf   rmb   20
+u001D    rmb   2
+u001F    rmb   10
+u0029    rmb   2
+devnam   rmb   32
+u004B    rmb   16
+u005B    rmb   1
+u005C    rmb   7
+u0063    rmb   682
+size     equ   .
+name     equ   *
+         fcs   /Cobbler/
+         fcb   $05 
+L0015    fcb   C$LF 
+         fcc   "Use: Cobbler </devname>"
+         fcb   C$LF 
+         fcc   "    to create a new system disk"
+         fcb   C$CR 
+L004E    fcb   C$LF 
+         fcc   "Error writing kernel track"
+         fcb   C$CR 
+L006A    fcb   C$LF 
+         fcc   "Warning - Kernel track has"
+         fcb   C$LF 
+         fcc   "not been allocated properly."
+         fcb   C$LF 
+         fcc   "Track not written."
+         fcb   C$CR 
+L00B6    fcb   C$LF 
+         fcc   "Error - OS9boot file fragmented"
+         fcb   C$LF 
+         fcc   " This disk will not bootstrap."
+         fcb   C$CR 
+BfNam    fcc   "OS9Boot "
+         fcb   $FF 
+start    equ   *
+         clrb  
+         lda   #'/
+         cmpa  ,x
+         lbne  Usage
+         os9   F$PrsNam 
+         lbcs  Usage
+         lda   #'/
+         cmpa  ,y
+         lbeq  Usage
+         leay  <devnam,u
+L011A    sta   ,y+
+         lda   ,x+
+         decb  
+         bpl   L011A
+         sty   <u0029
+         lda   #'@
+         ldb   #$20
+         std   ,y++
+         leax  <devnam,u
+         lda   #UPDAT.
+         os9   I$Open   
+         sta   <DevFd
+         lbcs  Usage
+         ldx   <u0029
+         leay  >BfNam,pcr
+         lda   #'/
+L0140    sta   ,x+
+         lda   ,y+
+         bpl   L0140
+         lda   <DevFd
+         pshs  u
+         ldx   #$0000
+         ldu   #$0015   probably DD.BT
+         os9   I$Seek   
+         puls  u
+         lbcs  Exit
+         leax  BTLSN,u
+         ldy   #$0005
+         os9   I$Read    Read bootstrap sector + size = 5 bytes
+         lbcs  Exit
+         ldd   <BtSiz
+         beq   L017B
+         leax  <devnam,u
+         os9   I$Delete 
+         clra  
+         clrb  
+         sta   <BTLSN
+         std   <u0005
+         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   <BtSiz
+         ldx   >$0066
+         lda   <u0000
+         os9   I$Write  
+         lbcs  Exit
+         leax  sttbuf,u
+         ldb   #SS.OPT
+         os9   I$GetStt 
+         lbcs  Exit
+         lda   <u0000
+         os9   I$Close  
+         lbcs  Usage
+         pshs  u
+         ldx   <u001D,u
+         lda   <u001F,u
+         clrb  
+         tfr   d,u
+         lda   <DevFd
+         os9   I$Seek   
+         puls  u
+         lbcs  Exit
+         leax  <u004B,u
+         ldy   #$0100
+         os9   I$Read   
+         lbcs  Exit
+         ldd   <u0063,u
+         lbne  Fragd
+         ldb   <u005B,u
+         stb   <BTLSN
+         ldd   <u005C,u
+         std   <u0005
+         lbsr  UpLSN0
+         lbsr  SkLSN1
+         leax  <u004B,u
+         ldy   #$0100
+         os9   I$Read   
+         bcs   wrerr
+         lda   ,x
+         anda  #$3F
+         eora  #$3F
+         bne   NotAllo
+         lda   $01,x
+         eora  #$FF
+         bne   NotAllo
+         lda   $02,x
+         anda  #$90
+         eora  #$90
+         bne   NotAllo
+         ldx   #$F000    Address of kernel in RAM
+         ldy   #$0F00    Amount to write
+         lda   <DevFd
+         os9   I$Write  
+         bcs   ETrack
+         os9   I$Close  
+         bcs   Exit
+         clrb  
+         bra   Exit
+
+SkLSN1   pshs  u
+         lda   <DevFd
+         ldx   #$0000
+         ldu   #$0100
+         os9   I$Seek   Seek to allocation map at LSN 1
+         puls  pc,u
+
+Usage    leax  >L0015,pcr
+wrerr    pshs  b
+         lda   #$02
+         ldy   #$0100
+         os9   I$WritLn 
+         comb  
+         puls  b
+Exit     os9   F$Exit   
+
+Fragd    leax  >L00B6,pcr
+         clrb  
+         bra   wrerr
+
+ETrack   leax  >L004E,pcr
+         clrb  
+         bra   wrerr
+*
+* Write warning
+NotAllo    leax  >L006A,pcr
+         clrb  
+         bra   wrerr
+*
+* Update the identification sector on LSN 0
+*
+UpLSN0   pshs  u
+         ldx   #$0000
+         ldu   #$0015   probably DD.BT
+         lda   <DevFd
+         os9   I$Seek   
+         puls  u
+         bcs   Exit
+         leax  BTLSN,u
+         ldy   #$0005
+         os9   I$Write  
+         bcs   Exit
+         rts   
+         emod
+eom      equ   *
--- a/level1/cmds/os9gen.asm	Thu Jul 11 21:28:09 2002 +0000
+++ b/level1/cmds/os9gen.asm	Thu Jul 11 21:34:55 2002 +0000
@@ -5,23 +5,14 @@
 *
 * Ed.    Comments                                       Who YY/MM/DD
 * ------------------------------------------------------------------
-*  7     Original Dragon Data distribution version
-
-* DragonDOS BOOT loads sectors (numbered from 0) 2-17 (3840 bytes) into
-* RAM at location 9728. The first two bytes of sector 2 must be ASCII 'OS'
-* for this to work. It then jumps to 9730 and begins execution.
+*  7     Original Tandy distribution version
 *
-* The boot code switches into RAM mode, and copies the entire section to
-* $F000 and jumps to $F04F.
-* The 3840 bytes contain a few bytes to do the RAM mode switch, then
-* immediately after comes the kernel modules; OS9, OS9p2, Init and Boot
-* The rest of the bootstrap is in the OS9Boot file. The disk head at LSN0
-* contains the LSN of the bootstrap file in field DD.BT.
+* OS9gen is hardware dependent. On COCO the track to write is 34
 
          nam   OS9gen
          ttl   Build and Link a Bootstrap File
 
-* Disassembled 02/04/03 23:17:45 by Disasm v1.6 (C) 1988 by RML
+* Disassembled 02/07/06 22:40:22 by Disasm v1.6 (C) 1988 by RML
 
          ifp1
          use   defsfile
@@ -40,86 +31,135 @@
 u0009    rmb   2
 u000B    rmb   2
 u000D    rmb   2
-u000F    rmb   20
-u0023    rmb   2
-u0025    rmb   10
-u002F    rmb   2
-u0031    rmb   32
-u0051    rmb   16
-u0061    rmb   1
-u0062    rmb   7
-u0069    rmb   4522
+u000F    rmb   2
+u0011    rmb   2
+u0013    rmb   7
+u001A    rmb   3
+u001D    rmb   17
+u002E    rmb   2
+u0030    rmb   10
+u003A    rmb   2
+u003C    rmb   1
+u003D    rmb   451
+u0200    rmb   16
+u0210    rmb   1
+u0211    rmb   7
+u0218    rmb   1000
 size     equ   .
 name     equ   *
          fcs   /OS9gen/
          fcb   $07 
-L0014    fcb   C$LF 
-         fcc   "Use (caution): os9gen </devname>"
-         fcb   C$LF 
-         fcc   " ..reads (std input) pathnames until eof,"
-         fcb   C$LF 
-         fcc   "   merging paths into new OS9Boot file."
-         fcb   C$CR 
+L0014    fcb   C$LF
+         fcc   "Use (CAUTION): OS9GEN </devname> [-s]"
+         fcb   C$LF
+         fcc   " ..reads (std input) pathnames until EOF,"
+         fcb   C$LF
+         fcc   "   merging paths into New OS9Boot file."
+         fcb   C$LF
+         fcc   " -s = single drive operation"
+         fcb   C$LF
+         fcb   C$CR
          fcc   "Can't find: "
-L0094    fcb   C$LF
+L00B7    fcb   C$LF
          fcc   "Error writing kernel track"
-         fcb   C$CR 
-L00B0    fcb   C$LF 
-         fcc   "Warning - Kernel track has"
-         fcb   C$LF 
-         fcc   "not been allocated properly."
-         fcb   C$LF 
-         fcc   "Track not written."
-         fcb   C$CR 
-L00FC    fcb   C$LF
+         fcb   C$CR
+L00D3    fcb   C$LF
+         fcc   "Error - cannot gen to hard disk"
+         fcb   C$CR
+L00F4    fcb   C$CR
+L00F5    fcb   $07 
+L00F6    fcb   C$LF
+         fcc   "Warning - file(s) present"
+         fcb   C$LF
+         fcc   "on track 34 - this track"
+         fcb   C$LF
+         fcc   "not rewritten."
+         fcb   C$CR
+L0139    fcb   C$LF
          fcc   "Error - OS9boot file fragmented"
-         fcb   C$LF 
-         fcc   " This disk will not bootstrap."
-         fcb   C$CR 
-L013C    fcc   "RENAME "
-L0143    fcc   "TempBoot "
-         fcb   $FF
-L014D    fcc   "OS9Boot"
          fcb   C$CR
-         fcb   $FF
+L015A    fcc   "Ready SOURCE, hit C to continue: "
+L017B    fcc   "Ready DESTINATION, hit C to continue: "
+L01A1    fcc   "RENAME "
+L01A8    fcc   "TempBoot "
+         fcb   $FF 
+L01B2    fcc   "OS9Boot"
+         fcb   C$CR
+         fcb   $FF 
+
 start    equ   *
          clrb  
          stb   <u0005
+         stb   <u003C
          stu   <u0000
+         leas  >u0200,u
+         pshs  u
+         tfr   y,d
+         subd  ,s++
+         subd  #$0200
+         clrb  
+         std   <u0011
          lda   #$2F
          cmpa  ,x
-         lbne  L035B
+         lbne  L0503
          os9   F$PrsNam 
-         lbcs  L035B
+         lbcs  L0503
          lda   #$2F
          cmpa  ,y
-         lbeq  L035B
-         leay  <u0031,u
-L0175    sta   ,y+
+         lbeq  L0503
+         pshs  b,a
+L01EB    lda   ,y+
+         cmpa  #$2D
+         beq   L01F7
+         cmpa  #$0D
+         beq   L0209
+         bra   L01EB
+L01F7    ldd   ,y+
+         eora  #$53
+         anda  #$DF
+         lbne  L0503
+         cmpb  #$30
+         lbcc  L0503
+         inc   <u003C
+L0209    puls  b,a
+         leay  <u003D,u
+L020E    sta   ,y+
          lda   ,x+
          decb  
-         bpl   L0175
-         sty   <u002F
+         bpl   L020E
+         sty   <u003A
          lda   #'@
          ldb   #$20
          std   ,y++
-         leax  <u0031,u
+         lda   #$01
+         lbsr  L0517
+         leax  <u003D,u
          lda   #$03
          os9   I$Open   
          sta   <DevFd
-         lbcs  L035B
-         ldx   <u002F
-         leay  >L0143,pcr
+         lbcs  L0503
+         leax  <u001A,u
+         ldb   #$00
+         os9   I$GetStt 
+         lbcs  L0514
+         leax  <u001A,u
+         lda   <u001D,u
+         bpl   L024D
+         clrb  
+         leax  >L00D3,pcr
+         lbra  L0507
+L024D    ldx   <u003A
+         leay  >L01A8,pcr
          lda   #$2F
-L019B    sta   ,x+
+L0255    sta   ,x+
          lda   ,y+
-         bpl   L019B
-         leay  >L014D,pcr
-L01A5    lda   ,y+
+         bpl   L0255
+         leay  >L01B2,pcr
+L025F    lda   ,y+
          sta   ,x+
-         bpl   L01A5
+         bpl   L025F
          tfr   x,d
-         leax  <u0031,u
+         leax  <u003D,u
          pshs  x
          subd  ,s++
          std   <u000D
@@ -127,120 +167,162 @@
          ldb   #$03
          os9   I$Create 
          sta   <u0002
-         lbcs  L036C
+         lbcs  L0514
          ldx   #$0000
          stx   <u0006
-         ldu   #$4000
+         ldu   #$3000
          ldb   #SS.Size
          os9   I$SetStt 
-         lbcs  L036C
+         lbcs  L0514
          ldu   <u0000
-L01D6    clra  
-         leax  <u0051,u
-         ldy   #$1000
+         lda   #$00
+         lbsr  L0517
+L0295    clra  
+         leax  >u0200,u
+         ldy   #$0400
          os9   I$ReadLn 
-         bcs   L022E
+         bcs   L0322
          lda   ,x
          ldb   #$D3
-         cmpa  #C$CR
-         beq   L022E
+         cmpa  #$0D
+         beq   L0322
          lda   #$01
          os9   I$Open   
-         bcs   L021D
+         bcs   L0310
          sta   <u0004
-L01F4    lda   <u0004
-         leax  <u0051,u
-         ldy   #$1000
+         tst   <u003C
+         beq   L02E2
+         lda   #$01
+         lbsr  L0517
+         lda   <DevFd
+         ldx   #$0000
+         ldu   #$0000
+         os9   I$Seek   
+         lbcs  L0514
+         ldu   <u0000
+         leax  >u0200,u
+         ldy   #$0100
          os9   I$Read   
-         bcs   L0212
+         lbcs  L0514
+L02DD    lda   #$00
+         lbsr  L0517
+L02E2    lda   <u0004
+         leax  >u0200,u
+         ldy   <u0011
+         os9   I$Read   
+         bcs   L0305
          tfr   y,d
          addd  <u0006
          std   <u0006
+         lda   #$01
+         lbsr  L0517
          lda   <u0002
          os9   I$Write  
-         bcc   L01F4
-         lbra  L036C
-L0212    cmpb  #$D3
-         lbne  L036C
+         bcc   L02DD
+         lbra  L0514
+L0305    cmpb  #$D3
+         lbne  L0514
          os9   I$Close  
-         bra   L01D6
-L021D    pshs  b
-         leax  <u0051,u
+         bra   L0295
+L0310    pshs  b
+         leax  >u0200,u
          ldy   #$0100
          lda   #$02
          os9   I$WritLn 
-L022B    lbra  L036C
-L022E    cmpb  #$D3
-         bne   L022B
-         leax  u000F,u
+L031F    lbra  L0514
+L0322    cmpb  #$D3
+         bne   L031F
+         lda   #$01
+         lbsr  L0517
+         leax  <u001A,u
          ldb   #$00
          lda   <u0002
          os9   I$GetStt 
-         lbcs  L036C
+         lbcs  L0514
          lda   <u0002
          ldx   #$0000
          ldu   <u0006
          ldb   #SS.Size
          os9   I$SetStt 
-         lbcs  L036C
+         lbcs  L0514
          ldu   <u0000
          os9   I$Close  
-         lbcs  L035B
-         ldx   <u0023,u
-         lda   <u0025,u
+         lbcs  L0503
+         ldx   <u002E,u
+         lda   <u0030,u
          clrb  
          tfr   d,u
          lda   <DevFd
          os9   I$Seek   
          ldu   <u0000
-         lbcs  L036C
-         leax  <u0051,u
+         lbcs  L0514
+         leax  >u0200,u
          ldy   #$0100
          os9   I$Read   
-         lbcs  L036C
-         ldd   <u0069,u
-         lbne  L036F
+         lbcs  L0514
+         ldd   >u0218,u
+         lbne  L0577
          lda   <DevFd
          ldx   #$0000
          ldu   #$0015
          os9   I$Seek   
          ldu   <u0000
-         lbcs  L036C
+         lbcs  L0514
          leax  u0008,u
          ldy   #$0005
          os9   I$Read   
-         lbcs  L036C
+         lbcs  L0514
          ldd   <u000B
-         beq   L02C5
-         ldx   <u002F
-         leay  >L014D,pcr
+         beq   L03C1
+         ldx   <u003A
+         leay  >L01B2,pcr
          lda   #$2F
-L02AB    sta   ,x+
+L03A7    sta   ,x+
          lda   ,y+
-         bpl   L02AB
-         leax  <u0031,u
+         bpl   L03A7
+         leax  <u003D,u
          os9   I$Delete 
-         ldx   <u002F
-         leay  >L0143,pcr
+         ldx   <u003A
+         leay  >L01A8,pcr
          lda   #$2F
-L02BF    sta   ,x+
+L03BB    sta   ,x+
          lda   ,y+
-         bpl   L02BF
-L02C5    lda   #$01
+         bpl   L03BB
+L03C1    tst   <u003C
+         beq   L03E1
+         lda   #$00
+         lbsr  L0517
+         clra  
+         leax  >L01A1,pcr
+         os9   F$Load   
+         lbcs  L0514
+         tfr   u,d
+         ldu   <u0000
+         std   u000F,u
+         lda   #$01
+         lbsr  L0517
+L03E1    lda   #$01
          clrb  
-         leax  >L013C,pcr
+         leax  >L01A1,pcr
          ldy   <u000D
-         leau  <u0031,u
+         leau  <u003D,u
          os9   F$Fork   
-         lbcs  L036C
+         lbcs  L0514
          os9   F$Wait   
-         lbcs  L036C
+         lbcs  L0514
          tstb  
-         lbne  L036C
+         lbne  L0514
+         tst   <u003C
+         beq   L0412
          ldu   <u0000
-         ldb   <u0061,u
+         ldd   u000F,u
+         tfr   d,u
+         os9   F$UnLink 
+         lbcs  L0514
+L0412    ldu   <u0000
+         ldb   >u0210,u
          stb   <u0008
-         ldd   <u0062,u
+         ldd   >u0211,u
          std   <u0009
          ldd   <u0006
          std   <u000B
@@ -249,59 +331,138 @@
          lda   <DevFd
          os9   I$Seek   
          ldu   <u0000
-         lbcs  L036C
+         lbcs  L0514
          leax  u0008,u
          ldy   #$0005
          os9   I$Write  
-         lbcs  L036C
-         lbsr  SkLSN1
-         leax  <u0051,u
+         lbcs  L0514
+         lbsr  L057E
+         leax  >u0200,u
          ldy   #$0100
          os9   I$Read   
-         bcs   L035F
-         lda   ,x
-         anda  #$3F
-         eora  #$3F
-         lbne  L0385
-         lda   $01,x
-         eora  #$FF
-         lbne  L0385
-         lda   $02,x
-         anda  #$90
-         eora  #$90
-         lbne  L0385
-         ldx   #$F000    Address of kernel in RAM
-         ldy   #$0F00    Amount to write
+         lbcs  L0507
+         leax  >u0200,u
+         lda   <$4C,x
+         bita  #$0F
+         beq   L04AE
          lda   <DevFd
+         pshs  u
+         ldx   #$0002
+         ldu   #$6400
+         os9   I$Seek   
+         puls  u
+         leax  <u0013,u
+         ldy   #$0007
+         os9   I$Read   
+         lbcs  L058D
+         leax  <u0013,u
+         ldd   ,x
+         cmpa  #$4F
+         lbne  L058D
+         cmpb  #$53
+         lbne  L058D
+         lda   $04,x
+         cmpa  #$12
+         beq   L049C
+         lda   <$4E,x
+         bita  #$1C
+         lbne  L058D
+L049C    lda   <$4C,x
+         ora   #$0F
+         sta   <$4C,x
+         lda   #$FF
+         sta   <$4D,x
+         sta   <$4E,x
+         bra   L04CB
+L04AE    ora   #$0F
+         sta   <$4C,x
+         tst   <$4D,x
+         lbne  L058D
+         com   <$4D,x
+         lda   <$4E,x
+         bita  #$FC
+         lbne  L058D
+         ora   #$FC
+         sta   <$4E,x
+L04CB    lbsr  L057E
+         leax  >u0200,u
+         ldy   #$0064
          os9   I$Write  
-         bcs   L0354
+         bcs   L0507
+         pshs  u
+         ldx   #$0002
+         ldu   #$6400
+         os9   I$Seek   
+         puls  u
+         ldx   #$EF00    Address of kernel in RAM
+         ldy   #$0F80    Amount to write
+         os9   I$Write  
+         bcs   L04FC
          os9   I$Close  
-         bcs   L036C
+         bcs   L0503
          clrb  
-         bra   L036C
-L0354    leax  >L0094,pcr
+         bra   L0514
+L04FC    leax  >L00B7,pcr
          clrb  
-         bra   L035F
-L035B    leax  >L0014,pcr
-L035F    pshs  b
+         bra   L0507
+L0503    leax  >L0014,pcr
+L0507    pshs  b
          lda   #$02
          ldy   #$0100
          os9   I$WritLn 
          puls  b
-L036C    os9   F$Exit   
-L036F    leax  >L00FC,pcr
+L0514    os9   F$Exit   
+L0517    tst   <u003C
+         beq   L055F
+         pshs  y,x
+L051D    pshs  a
+         tsta  
+         bne   L052C
+         leax  >L015A,pcr
+         ldy   #$0021
+         bra   L0534
+L052C    leax  >L017B,pcr
+         ldy   #$0026
+L0534    bsr   L0560
+         leax  ,-s
+         ldy   #$0001
+         lda   #$02
+         os9   I$Read   
+         lda   ,s+
+         eora  #$43
+         anda  #$DF
+         beq   L0559
+         leax  >L00F5,pcr
+         ldy   #$0001
+         bsr   L0560
+         bsr   L0566
+         puls  a
+         bne   L051D
+L0559    bsr   L0566
+         puls  a
+         puls  y,x
+L055F    rts   
+L0560    lda   #$01
+         os9   I$WritLn 
+         rts   
+L0566    pshs  y,x,a
+         lda   #$01
+         leax  >L00F4,pcr
+         ldy   #$0050
+         os9   I$WritLn 
+         puls  pc,y,x,a
+L0577    leax  >L0139,pcr
          clrb  
-         bra   L035F
-
-SkLSN1   pshs  u
+         bra   L0507
+L057E    pshs  u
          lda   <DevFd
          ldx   #$0000
          ldu   #$0100
-         os9   I$Seek   Seek to allocation map at LSN 1
+         os9   I$Seek   
          puls  pc,u
 
-L0385    leax  >L00B0,pcr
+L058D    leax  >L00F6,pcr
          clrb  
-         bra   L035F
+         lbra  L0507
          emod
 eom      equ   *
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/level1/cmds/os9gen_d64.asm	Thu Jul 11 21:34:55 2002 +0000
@@ -0,0 +1,307 @@
+********************************************************************
+* OS9gen - Build and Link a Bootstrap File
+*
+* $Id$
+*
+* Ed.    Comments                                       Who YY/MM/DD
+* ------------------------------------------------------------------
+*  7     Original Dragon Data distribution version
+
+* DragonDOS BOOT loads sectors (numbered from 0) 2-17 (3840 bytes) into
+* RAM at location 9728. The first two bytes of sector 2 must be ASCII 'OS'
+* for this to work. It then jumps to 9730 and begins execution.
+*
+* The boot code switches into RAM mode, and copies the entire section to
+* $F000 and jumps to $F04F.
+* The 3840 bytes contain a few bytes to do the RAM mode switch, then
+* immediately after comes the kernel modules; OS9, OS9p2, Init and Boot
+* The rest of the bootstrap is in the OS9Boot file. The disk head at LSN0
+* contains the LSN of the bootstrap file in field DD.BT.
+
+         nam   OS9gen
+         ttl   Build and Link a Bootstrap File
+
+* Disassembled 02/04/03 23:17:45 by Disasm v1.6 (C) 1988 by RML
+
+         ifp1
+         use   defsfile
+         endc
+tylg     set   Prgrm+Objct   
+atrv     set   ReEnt+rev
+rev      set   $01
+         mod   eom,name,tylg,atrv,start,size
+u0000    rmb   2
+u0002    rmb   1
+DevFd    rmb   1
+u0004    rmb   1
+u0005    rmb   1
+u0006    rmb   2
+u0008    rmb   1
+u0009    rmb   2
+u000B    rmb   2
+u000D    rmb   2
+u000F    rmb   20
+u0023    rmb   2
+u0025    rmb   10
+u002F    rmb   2
+u0031    rmb   32
+u0051    rmb   16
+u0061    rmb   1
+u0062    rmb   7
+u0069    rmb   4522
+size     equ   .
+name     equ   *
+         fcs   /OS9gen/
+         fcb   $07 
+L0014    fcb   C$LF 
+         fcc   "Use (caution): os9gen </devname>"
+         fcb   C$LF 
+         fcc   " ..reads (std input) pathnames until eof,"
+         fcb   C$LF 
+         fcc   "   merging paths into new OS9Boot file."
+         fcb   C$CR 
+         fcc   "Can't find: "
+L0094    fcb   C$LF
+         fcc   "Error writing kernel track"
+         fcb   C$CR 
+L00B0    fcb   C$LF 
+         fcc   "Warning - Kernel track has"
+         fcb   C$LF 
+         fcc   "not been allocated properly."
+         fcb   C$LF 
+         fcc   "Track not written."
+         fcb   C$CR 
+L00FC    fcb   C$LF
+         fcc   "Error - OS9boot file fragmented"
+         fcb   C$LF 
+         fcc   " This disk will not bootstrap."
+         fcb   C$CR 
+L013C    fcc   "RENAME "
+L0143    fcc   "TempBoot "
+         fcb   $FF
+L014D    fcc   "OS9Boot"
+         fcb   C$CR
+         fcb   $FF
+start    equ   *
+         clrb  
+         stb   <u0005
+         stu   <u0000
+         lda   #$2F
+         cmpa  ,x
+         lbne  L035B
+         os9   F$PrsNam 
+         lbcs  L035B
+         lda   #$2F
+         cmpa  ,y
+         lbeq  L035B
+         leay  <u0031,u
+L0175    sta   ,y+
+         lda   ,x+
+         decb  
+         bpl   L0175
+         sty   <u002F
+         lda   #'@
+         ldb   #$20
+         std   ,y++
+         leax  <u0031,u
+         lda   #$03
+         os9   I$Open   
+         sta   <DevFd
+         lbcs  L035B
+         ldx   <u002F
+         leay  >L0143,pcr
+         lda   #$2F
+L019B    sta   ,x+
+         lda   ,y+
+         bpl   L019B
+         leay  >L014D,pcr
+L01A5    lda   ,y+
+         sta   ,x+
+         bpl   L01A5
+         tfr   x,d
+         leax  <u0031,u
+         pshs  x
+         subd  ,s++
+         std   <u000D
+         lda   #$02
+         ldb   #$03
+         os9   I$Create 
+         sta   <u0002
+         lbcs  L036C
+         ldx   #$0000
+         stx   <u0006
+         ldu   #$4000
+         ldb   #SS.Size
+         os9   I$SetStt 
+         lbcs  L036C
+         ldu   <u0000
+L01D6    clra  
+         leax  <u0051,u
+         ldy   #$1000
+         os9   I$ReadLn 
+         bcs   L022E
+         lda   ,x
+         ldb   #$D3
+         cmpa  #C$CR
+         beq   L022E
+         lda   #$01
+         os9   I$Open   
+         bcs   L021D
+         sta   <u0004
+L01F4    lda   <u0004
+         leax  <u0051,u
+         ldy   #$1000
+         os9   I$Read   
+         bcs   L0212
+         tfr   y,d
+         addd  <u0006
+         std   <u0006
+         lda   <u0002
+         os9   I$Write  
+         bcc   L01F4
+         lbra  L036C
+L0212    cmpb  #$D3
+         lbne  L036C
+         os9   I$Close  
+         bra   L01D6
+L021D    pshs  b
+         leax  <u0051,u
+         ldy   #$0100
+         lda   #$02
+         os9   I$WritLn 
+L022B    lbra  L036C
+L022E    cmpb  #$D3
+         bne   L022B
+         leax  u000F,u
+         ldb   #$00
+         lda   <u0002
+         os9   I$GetStt 
+         lbcs  L036C
+         lda   <u0002
+         ldx   #$0000
+         ldu   <u0006
+         ldb   #SS.Size
+         os9   I$SetStt 
+         lbcs  L036C
+         ldu   <u0000
+         os9   I$Close  
+         lbcs  L035B
+         ldx   <u0023,u
+         lda   <u0025,u
+         clrb  
+         tfr   d,u
+         lda   <DevFd
+         os9   I$Seek   
+         ldu   <u0000
+         lbcs  L036C
+         leax  <u0051,u
+         ldy   #$0100
+         os9   I$Read   
+         lbcs  L036C
+         ldd   <u0069,u
+         lbne  L036F
+         lda   <DevFd
+         ldx   #$0000
+         ldu   #$0015
+         os9   I$Seek   
+         ldu   <u0000
+         lbcs  L036C
+         leax  u0008,u
+         ldy   #$0005
+         os9   I$Read   
+         lbcs  L036C
+         ldd   <u000B
+         beq   L02C5
+         ldx   <u002F
+         leay  >L014D,pcr
+         lda   #$2F
+L02AB    sta   ,x+
+         lda   ,y+
+         bpl   L02AB
+         leax  <u0031,u
+         os9   I$Delete 
+         ldx   <u002F
+         leay  >L0143,pcr
+         lda   #$2F
+L02BF    sta   ,x+
+         lda   ,y+
+         bpl   L02BF
+L02C5    lda   #$01
+         clrb  
+         leax  >L013C,pcr
+         ldy   <u000D
+         leau  <u0031,u
+         os9   F$Fork   
+         lbcs  L036C
+         os9   F$Wait   
+         lbcs  L036C
+         tstb  
+         lbne  L036C
+         ldu   <u0000
+         ldb   <u0061,u
+         stb   <u0008
+         ldd   <u0062,u
+         std   <u0009
+         ldd   <u0006
+         std   <u000B
+         ldx   #$0000
+         ldu   #$0015
+         lda   <DevFd
+         os9   I$Seek   
+         ldu   <u0000
+         lbcs  L036C
+         leax  u0008,u
+         ldy   #$0005
+         os9   I$Write  
+         lbcs  L036C
+         lbsr  SkLSN1
+         leax  <u0051,u
+         ldy   #$0100
+         os9   I$Read   
+         bcs   L035F
+         lda   ,x
+         anda  #$3F
+         eora  #$3F
+         lbne  L0385
+         lda   $01,x
+         eora  #$FF
+         lbne  L0385
+         lda   $02,x
+         anda  #$90
+         eora  #$90
+         lbne  L0385
+         ldx   #$F000    Address of kernel in RAM
+         ldy   #$0F00    Amount to write
+         lda   <DevFd
+         os9   I$Write  
+         bcs   L0354
+         os9   I$Close  
+         bcs   L036C
+         clrb  
+         bra   L036C
+L0354    leax  >L0094,pcr
+         clrb  
+         bra   L035F
+L035B    leax  >L0014,pcr
+L035F    pshs  b
+         lda   #$02
+         ldy   #$0100
+         os9   I$WritLn 
+         puls  b
+L036C    os9   F$Exit   
+L036F    leax  >L00FC,pcr
+         clrb  
+         bra   L035F
+
+SkLSN1   pshs  u
+         lda   <DevFd
+         ldx   #$0000
+         ldu   #$0100
+         os9   I$Seek   Seek to allocation map at LSN 1
+         puls  pc,u
+
+L0385    leax  >L00B0,pcr
+         clrb  
+         bra   L035F
+         emod
+eom      equ   *