call on the ata driver, a pointer to a file struct is taken as an
argument, and within that struct is an int containin the device number
to be looked up. well, when the open() function tries to access
file->device it causes a page fault (interrupt 14. this is correct,
right?). i don't understand why. and what is the proper way of handling
a page fault?
code is similar to this.
Code: Select all
typedef struct _file_t
{
unsigned int device;
...
} file_t;
------------
file_t file;
file.device = 1;
ata_open(&file);
------------
int ata_open(file_t *file)
{
k_printf("%s called\n", __FUNCTION__); // this prints fine
// page fault here from dereference of file to get device number.
k_printf("%s: getting device info for device %d\n", __FUNCTION__,
file->device);
...
}
Anthony Lineberry