changeset 15:bb6a2a9f59f1

boot ...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 07 Jul 2018 19:57:39 +0900
parents 3f18c1fa9132
children 807141dc5ee8
files a09.c os9/Makefile os9/level2/boot.asm os9/makerom.c
diffstat 4 files changed, 51 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- a/a09.c	Sat Jul 07 15:09:42 2018 +0900
+++ b/a09.c	Sat Jul 07 19:57:39 2018 +0900
@@ -1328,6 +1328,7 @@
         setlabel(lp);
         putword(0x103f); // SWI2
         putbyte(scanexpr(0));
+        if(unknown&&pass==2)error|=4;
         break; 
    case 18: /* TTL */     
         break;
--- a/os9/Makefile	Sat Jul 07 15:09:42 2018 +0900
+++ b/os9/Makefile	Sat Jul 07 19:57:39 2018 +0900
@@ -25,4 +25,4 @@
 	./makerom -o os9d.rom  modules/Shell modules/init.b modules/mdir modules/dir.b modules/SysGo modules/IOMan modules/pty-dd.b modules/pty.b modules/pdisk.b modules/d0.b modules/d1.b modules/clock.b modules/SCF modules/rbf.b modules/OS9p2 modules/OS9
    
 os9lv2.rom : makerom level2/init
-	./makerom -o os9lv2.rom -2  level2/Shell level2/mdir level2/dir level2/ioman  level2/os9p3_perr level2/os9p4_regdump  level2/pipe level2/piper level2/pipeman level2/pty level2/rbf modules/SysGo  level2/scf level2/os9p2 level2/pdisk level2/pty level2/term level2/init level2/boot level2/os9p1 
+	./makerom -o os9lv2.rom -2  level2/Shell level2/mdir level2/dir level2/ioman  level2/os9p3_perr level2/os9p4_regdump  level2/pipe level2/piper level2/pipeman modules/SysGo level2/scf level2/rbf level2/os9p2 level2/pdisk level2/pty level2/term level2/init level2/boot level2/os9p1 
--- a/os9/level2/boot.asm	Sat Jul 07 15:09:42 2018 +0900
+++ b/os9/level2/boot.asm	Sat Jul 07 19:57:39 2018 +0900
@@ -29,43 +29,48 @@
 name     fcs   /Boot/
          fcb   edition
 
-start    ldd   #$40
-         ldx   #0
-         pshs   d,x
-loop     ldx    2,s
-         leay   ,s
-         lda    #$44         less than 3 block
-         cmpa   1,s
-         beq    last
-         os9    F$LDAXY
+start    
+         ldy    #$40    page no. 
+         clra
+         clrb
+         pshs   d,x,y,u
+         tfr    d,x
+         leay   4,s    pointer to page no
+     **  read boot rom file size
+         os9    F$LDDDXY 
          bcs    last
-         cmpa   #M$ID1     $87
-         beq    checkmod
-         bra    last
-
-checkmod ldx    2,s
-         tfr    s,d
-         os9    F$VModul
+         addb   #$ff
+         adca   #$1f
+         clrb
+         anda   #$e0
+         std   ,s       size return as d
+         os9    F$BtMem
          bcs    last
-         ldx    2,s
-         leay   ,s
-         ldd    #2
-         os9    F$LDDDXY
-         bcs    last
-         ldx    2,s
-         leax   d,x
-a2       cmpx   #$1fff
-         ble    a1
-         inc    1,s        increment DAT block
-         leax   -$2000,x 
-         bra    a2
-a1       stx    2,s
-         bra    loop
-
-
-last     puls   d,y
-         clrb
-         rts
+     **  u points the memory
+         stu    2,s      return as x
+         ldd    ,s
+         ldx    #0
+pagel    tfr    d,y
+         lda    5,s
+         sta    $ffa0
+         tfr    y,d
+loop     ldy    ,x++
+         sty    ,u++
+         subb   #2
+         sbca   #0
+         cmpb   #0
+         bne    loop
+         bita   #$1f
+         bne    loop
+         tsta
+         beq    last
+         clr    $ffa0
+     ** 2k boundary
+         inc    5,s
+         ldx    #0
+         bra    pagel
+last     clr    $ffa0
+         puls   d,x,y,u,pc
 
          emod
 eom      equ   *
--- a/os9/makerom.c	Sat Jul 07 15:09:42 2018 +0900
+++ b/os9/makerom.c	Sat Jul 07 19:57:39 2018 +0900
@@ -267,6 +267,14 @@
      fputword(LV2START,romfile);
 
      pos = 0x10000;
+     int bootsize = 2;
+     for(struct os9module *cur = root.next; cur ; cur = cur->next ) {
+        if ( cur->ioflag ==0) continue; 
+        bootsize += cur->size;
+     }
+     fputc(bootsize>>8,romfile);
+     fputc(bootsize&0xff,romfile);
+     pos += 2;
      for(struct os9module *cur = root.next; cur ; cur = cur->next ) {
         if ( cur->ioflag ==0) continue; 
         printf("mod ");
@@ -277,7 +285,7 @@
         printf(" \t: 0x%x \n",cur->location);
         printf(" \t: 0x%x - 0x%x : 0x%lx \n",pos, pos + cur->size, ftell(romfile)+start);
 #endif 
-        pos = pos+cur->size;
+        pos += cur->size;
      }
      while(pos++ & 0x1fff) fputc(0xff,romfile);
  }