Reading kernel into memory
Posted: Tue Jan 06, 2009 5:35 pm
I am sorry because the topic may have been discussed thousand times before, but I cannot work it out.
I'm trying to read the second floppy sector to 0x10000 using extended read int 13h AH = 0x42, but carry is set and AH contains the errorcode 1.
The code is this (dl contains 0):
Can anyone see my mistake? I checked if extended read is supported (which should be) before.
Also whats the "better" way to load the kernel int 13 AH = 2h or AH = 42h? Does it make any difference except the different way of adressing?
(Please excuse if there are any mistakes, english isn't my native language.)
Thanks,
Cyf
I'm trying to read the second floppy sector to 0x10000 using extended read int 13h AH = 0x42, but carry is set and AH contains the errorcode 1.
The code is this (dl contains 0):
Code: Select all
READ_SECTORS equ 5
[...]
mov si, TestMSG
call StrOut ; just a test message to see if it gets here
mov ah, 42h ; Funktionsnummer 42h
mov si, DAP ; Offset des DAP
int 13h ; Interrupt
; here it jumps into Panic-Code, displaying the error
jc short Panic ; Carry bei Fehler, Fehlercode in AH, bei Erfolg AH = 0
; Meldung ausgeben
mov si, LoadedMSG
call StrOut
[...]
align 4 ; Füllbytes um einen durch 4 teilbaren Offset für die DAP zu erreichen
DAP:
db 10h ; size of DAP (16 Byte)
db 0 ; unused
dw READ_SECTORS ; Anzahl zu lesende Sektoren (0 bis max. 127) / erfolgreich gelesene Sektoren
dw 0000h ; Zieladresse 16-bit Offset
dw 1000h ; Zieladresse 16-bit Segment
dq 1 ; absolute Nummer des Sektors ab dem gelesen werden soll (beginnt bei 0)
Also whats the "better" way to load the kernel int 13 AH = 2h or AH = 42h? Does it make any difference except the different way of adressing?
(Please excuse if there are any mistakes, english isn't my native language.)
Thanks,
Cyf