ATA PIO: on 0x1F7 command General Protection Fault

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
raistlinthewiz
Member
Member
Posts: 34
Joined: Wed Jun 29, 2005 11:00 pm
Contact:

ATA PIO: on 0x1F7 command General Protection Fault

Post by raistlinthewiz »

Hi, it seems i do have a very strange problem here.
For a time i've been trying to code a basic ata driver.

I did read many documentation and example source codes.

I'm working on qemu.
The strange problem is that when i write to command register 0x1F7 of primary controller, - any value - i just get a General Protection Fault.

I do have a basicly working kernel. Do have gdt, idt, keyboard, console, timer etc stuff. Everything seems to work very well except this.

Tried many different things but no success.
outportb(0x1f7, 0x20);
outportb(0x1f7, 0xec);
etc... whenever i do try to put a byte on port 0x1f7 i do get the GPF.

Anyone did already meet this situation before?

In my last try i did ported this code;
http://www.osdev.org/phpBB2/viewtopic.p ... hlight=lba

Before did try many other example codes too but doesn't change..

I can provide specific code details if requested.

Thanks, Hüseyin
User avatar
raistlinthewiz
Member
Member
Posts: 34
Joined: Wed Jun 29, 2005 11:00 pm
Contact:

Post by raistlinthewiz »

checked with bochs and vmware too.. same GPF. i can't understand why it's a general protection fault. if a had faulty setup anywhere in the kernel, GPF would fire in many other locations but now just - PIO outporb(1F7,0x??)

:? :? :?
frank
Member
Member
Posts: 729
Joined: Sat Dec 30, 2006 2:31 pm
Location: East Coast, USA

Post by frank »

Are you sure that you have proper IDT entries for IRQs 15 and 16? Those two are the IRQs for the hard drive.
User avatar
raistlinthewiz
Member
Member
Posts: 34
Joined: Wed Jun 29, 2005 11:00 pm
Contact:

Post by raistlinthewiz »

yes i do have entries enabled for irq14 & irq15.

but i'll check once more for any errors when i return home
Post Reply