comparison 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
comparison
equal deleted inserted replaced
14:3f18c1fa9132 15:bb6a2a9f59f1
265 fputword(vec+12,romfile); 265 fputword(vec+12,romfile);
266 fputword(vec+15,romfile); 266 fputword(vec+15,romfile);
267 fputword(LV2START,romfile); 267 fputword(LV2START,romfile);
268 268
269 pos = 0x10000; 269 pos = 0x10000;
270 int bootsize = 2;
271 for(struct os9module *cur = root.next; cur ; cur = cur->next ) {
272 if ( cur->ioflag ==0) continue;
273 bootsize += cur->size;
274 }
275 fputc(bootsize>>8,romfile);
276 fputc(bootsize&0xff,romfile);
277 pos += 2;
270 for(struct os9module *cur = root.next; cur ; cur = cur->next ) { 278 for(struct os9module *cur = root.next; cur ; cur = cur->next ) {
271 if ( cur->ioflag ==0) continue; 279 if ( cur->ioflag ==0) continue;
272 printf("mod "); 280 printf("mod ");
273 printOs9Str(cur->name); 281 printOs9Str(cur->name);
274 fwrite(cur->mod, cur->size, 1, romfile); 282 fwrite(cur->mod, cur->size, 1, romfile);
275 printf(" \t: 0x%x - 0x%x\n",pos, pos + cur->size-1); 283 printf(" \t: 0x%x - 0x%x\n",pos, pos + cur->size-1);
276 #ifdef DEBUG 284 #ifdef DEBUG
277 printf(" \t: 0x%x \n",cur->location); 285 printf(" \t: 0x%x \n",cur->location);
278 printf(" \t: 0x%x - 0x%x : 0x%lx \n",pos, pos + cur->size, ftell(romfile)+start); 286 printf(" \t: 0x%x - 0x%x : 0x%lx \n",pos, pos + cur->size, ftell(romfile)+start);
279 #endif 287 #endif
280 pos = pos+cur->size; 288 pos += cur->size;
281 } 289 }
282 while(pos++ & 0x1fff) fputc(0xff,romfile); 290 while(pos++ & 0x1fff) fputc(0xff,romfile);
283 } 291 }
284 if (level==1) 292 if (level==1)
285 printf("boot rom from 0x%lx\n",0x10000-ftell(romfile)); 293 printf("boot rom from 0x%lx\n",0x10000-ftell(romfile));