Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This code should only have 3 possible outcomes as far as what it prints to screen:
- "Reading.....Success" periods for each timeout until int13 gives no error
- "Reading.....Failure" periods for each timeout until an error other than timeout is given
- "Reading............" infinite loop of printing periods because of infinite timeouts
- ------------------------------------------------------------------------------------------
- read:
- mov $reading_message,%si #prints "Reading" message
- call putstr
- read.retry:
- mov $read_retry,%si #prints a '.' for each read attempt
- call putstr
- mov $0x42,%ah
- mov drive,%dl
- mov $edd_packet,%si
- int $0x13 #all registers are set and, extended read call
- #is executed
- jc read.fail #if read had no error then
- #print "Success" and return to caller
- #if error then jump to read.fail
- mov $reading_done,%si
- call putstr
- ret
- read.fail:
- cmp $0x80,%ah #if error was read timeout start another attempt
- je read.retry
- mov $unknown_fail,%si #for any other error just
- #print 'Failure'
- #and give up
- call putstr
- --------------------------------------
- edd_packet: .byte 0x10 # Length
- .byte 0 # Reserved
- edd_len: .byte 0x0 # Num to read
- .byte 0 # Reserved
- edd_addr: .word 0x0,0x0 # Seg:Off
- edd_lba: .quad 0x00 # LBA
- ------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement