Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 01 May 1999 12:20:21 -0300
From:      Rodrigo Ormonde <ormonde@aker.com.br>
To:        hackers@freebsd.org
Subject:   Problems with a device KLD module
Message-ID:  <3.0.3.32.19990501122021.0069eac8@cnt.org.br>

next in thread | raw e-mail | index | archive | help
  I wrote a device kld module for FreeBSD 3.1. The module is working fine,
however there are two problems I was unable to solve:

  1 - I can load the module several times using kldload, which should not
be possible (the old lkm interface didn't let this happen).
      In order to prevent the module for being loaded twice, I wrote the
events function to return EBUSY when receiving the MOD_LOAD command if the
module was already loaded, but it didn't work.

  2 - I can unload the module even if the device it is controlling is being
used by an application. In this case, when I kill the application (after
unloading the module) the kernel panics.
      I tried to return EBUSY when receiving the MOD_UNLOAD command, in
order to prevent the module of being unloaded. This worked in part: the
kldunload reported the module was busy and didn't unloaded it, however, the
device no longer operated. No applications were able to access it anymore.

  Does anyone know how to prevent a kld module of being loaded twice and
how to prevent it of being unloaded when the device it controls is in use ?

  Please send a copy of the answers directly to me, I'm not on the list.

  Thanks in advance,

--
Rodrigo de La Rocque Ormonde
e-mail: ormonde@aker.com.br
Aker Consultoria e Informatica LTDA - http:///www.aker.com.br

--> Turn your PC into a workstation. Use FreeBSD <--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3.0.3.32.19990501122021.0069eac8>