reading sectors, int 13h al = 02h error
Posted: Fri May 29, 2009 1:23 am
Hi again for some reason i am unable to boot my kernel using int 13h al = 02h on BOCHS or sun virtual machine.
BUT i can boot from a VMplayer machine! :/ so far i know the error is in that loop, not in the reset command, but in the reading of the sectors. For some reason under some machines this interrupt isnt working, i even booted on a real machine P4, however my Core 2 Duo wont boot up either. Am i going over the current 64k limit? or is it a problem with the parameters? what about the segments, are they correct?
The kernel consists of 49 sectors:
1 sectors, 512 bytes read from file 'bootsect.bin'
48 sectors, 24596 bytes read from file 'kernel.bin'
ty.
BUT i can boot from a VMplayer machine! :/ so far i know the error is in that loop, not in the reset command, but in the reading of the sectors. For some reason under some machines this interrupt isnt working, i even booted on a real machine P4, however my Core 2 Duo wont boot up either. Am i going over the current 64k limit? or is it a problem with the parameters? what about the segments, are they correct?
The kernel consists of 49 sectors:
1 sectors, 512 bytes read from file 'bootsect.bin'
48 sectors, 24596 bytes read from file 'kernel.bin'
Code: Select all
[BITS 16] ; We need 16-bit instructions for Real mode
[ORG 0x7C00] ; The BIOS loads the boot sector into memory location 0x7C00
jmp 0x0000:start
start:
xor ax, ax
mov ds, ax
mov es, ax
mov ax, 0
mov ss, ax
mov sp, 0
mov [bootdrive], dl ; boot drive stored by BIOS in DL.
mov di, 0FFh
reset_drive:
dec di
mov ax, di
cmp ax, 0
je errorMSG
mov ah, 0 ; RESET-command
int 13h ; Call interrupt 13h
or ah, ah
jnz reset_drive
mov ax, 0
mov es, ax
mov bx, 0x1000 ; Destination address = 0000:1000
mov ah, 02h ; READ SECTOR-command
mov al, 49 ; Number of sectors to read !!!!!!!!//I tried using 2-4 and a low # and still nothing
mov ch, 0 ; Cylinder = 0
mov cl, 02h ; Sector = 2
mov dh, 0 ; Head = 0
mov dl, [bootdrive]
int 13h ; Call interrupt 13h
or ah, ah ; Check for error code
jnz reset_drive ; Try again if ah != 0
ty.