Altera_Forum
Honored Contributor
16 years agouClinux in Nios II with MMU - Device Driver Kernel Panic
Hi,
I'm developing a uClinux MMU kernel over a Nios II FPGA system and I'm having a lot of problemes when trying to run a custom device driver. I've managed to run a "Hello world" driver, but now I'm trying to run a "PIO port" driver with an Init function like:static int __init Init_LEDS(void){
if (!(request_mem_region((unsigned long)PIO_0_BASE, PIO_0_SPAN, "Leds")))
return -1;
if(register_chrdev( MAJOR_LED, MODULE_NAME, &Fops_Leds )){
printk("Error!!!!");
return -EIO;
}
printk("%s OK\n",MODULE_NAME);
Data = 1;
outb(Data,Pos_Leds_Mem);
return 0;
} This code prints the "printk" message but then it returns the following error in "outb": CPU 0 Unable to handle kernel paging request at virtual address 08001000, epc == c22210e0, ra == c22210d4
Kernel panic - not syncing: Oops I think it is probably due to the fact that I'm using a MMU system instead of a MMU-less one, but I've read other device drivers included in the uClinux MMU package and they also use the "outb" or "outl" function. Does anybody know how could I fix this problem, please? Or has anybody managed to create a character device driver for the MMU uClinux kernel? Thank you very much in advance. See you!