Int 13/AH=02 h: read sector
Entrance parameters:
AH=02 h
AL=sectors
CH=cylinder
CL=sector
DH=head
DL=drive, 00 h ~ 7 fh: floppy disk; 80 h ~ 0 FFH: hard drive
ES: BX=buffer address
Export parameters:
CF=0: the operation is successful, AH=00 h, AL=transport sectors; Otherwise, the status code AH=
In fact, trying to access across the border from 64 k or greater than 0 x80 (128) sector, will be an error, tip:
The data boundary error (attempted DMA'll 64 k a boundary or & gt; 80 h sectors)
In this case, the CF marked position, AH registers for 0 x09.,
But in the actual experiments, trying to read 57 sectors appear a mistake, when I was in the debug to find CF marked position, AH registers for 0 x09.,
Why is this?
Also encountered when trying to read the 56 sector, in the last call interrupt, namely int $0 x13, program stuck in this place has not bottom go to, interrupt also does not return,
Why is this?
The code is as follows:
Mov $0 x02, % ah
Dl # $0 x81 mov, %
Mov $0 x00, dl # drive % 0
# the sector begin to read
Mov $0 x00, % dh
Mov $0 x00, % ch
Mov $0 x02, % cl
Mov $k_kernel_size_in_sector, % al
Mov $0 x00, % bx
Int $0 x13
# # if read success, cf whenever cleard, or elsed cf whenever set.
# #
# # so, if the cf is cleard to display "the load setup ok.
"JNC bprint_setup_load_ok
This code under the bochs simulation, reading is a floppy disk,