Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Mar 2002 00:07:50 +0200
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        yonder <y0nd3rb0y@mac.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: writing interrupt handlers
Message-ID:  <20020311220749.GB2388@hades.hell.gr>
In-Reply-To: <D30B3B79-351A-11D6-BD3D-00306578FCC8@mac.com>
References:  <D30B3B79-351A-11D6-BD3D-00306578FCC8@mac.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2002-03-11 13:07, yonder wrote:
> I recently rediscovered some old DOS (the OS, not DoS!!!) turbo pascal 
> code I wrote back in high school in which I wrote an interrupt handler, 
> placed its address in the interrupt vector table, and returned control 
> to the original handler when my new one was finished.  I was wondering 
> if there was a standard way to do this in *NIX C.  For example, I could 
> write a short function to load a sound and play it every time a key is 
> pressed... and then return control to the original handler to process 
> the keypress correctly.

The functionality is already there.  This is something that can be done
with a kernel module of some sort...  The thing is that under DOS, there
wasn't the notion of 'users', since it is not a multiuser OS.  This is why
only the superuser is allowed to 'load modules' in a running FreeBSD
kernel.  This is done for a good reason too.  Kernel modules have access to
the kernel data structures, and can bring the kernel down if they do funny
things.  Allowing everyone to load or unload arbitrary kernel modules would
be equivalent to giving everyone the permission to panic() the kernel
whenever they felt like it :-)

Giorgos Keramidas                       FreeBSD Documentation Project
keramida@{freebsd.org,ceid.upatras.gr}  http://www.FreeBSD.org/docproj/

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




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