Mercurial > hg > Members > kono > os9 > sbc09
comparison io.c @ 52:51b437557f42
boot without disk image
dir -e on other directory
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 22 Jul 2018 15:52:39 +0900 |
parents | 947cbecdd8d5 |
children | fe88cea67ef0 |
comparison
equal
deleted
inserted
replaced
51:498b6fcaf270 | 52:51b437557f42 |
---|---|
329 return; | 329 return; |
330 } | 330 } |
331 int drv = mem[IOPAGE+0x41]; | 331 int drv = mem[IOPAGE+0x41]; |
332 int lsn = (mem[IOPAGE+0x42]<<16) + (mem[IOPAGE+0x43]<<8) + mem[IOPAGE+0x44]; | 332 int lsn = (mem[IOPAGE+0x42]<<16) + (mem[IOPAGE+0x43]<<8) + mem[IOPAGE+0x44]; |
333 int buf = (mem[IOPAGE+0x45]<<8) + mem[IOPAGE+0x46]; | 333 int buf = (mem[IOPAGE+0x45]<<8) + mem[IOPAGE+0x46]; |
334 if (drv > 1 || disk[drv]==0) goto error; | |
335 Byte *phy = pmem(buf); | 334 Byte *phy = pmem(buf); |
336 if (c==0x81) { | 335 if (c==0x81) { |
336 if (drv > 1 || disk[drv]==0) goto error; | |
337 if (lseek(fileno(disk[drv]),lsn*SECSIZE,SEEK_SET)==-1) goto error; | 337 if (lseek(fileno(disk[drv]),lsn*SECSIZE,SEEK_SET)==-1) goto error; |
338 if (read(fileno(disk[drv]),phy,SECSIZE)==-1) goto error; | 338 if (read(fileno(disk[drv]),phy,SECSIZE)==-1) goto error; |
339 } else if (c==0x55) { | 339 } else if (c==0x55) { |
340 if (drv > 1 || disk[drv]==0) goto error; | |
340 if (lseek(fileno(disk[drv]),lsn*SECSIZE,SEEK_SET)==-1) goto error; | 341 if (lseek(fileno(disk[drv]),lsn*SECSIZE,SEEK_SET)==-1) goto error; |
341 if (write(fileno(disk[drv]),phy,SECSIZE)==-1) goto error; | 342 if (write(fileno(disk[drv]),phy,SECSIZE)==-1) goto error; |
342 #ifdef USE_VDISK | 343 #ifdef USE_VDISK |
343 } else { | 344 } else { |
344 do_vdisk(c); | 345 do_vdisk(c); |