flat assembler
Message board for the users of flat assembler.

Index > Main > HDD low level programming in Protected Mode stupid errors :(

Author
Thread Post new topic Reply to topic
Tyler Durden



Joined: 24 Feb 2004
Posts: 50
Tyler Durden 16 Sep 2004, 09:29
Hi ! I'm writing my own 32bit Protected mode OS... I need some hdd handling rutines... I've wrote some for Real mode (just for testing) but... when I port it to Protected mode (os.asm Smile (just changing registers type to 32b ('couse this is just hdd-ports handling rutines, you know)) It results to some stupid "bugs" (like this:)
;disable hdd interrupts
mov edx,hddPort+206h
mov al,2
out dx,al
;wait for bsy=1
mov edx,hddPort+7
.wait:
in al,dx
test al,80h
jnz .wait ;<- this bits is never get cleared somewhy !
But if I disable interrupts with the "cli" instruction it works ? Why ? I disable hdd irq either in hdd port 3f6h and APIC (port 1ah) ? Can you please tell me what I did wrong ? What stuff/bugs I must care about when handle hdd in PM ? Thanks
Post 16 Sep 2004, 09:29
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 16 Sep 2004, 09:50
It is a nice thing to disable interrupts when you are accessing hardware ports

MATRIX
Post 16 Sep 2004, 09:50
View user's profile Send private message Visit poster's website Reply with quote
Tyler Durden



Joined: 24 Feb 2004
Posts: 50
Tyler Durden 16 Sep 2004, 10:07
It doesn't metter... I disable them... And it's doesn't work Sad

_________________
Image
Post 16 Sep 2004, 10:07
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio 16 Sep 2004, 16:23
[quote="Tyler Durden"]Hi ! I'm writing my own 32bit Protected mode OS... I need some hdd handling rutines... I've wrote some for Real mode (just for testing) but... when I port it to Protected mode (os.asm Smile (just changing registers type to 32b ('couse this is just hdd-ports handling rutines, you know)) It results to some stupid "bugs" (like this:)
;disable hdd interrupts
mov edx,hddPort+206h [\cuote]
i think this is unnecessary because bios poll data (no ints)
check the error bit , probably you send invalid parameters to hd
Post 16 Sep 2004, 16:23
View user's profile Send private message Visit poster's website Reply with quote
Tyler Durden



Joined: 24 Feb 2004
Posts: 50
Tyler Durden 16 Sep 2004, 18:51
Haven't you see this:
"IT WORKS UNDER REAL MODE" ? So "NO ERRORS AND INVALID PARAMETERS"

_________________
Image
Post 16 Sep 2004, 18:51
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio 16 Sep 2004, 23:46
Tyler Durden wrote:
Haven't you see this:
"IT WORKS UNDER REAL MODE" ? So "NO ERRORS AND INVALID PARAMETERS"

If there are no errors, what was the question?
Hard disk don´t know nothing about real or protected mode, if your code
does not work in protected mode,then you have a bug somewere,but it has nothing to do whith hd.
Post 16 Sep 2004, 23:46
View user's profile Send private message Visit poster's website 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.