home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
OSK
/
SRC
/
msdos_diskaccess.lzh
/
MS_DISK_ACCESS
/
mstohd.tos.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-08-04
|
902b
|
42 lines
#include <stdio.h>
#include <modes.h>
#include <errno.h>
unsigned char puffer[ 512 * 9 * 4 ];
main(argc, argv)
int argc;
char *argv[];
{
int p0, p1, i, s, j;
if (argc < 2)
exit( 1 );
if ((p1 = create(argv[ 1 ], S_IWRITE+S_ISIZE,
S_IREAD+S_IWRITE, 512*9*80*2 )) < 0)
exit( errno );
system("ex diskcache -d /d0");
if ((p0 = open("/tos0@", S_IREAD )) < 0)
exit( errno );
s = 0;
while (s < 80 * 2 * 9 * 512) {
putchar('#');
fflush(stdout);
for(j = 0; j < 18; ++j) {
lseek(p0, s + j*1024, 0);
if (read(p0, puffer+j*1024, 512) < 512)
fprintf(stderr, "Fehler: sector %04x\n",
(s + j*1024) / 256);
}
for(j = 0; j < 18; ++j) {
lseek(p0, s + j*1024 + 512, 0);
if (read(p0, puffer+j*1024 + 512, 512) < 512)
fprintf(stderr, "Fehler: sector %04x\n",
(s + j*1024 + 512) / 256);
}
write(p1, puffer, 36*512 );
s += 36*512;
}
putchar('\n');
}