Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!caen!news.cs.indiana.edu!news.nd.edu!mentor.cc.purdue.edu!gauss.math.purdue.edu!wilker From: wilker@gauss.math.purdue.edu (Clarence Wilkerson) Newsgroups: comp.os.minix Subject: Re: IBMPC Demo Disk Message-ID: <6343@mentor.cc.purdue.edu> Date: 20 Feb 91 01:42:04 GMT References: <1991Feb19.182447.6756@sbcs.sunysb.edu> <1991Feb19.213539.7257@syd.dms.CSIRO.AU> Sender: news@mentor.cc.purdue.edu Reply-To: wilker@gauss.math.purdue.edu.UUCP (Clarence Wilkerson) Organization: Purdue University, West Lafayette Lines: 86 Here's a couple of Turbo C hosted on PC programs I wiped up to do the chore of writing the demo disk to floppy (RAWFILL) and another one to read a 360k minix floppy ( VOLCOPY). I think DEBUG may wrap around when you do the w100 0 0 number method. I didn't get that to work either! RAWFILL.C: #include #include char buffer[520]; main(argc,argv) int argc; char *argv[]; { int drive, c, next,count; char *s; FILE * infile; if ( argc < 3) { fprintf(stderr,"RAWFILL file drive \n"); return(-1); } infile = fopen(argv[1],"rb"); if( infile == (FILE *)NULL ) { fprintf(stderr,"Bad file name.\n"); return(-1); } s = argv[2]; c= *s; drive = ( toupper(c) ) -65 ; if ( (drive < 0) || ( drive > 1) ) { fprintf(stderr,"Bad drive name."); return(-1); } next = 0; while ( !feof(infile) ){ count=fread(&buffer[0],512,1,infile); abswrite(drive,1,next,&buffer[0]); next++; if ( next > ( 80*9 ) ) goto toomany; } toomany: fclose(infile); return(0); } VOLCOPY.C : #include #include char buffer[520]; main(argc,argv) int argc; char *argv[]; { int drive, c, next,count; char *s; FILE * outfile; if ( argc < 3) { fprintf(stderr,"VOLCOPY drive filename \n"); return(-1); } outfile = fopen(argv[2],"wb"); if( outfile == (FILE *)NULL ) { fprintf(stderr,"Bad file name.\n"); return(-1); } s = argv[1]; c= *s; drive = ( toupper(c) ) -65 ; if ( (drive < 0) || ( drive > 1) ) { fprintf(stderr,"Bad drive name."); return(-1); } next = 0; while ( next < (9*80) ){ absread(drive,1,next,&buffer[0]); count=fwrite(&buffer[0],512,1,outfile); next++; } toomany: fclose(outfile); return(0); } If you get an abort/retry/ question from MSDOS, do a retry. This on my AT clone did seem to write and read the demo disk. Your mileage may vary! Clarence Wilkerson