Forum Discussion
Altera_Forum
Honored Contributor
16 years agoHi,
Thank you very much for your reply! Yesterday I managed to fix the problem and, as you say, it was due to the virtual addresses mapping. The "outb" function is correct, but before this it is compulsory to make a "ioremap" call to remap the real address into virtual one (I found the "hrtimer.c" example in the Nios Wiki where something similar was used). Then, as any other device driver, "copy_to_user()" and "copy_from_user()" are needed to pass information between kernel and user space. Now, I am trying to make the device driver to read and write words instead of bytes and to use interrupts, because of my hardware requirements. I hope this to be easier hehehe By the way, I am having problems when trying to load the module with "modprobe"/"insmod". It works fine if I add it to the kernel, but when I make a "modprobe" the CPU stops running. I checked the apps config and everything is fine. I will keep on working on that!! See you!