[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Direct access to disk drive in DOS 3.3?



"Jayson Smith" <nospamratguyspambegone@nospamplease.bellsouth.ihatespam.net>
wrote in message news:F081d.53980$Np2.19386@bignews4.bellsouth.net...
> Hi there,
> What's the easiest way in a machine language program to access the 5.25
disk
> drive directly E.G. not via RWTS?  I have one application in mind already.
> I'd like to be able to make a copy of a copy protected disk.  Yes, I know
> that programs E.G. copy II Plus do this, but I happen to know where the
> protection is stored.  It's stored in track 2, sector 15 of the disk, in
> such a form as to produce an I/O error under Dos.  The strange thing is
that
> the program works just fine on the emulator I use.  I guess the protected
> sector is read correctly by ADT but you can't just copy that to another
disk
> using RWTS as it would no longer produce an error.  So what would be the
> easiest way to write a program, either in machine language or in Basic
using
> a machine language call, to read in that sector and write that same
sector,
> complete with errors, to the same sector on another disk?

It would be interesting to see what you get with the prodos read block /
write block commands. Very little code required and the ref manual gives you
the formula to determine what track-sector each half block corresponds to.

What emulator are you using?

track 2 sector 15 of the disk should reside in second half of block 23.

       ORG $300
       JSR $BF00  ;MLI CALL
       DFB $80     ;READ BLOCK
       DFB $09,$03 ;PARAMETER LIST ADDRESS
       BCS  ERROR ; REPORT PROBLEM
       BRK              ; CRASH INTO MONITOR AND EXAMINE DATA
;$0309:
       DFB $03   ;PARM COUNT
       DFB $60  ;SLOT 6 DRIVE 1 USE $E0 FOR DRIVE 2
       DFB $00,$10 ;$1000 DATA BUFFER, SEE NOTE
       DFB $17,$00  ;BLOCK 23

;NOTE: track 2 sector 15 starts at $1100