Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!hao!gatech!mcnc!ecsvax!bishop From: bishop@ecsvax.UUCP (Alan Bishop) Newsgroups: comp.os.minix Subject: Re: Transfering Minix disks Message-ID: <4391@ecsvax.UUCP> Date: 5 Jan 88 05:19:18 GMT References: <929@louie.udel.EDU> Reply-To: bishop@ecsvax.UUCP (Alan Bishop) Organization: NCSU (Student) Lines: 171 In article <929@louie.udel.EDU> TCORAM%UDCVAX.BITNET@cunyvm.cuny.edu writes: >I normally transfer >software via modem cable between the two machines. (I can't hook either >drive into either machine.) I am looking for an easy way to transfer the >bit image of the Minix boot floppy to the portable PC w/ the 3 1/2 drive. >Any suggestions? I had this same problem moving files from my IBM PC to my PS/2. I have the parallel conversion thing. I expect that many people will have this problem as people switch over to 3.5" disks. Here are two quick programs that can be used. The first one is run on the 5.25" machine and converts a 360K disks (9 sectors/track, double sided) into two files which then can be moved over. (Of course, it may be a bit slow via modem cable.) The second program takes these two files and writes them to a 720K disk (which is 9 sectors/track, double sided). Here they are. They are NOT as efficient as possible (they read one sector at a time and move the head to each track twice.) They are in Turbo Pascal, although they are simple enough to translate to assembler or C if you don't have that. (warning: The "read files in" program was just recreated using the very similar "write files out" program, as I don't have it on this computer. If it doesn't work, send me mail.) alan --read files in-- {$u+} {$g256} {$p256} program Diskcopy; type Regpack = record AX, BX, CX, DX, BP, SI, DI, DS, ES, Flags : integer; end; Sector = array [0..511] of byte; var Head, Track, Sectnum : integer; Regs : Regpack; Outfile : file of Sector; Mrsect : Sector; begin Regs.AX := $0000; Intr($13, Regs); if odd(Regs.Flags) then writeln('Error resetting system.'); assign(Outfile, 'sect1.dat'); rewrite(Outfile); for Head := 0 to 1 do begin for Track := 0 to 39 do begin for Sectnum := 1 to 9 do begin repeat Regs.AX := $0201; Regs.DX := Head shl 8; Regs.CX := Track shl 8 + Sectnum; Regs.ES := seg(MrSect); Regs.BX := ofs(MrSect); Intr($13, Regs); if odd(Regs.Flags) then begin writeln('Error at Head ', Head, ', Sector ', Sectnum, ', Track ', Track); writeln('AH=', Regs.AX shr 8); writeln('Repeating.'); end; until not odd(Regs.Flags); write(Outfile, Mrsect); end; writeln('Track: ', Track); end; if Head = 0 then begin close(Outfile); assign(Outfile, 'sect2.dat'); rewrite(Outfile); end; end; close(Outfile); end. ---write files out--- {$u+} {$g256} {$p256} program Diskcopy; type Regpack = record AX, BX, CX, DX, BP, SI, DI, DS, ES, Flags : integer; end; Sector = array [0..511] of byte; var Head, Track, Sectnum : integer; Regs : Regpack; Infile : file of Sector; Mrsect : Sector; begin Regs.AX := $0000; Intr($13, Regs); if odd(Regs.Flags) then writeln('Error resetting system.'); assign(Infile, 'sect1.dat'); reset(Infile); for Head := 0 to 1 do begin for Track := 0 to 39 do begin for Sectnum := 1 to 9 do begin read(Infile, Mrsect); repeat Regs.AX := $0301; Regs.DX := Head shl 8; Regs.CX := Track shl 8 + Sectnum; Regs.ES := seg(MrSect); Regs.BX := ofs(MrSect); Intr($13, Regs); if odd(Regs.Flags) then begin writeln('Error at Head ', Head, ', Sector ', Sectnum, ', Track ', Track); writeln('AH=', Regs.AX shr 8); writeln('Repeating.'); end; until not odd(Regs.Flags); end; writeln('Track: ', Track); end; if Head = 0 then begin close(Infile); assign(Infile, 'sect2.dat'); reset(Infile); end; end; close(Infile); end. ---end of stuff--- alan