char *flopname
= "/dev/floppy";
register count
= 77 * 26 * 128, startad
= -26 * 128;
if(strcmp(argv
[1],"-h")!=0)
printf("Bad halftime option.\n"),
if((file
= open("floppy",0))<0)
printf("failed to open floppy image"),
file
= creat("floppy",0666);
for( ; count
> 0 ; count
-= 512) {
n
= count
> 512 ? 512 : count
;
printf("Change Floppy, Hit return when done.\n");
count
= 77 * 26 * 128; startad
= -26 * 128;
for( ; count
> 0 ; count
-= 512) {
n
= count
> 512 ? 512 : count
;
if((floppydes
= open(flopname
,mode
)) < 0) {
printf("Floppy open failed\n");
/* Logical to physical adress translation */
register int sector
, bytes
, track
;
sector
+= 26 + ((track
= (logical
/ 26)) - 1) * 6;
return( (((track
*26) + sector
) << 7) + bytes
);
lread(startad
,count
,obuff
)
while( (count
-= 128) >= 0) {
lseek(floppydes
, trans(startad
), 0);
read(floppydes
,obuff
,128);
lwrite(startad
,count
,obuff
)
while( (count
-= 128) >= 0) {
lseek(floppydes
, trans(startad
), 0);
write(floppydes
,obuff
,128);