flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Int 13h - READ

Author
Thread Post new topic Reply to topic
mkriegel



Joined: 15 Jul 2007
Posts: 19
Location: Germany
mkriegel
Hi to all; I'm writing on my own kernel and now I want to load some more sectors from my FD into RAM beginning at segment 50h (Real Mode).

First question:
Do the Int 13h ah=4xh - extensions also work fith Floppy Disks?

I tried both (ah=02h and ah=42h) but it doesn't work.

This is a part of my code:

Retry:
mov ax, 50h
mov es, ax
mov dl, 0
mov ah, 0h
int 13h
mov ah, 2h
mov al, 2 ;sect. count
mov cx, 1 ;also load boot sector
mov dh, 0
mov bx, 0
int 13h
;check for errors
mov ah, 1h
int 13h
cmp al, 0
jne Retry
jmp 50h:200h

Until now I found out the following:
The processor seems to hang in the 'Retry'-Loop because it doesnt react on any command after 'jne Retry'.
If I use the code without such a loop, the code at 50h:200h is not executed.

Thx for helping

MK
Post 15 Jul 2007, 13:38
View user's profile Send private message Reply with quote
inflater



Joined: 11 Mar 2007
Posts: 6
inflater
Greetings,
Try this:

Code:
push es       ;Save ES
read_again:
xor ax,ax     ;AX=0
mov bx,ax    ;BX=0
mov cx,ax    ;CX=0 
mov dx,ax   ;DX=0
int 13h
jc failure
mov ax,0202h
mov cl,1
mov bx,50h
mov es,bx    ;ES:BX=0050:0200h
mov bx,200h
int 13h
jc read_again
jnc continue
failure:
pop es
mov si,...    ;Display the failure message
...
mov ah,0x4C ;Exit the program or hang or whatever, but
int 21h          ;dont continue
continue:
pop es
mov ax,0050h ;Just in case
mov bx,0200h ;and this too
push ax
push bx
sti
retf    


Should work, but it's untested. Give it a try Smile

inflater
Post 15 Jul 2007, 17:21
View user's profile Send private message Reply with quote
mkriegel



Joined: 15 Jul 2007
Posts: 19
Location: Germany
mkriegel
Thank you, inflater.

I tried your code in my code frame and it didn't work too. Now I fount out, that a wrong value in sp was the prob.
Post 15 Jul 2007, 18:37
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.