Page Fault Exception problem

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
Almamu
Member
Member
Posts: 47
Joined: Wed Jul 07, 2010 9:41 am

Page Fault Exception problem

Post by Almamu »

I'm trying to support ATA and ATAPI drivers in my OS, but when i do this:

Code: Select all

//set up Device Control register
pio_outbyte( CB_DC, dc );
it gives a Page Fault Exceptions, and halts...
definitions of dc and CB_DC:

Code: Select all

#define CB_DC 8
//In the same function that the pio_outbyte error:
unsigned char dc;
//setup registry values:
dc = (unsigned char) ( int_use_intr_flag ? 0 : CB_DC_NIEN );
pio_outbyte:

Code: Select all

static void pio_outbyte( int addr, unsigned char data )
{
   //!!! write an 8-bit ATA register
   * pio_reg_addrs[ addr ] = data;
}
Any idea ?
Image
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Page Fault Exception problem

Post by Combuster »

Do you know the difference between PIO and MMIO? Your source doesn't.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Almamu
Member
Member
Posts: 47
Joined: Wed Jul 07, 2010 9:41 am

Re: Page Fault Exception problem

Post by Almamu »

Combuster wrote:Do you know the difference between PIO and MMIO? Your source doesn't.
Im only using PIO only to test it and try to code a working driver...
Image
User avatar
NickJohnson
Member
Member
Posts: 1249
Joined: Tue Mar 24, 2009 8:11 pm
Location: Sunnyvale, California

Re: Page Fault Exception problem

Post by NickJohnson »

Here's a hint: the x86 has separate PIO and memory/MMIO address spaces. Pointers are for one of them: can you guess which?
User avatar
Almamu
Member
Member
Posts: 47
Joined: Wed Jul 07, 2010 9:41 am

Re: Page Fault Exception problem

Post by Almamu »

NickJohnson wrote:Here's a hint: the x86 has separate PIO and memory/MMIO address spaces. Pointers are for one of them: can you guess which?
I think i haven't understanded the question, but i guess it's PIO
Image
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Page Fault Exception problem

Post by Combuster »

Don't think. Know.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply