Forum Discussion
Altera_Forum
Honored Contributor
20 years agoHow to setup a driver on uClinux ?
Hi all !
I am using Microtronix uCLinux 1.4, Board Cyclone 1C12 Eval edition. When developing a driver, I did not find any commands of module installing: - make - insmod - rmmod - su - Would you tell me about what steps I must do to setup a driver ( compile, load, use, unload )? - Is there any versions of uCLinux (from Microtronix) supporting these features ? Thank you, OneNet5 Replies
- Altera_Forum
Honored Contributor
Hi,
what is necessary, you find at: http://www.niosforum.com/forum/index.php?a...=st&f=18&t=2411 (http://) The commands you are looking are integrated in the busybox. All you need to know is in the Kernel Docs which come along with your Linux Distro - Altera_Forum
Honored Contributor
Hello absolutebeginner ,
I am really curious on the link you provided since I could not view it (I have tried on many other browsers ). PLease check again. Thank you, OnetNet - Altera_Forum
Honored Contributor
I'm so sorry about the broken link...
it links to my question how to build .ko file question about building a module (http://www.niosforum.com/forum/index.php?act=st&f=18&t=2411) if it still doesn't work, you can find it on page 3 in the uclinux section of this forum. for testing you'll have to transfer your module in your niossystem of course. Here is a little example, how to use the commands. Lets assume your module name is 'Hello_Kernel': first
insert your module then you'll need make it visible in your filesystem:busybox insmod Hello_Kernel"
a and b are the major and minor numbers defined in your module code. So put will have to put the numbers instead of a and b. c is an option ! to access the module in your user application program use the open(...) command. The name of the module to be opened is "Hello_Kernel". --- you unload your module with rmmod. i recommend to read 'Linux device drivers- 3rd Edition' by Corbet & Rubini. Its published by O'reilly. there is also an online version. The online version covers an older kernel. But i don't have the link right now.mknod "Hello_Kernel" c a b" - Altera_Forum
Honored Contributor
it must be
mknod Hello_Kernel c a b and busybox insmod Hello_Kernel.ko without the character " sorry, i'm in hurry today - Altera_Forum
Honored Contributor
Hi absolutebeginner !
Thank you very much for your help. It's very clear ! Thanks again,