diff os9/makerom.c @ 15:bb6a2a9f59f1

boot ...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 07 Jul 2018 19:57:39 +0900
parents 111e5defb8ab
children 67046a9431a0
line wrap: on
line diff
--- 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);
  }