Re: char device driver + script



On Apr 22, 6:46 pm, guru <guru.nav...@xxxxxxxxx> wrote:
HI all,

When i run the below script, it is creating one entry in /proc/
devices. by name chrdev.
then mknod /dev/$device c $major 0 will be successful. 253

But when i do rmmod, entry from /proc/devices still be there. so when
i again run below script,

mknod /dev/$device c $major 0 will fail giving to many parameters.

254 253

I am not getting where i went wrong.

module="chrdev"

device="chrdev"

mode="664"

# invoke insmod with all arguments we got

# and use a pathname, as newer modutils don't look in . by default

/sbin/insmod ./$module.ko

# remove stale nodes

rm -f /dev/${device}

major=`awk "\\$2==\"$module\" {print \\$1}" /proc/devices`

echo $major

mknod /dev/$device c $major 0

-Regards
Gururaja

Looks like the module hasn't been unloaded properly from the previous
run and the /proc/devices still having an entry. Are you sure the
module unload code in your device driver does the
"unregister_chrdev_region()" or similar in the cleanup code?
.



Relevant Pages

  • Re: WORD doc info into FMP?
    ... it appears that each line of the entry follows the format ... number of any given type of field (Location, script, sets etc.) you might ... into a separate record in a database, and a separate related "database 2" ... Ten Nights in a Barroom (New York State Archives) ...
    (comp.databases.filemaker)
  • RE: Need some MySQL query help...
    ... attempting to run the script: ... passed to the database. ... passwd entry to the current database entry. ...
    (perl.dbi.users)
  • Re: How to make Apache (2.2.4) less greedy, or Sendmail less polite? [semi-solved]
    ... Then I make an entry in my /etc/hosts.allow file that denies access to all in my hosts.deny file. ... Firstly, I took some measures to figure out where the issues came from, and using Apache's "server-status" handler, I noticed the script that caused Apache to choke up, was a PHP script that shows entries of photographic events that I organise from time to time. ... I then wondered why, as this script never caused trouble before, and while checking the server status I did already notice that the "store comments" script was called very often. ... the machines that were used for this, and I will report them to the proper anti spam authorities, such that they will be blacklisted Internet wide. ...
    (freebsd-questions)
  • Re: Windows Explorer size reverting to 800x600
    ... I've pre-empted your reply and looking at your script I realise that the ... A similar entry exists in ... All of the folders are on a local drive. ... Const conBagMRUSize = _ ...
    (microsoft.public.windowsxp.general)
  • Re: contest software
    ... > submit an entry to a project, ... The project holder must then select a winning design. ... As ever, this list isn't a script writing service, and it certainly ... * make a web site explaining the contest ...
    (perl.beginners)