Path: utzoo!attcan!uunet!lll-winken!ames!ncar!mailrus!cornell!rochester!udel!mmdf From: G35%DHDURZ1.BITNET@cunyvm.cuny.edu (Werner Guenther) Newsgroups: comp.sys.amiga Subject: trackdisk.device BUG (was: Help with PcPatch_II) Message-ID: <16092@louie.udel.EDU> Date: 23 May 89 18:12:49 GMT Sender: mmdf@udel.EDU Lines: 113 After my PCPatch_II posting I got my mailbox filled with complaints. The program seems to fail on a lot of configurations, so I sat down and did some experimetation. Well, what I found out is the following: both, PCCopy and PCFormat use the RAWREAD/RAWWRITE functions of the trackdisk.device. It is known that they are buggy, but I thought the bug was limited to A2000's with no internal additional drive but an external DF2: (i.e. DF0:, DF2: but no DF1:). Alas, it isn't that simple: RAWREAD/RAWWRITE fail to work even on a single drive system. Strangely enought, RAWREAD works if I switch my DF1: drive off (I have 3 drives attached to my Amiga) and it seems to work on an sigle drive A1000 but not on an A500. If you want to test it out yourself if RAWREAD works on your system, I add a small program that does RAWREAD() track 0 from df0: and checks if it worked. Anyway, I'm going to try to write a RAWREAD/RAWWRITE function myself and add it to PCPatch. I hope I can send it next week to Bob. Sorry for the inconvenience, but I didn't write the OS :) Werner ---------------------------------------------------------------------------- #include #include #include #include /* this is Lattice C */ #include #define BUFFLEN 14000 /* Buffer for more than one track */ /* convert bits from a bitstream into long int (SLOW!) */ #define BITLONG(n) ((buffer[n>>5] << (i & 31)) \ | (buffer[(n>>5)+1] >> (32-(i &31)))) main() { struct IOStdReq *io = NULL; struct MsgPort *mp = NULL; short syncs = NULL; ULONG *buffer = NULL; long i; if (!(mp =(struct MsgPort*) CreatePort("Testing...",0))) exit(); if (!(io =(struct IOStdReq*) CreateStdIO(mp))) goto cleanup; if((OpenDevice(TD_NAME,0L,(struct IORequest*)io,TDF_ALLOW_NON_3_5))!=NULL) goto cleanup; if (!(buffer=(ULONG*) AllocMem(BUFFLEN,MEMF_CHIP|MEMF_CLEAR))) goto cleanup; /* Read track 0 into our buffer */ io->io_Command= TD_RAWREAD; io->io_Data = (APTR)buffer; io->io_Length = BUFFLEN; io->io_Offset = 0; DoIO((struct IORequest*)io); /* switch drive motor off */ io->io_Command= TD_MOTOR; io->io_Length = 0; DoIO((struct IORequest*)io); /* Now we take a look at what we got. What we should have is at least 11 syncs */ for(i=0;i<(BUFFLEN<<3);i++) if(BITLONG(i)==0x44894489) syncs++; Write(Output(),syncs > 10 ? "RAWREAD works \n":"RAWREAD failed !\n",17); cleanup: if (io->io_Device) CloseDevice((struct IORequest*)io); if (io) DeleteStdIO(io); if (mp) DeletePort(mp); if (buffer) FreeMem((char*) buffer,BUFFLEN); } -------------------------------------------------------------------------- begin 644 TestRAWREAD M```#\P`````````"``````````$```$%````%P```^D```$%(\\````(+'D`G M```$(\X`````80``.DGY`````$ZY````9'``+GD````(3G4@+P`$+GD````(A M+P`L>0````0@.0````0B0$ZN_F(@'TYU0_D````,0H!.KOW8(\`````$9^A.4 M=4Y5_^9(YS`"D``$3J[^( M1$J`9@``WB`\```VL"(\``$``BQX``1.KO\Z*T#_\DJM__)G``"^(&W__#%\P M`!``'"%M__(`*"%\```VL``D0J@`+")M__PL>``$3J[^."!M__PQ?``)`!Q"0 MJ``D(FW__"QX``1.KOXX0JW_[B(M_^X,@0`!M8!L-B`!ZH`D`.6"`H$````?E M(&W_\B`P*`#CH'8@EH$B,"@$YJF`@0R`1(E$B68$4FW_]E*M_^Y@OBQL``1.L MKO_$+T``#`QM``K_]F\&0>P`-F`$0>P`2"](`!`B+P`,)"\`$'81+&P`!$ZN[ M_]`@;?_\2J@`%&<,(FW__"QX``1.KOX^2JW__&<*+RW__$ZZ`3I83TJM__AGS M"B\M__A.N@#06$]*K?_R9Q(B;?_R(#P``#:P+'@`!$ZN_RY,WT`,3EU.=0``U M(&\`!""(6)!"J``$(4@`"$YU``!(YSP@)B\`&!0O`!]Z_R\%3KD```/$$@!P< M`!`!*`!R_[*`6(]F!'``8&8O/``!``%(>``B3KD```.`)$`J"E"/9@XO!$ZYA M```#V'``6(]@0"5#``H50@`)%7P`!``(0BH`#A5$``]"ITZY```#L"5``!!*% M@UB/9PHO"DZY```#[&`*2&H`%$ZY```!^%B/(`I,WP0\3G4O"B1O``A*J@`*+ M9PHO"DZY```$`%B/%7P`_P`(``B+PI./ MN0```YA/[P`,)%].=0``("\`!$AX`#`O`$ZY```##%"/3G4@+P`$+P!.N0``7 M`TY8CTYU2.0`````@+P`(3J[^4 ML"Q?3G4O#BQY`````")O``A.KOZ>+%].=2\.+'D`````(F\`"$ZN_I@L7TYUZ M```#[`````X````````#*@```W8```+T```#!````D(```(>```"=@```LX`, M``)2```"B````I0```*R```"V@```!X````/`````0``!`0```/P```#W```, M`\@```.T```#G````X0````"````#@```!@````F````,@```$````!0````X M7`````````/R```#Z@```!<```````````````!D;W,N;&EB0!497-T> M:6YG+BXN``!T 705=214%$(&9A:6QE9"`A"@```````_)E> `` end size 1328