The basic BIOS Int 13H call is a disk basic input/output interrupt call provided by BIOS. It can complete functions such as disk (including hard disk and floppy disk) reset, read/write, verification, positioning, diagnosis, formatting, etc.
It uses the CHS addressing method, so it can only access a hard disk of about 8 GB at most.
The purpose of extending the Int13H interface is to expand the functions of BIOS, so that it can support hard disks with more than 1024 cylinders, as well as functions such as locking, unlocking and ejecting of removable media.
DAP is based on the absolute sector address, so using DAP, Int13H can easily surpass the limit of 1024 cylinders because it doesn't need the concept of CHS at all.
I debugged successfully under win98 and dos71 with qb45
'In qbasic, to call the interrupt, 1 must add the L command, such as QB/L 2. Must reference qb.bi', as follows
[ Last edited by qb45 on 2006-7-9 at 11:14 ]
It uses the CHS addressing method, so it can only access a hard disk of about 8 GB at most.
The purpose of extending the Int13H interface is to expand the functions of BIOS, so that it can support hard disks with more than 1024 cylinders, as well as functions such as locking, unlocking and ejecting of removable media.
DAP is based on the absolute sector address, so using DAP, Int13H can easily surpass the limit of 1024 cylinders because it doesn't need the concept of CHS at all.
I debugged successfully under win98 and dos71 with qb45
'In qbasic, to call the interrupt, 1 must add the L command, such as QB/L 2. Must reference qb.bi', as follows
'$INCLUDE: 'qb.bi'
DIM SHARED ax, bx, cx, dx, bp, si, di, ds, flags, es '// Global sharing
BUFFdat$ = STRING$(512, 0) '// Create a read/write sector buffer (512 bytes)
d1% = varSEG(buffdat$) '// Get the segment address of the buffer
d2% = SADD(buffdat$) '// Get the offset address of the buffer
'// Write data such as segment address, offset address, read/write command, etc. into the data packet (DAP) as required
dat1$ = CHR$(&H10) + CHR$(0) + MKI$(1) + MKI$(d2%) + MKI$(d1%) + MKL$(0) + MKL$(0)
ds = varSEG(dat1$) '// DS = segment address of the data packet (DAP)
si = SADD(dat1$) '// SI = offset address of the data packet (DAP)
ax = &H4200 '// AX = call the read sector command of extended INT13
dx = &H80 '// DX = the first hard disk
xint &H13 '// Call INT13 interrupt
'//------Save the content of the read MBR sector to the TESTHD.DAT file on drive D------
OPEN "d:\testhd.dat" FOR BINARY AS #1
PUT 1,1,BUFFDAT$
CLOSE #1
'//----------------------------------------------------------------------
END
'//Subroutine for interrupt call
SUB xint (num%)
DIM inregs AS RegTypeX
DIM outregs AS RegTypeX
inregs.ax = ax
inregs.bx = bx
inregs.cx = cx
inregs.dx = dx
inregs.si = si
inregs.di = di
inregs.ds = ds
inregs.es = es
CALL INTERRUPTX(num%, inregs, outregs)
ax = outregs.ax
bx = outregs.bx
cx = outregs.cx
dx = outregs.dx
si = outregs.si
di = outregs.di
ds = outregs.ds
es = outregs.es
END SUB
[ Last edited by qb45 on 2006-7-9 at 11:14 ]


