Results 1 to 4 of 4
I have an custom embedded debian running on kernel 2.6.31. I need to insert a driver compiled as module as early as possible in the bootprocedure to start a measurement. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 08-20-2012 #1Just Joined!
- Join Date
- Aug 2012
- Posts
- 9
Permissions to make entry in /dev/tty
I have an custom embedded debian running on kernel 2.6.31. I need to insert a driver compiled as module as early as possible in the bootprocedure to start a measurement. so i wrote a c program to load the driver and make some configurations with
to the device in /dev/tty. The problem is that the device is not created at all when i add the program to be started before beeing logged in (eg in rc.local). if i run my c-program after login manually, everything is working well. is that a question of permissions? or can i make entrys to /dev only after a certain point of init? the fun thing is, that if i add a shell script doingCode:ioctl()
to rc.local at the same place, the device is perfectly created...Code:mknod /dev/ttySC0 c 205 209
thanks for any help, nimdardo
- 08-21-2012 #2Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,685
what exactly are you putting in rc.local and why is putting mknod command in rc.local (if it makes it work) not sufficient?
anyway, i would recommend redirecting the STDERR/STDOUT of all your custom rc.local commands to a log file to see if there is any useful output to look at, during the boot sequence.
- 08-21-2012 #3Just Joined!
- Join Date
- Aug 2012
- Posts
- 9
To explain a bit - I have an custom embedded system with 5 expander slots for different modules. they are recognized during the bootup process and the drivers are loaded with the appropriate settings. in this case its for RS232 expander modules. because there are 5 different IRQ-lines, and chip selects, the driver has to be loaded and later configurated with the correct settings from userspace. in my rc.local, i have the following entry:
thats why i have to make the following steps:Code:# HW Handler echo -n "Autoconfigurator Modules..." /home/autoconfigurator &> /var/bootlog echo "done."
- read eeproms on modules to check moduletype on slot 1-5
- insert the serial driver
- change sysfs for correct SPI-configuration
- change parameters for irq ports via ioctl()
and thats why i can't use the mknod variant - if i dont create the device with the driver, i cannot access via ioctl().
For the part with Logfile - I have to adapt the device driver first to make it more verbose, i will post a log soon.
thanks for your help already, simon
edit: i just discovered that when i manually start the program after login the first time the device is not created. but if i rmmod and insmod the driver again, it works well. so the problem might be in my program anyways. i will check that first...Last edited by nimdardo; 08-21-2012 at 09:26 AM.
- 08-21-2012 #4Just Joined!
- Join Date
- Aug 2012
- Posts
- 9
sorry, problem solved - i did the whole stuff in the wrong order. I did:
- insert driver
- change sysfs
- changes with ioctl()
but correct is:
- change sysfs
- insert driver
- changes with ioctl()
now my device is perfectly created - AND configured in rc.local.
thanks atreyu anyway




