Page 1 of 1

Page Fault Exception problem

Posted: Sat Jul 24, 2010 9:41 am
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 ?

Re: Page Fault Exception problem

Posted: Sat Jul 24, 2010 10:12 am
by Combuster
Do you know the difference between PIO and MMIO? Your source doesn't.

Re: Page Fault Exception problem

Posted: Sat Jul 24, 2010 10:21 am
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...

Re: Page Fault Exception problem

Posted: Sat Jul 24, 2010 11:41 am
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?

Re: Page Fault Exception problem

Posted: Sat Jul 24, 2010 11:44 am
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

Re: Page Fault Exception problem

Posted: Sat Jul 24, 2010 12:03 pm
by Combuster
Don't think. Know.