Archived

This topic is now archived and is closed to further replies.

dj_culprit

raw diskette reading

Recommended Posts

dj_culprit    122
I would like to do some raw diskette reading/writing, first I begin by reseting the drive(IRQ #13, REG_everything = 0?) Then to read I would use those params: (Ralph Browns interrupt list) " INT 13 - DISK - READ SECTOR(S) INTO MEMORY AH = 02h AL = number of sectors to read (must be nonzero) CH = low eight bits of cylinder number CL = sector number 1-63 (bits 0-5) high two bits of cylinder (bits 6-7, hard disk only) DH = head number DL = drive number (bit 7 set for hard disk) ES:BX -> data buffer Return: CF set on error if AH = 11h (corrected ECC error), AL = burst length CF clear if successful AH = status (see #00234) AL = number of sectors transferred (only valid if CF set for some BIOSes) " Well, guess if I had it working Tried with the following values: AX = #0202 CX = #0000 DX = #0000 ES = high byte //tried swapping those two BX = low byte // interrupts return: for disk reset(dec, "," seperation) 0,0,0,0,0,0,2,12870,0,0 and read returns(hex, "," seperation) 0,0,0,47,0,0,200,3297,E038,0 first number being REG_DI, numbers are: REG_DI = 1 REG_SI = 2 REG_BP = 3 REG_BX = 4 REG_DX = 5 REG_CX = 6 REG_AX = 7 REG_FLAGS = 8 REG_ES = 9 REG_DS = 10 BTW: I did have a diskette in the diskette driver So no need to verify that ok?

Share this post


Link to post
Share on other sites
jenova    122
this will work in MS-DOS and Win9x (very easy to get ring 0 access in Win9x).
this will not work in WinNT/2K/XP (unless you create a VxD).

To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.

Share this post


Link to post
Share on other sites
dj_culprit    122
allocate 10240 bytes of low memory, put high bits in ES and low bits BX
(
IRQin[REG_BX] = floor(memsegment/#10000) //get high bits
IRQin[REG_ES] = remainder(memsegment, #10000) //get low bits
)

sets memory segment to 10''s, try interrupt, read memory segment, still 10''s(in pure DOS)

Share this post


Link to post
Share on other sites