From owner-freebsd-hackers Mon Sep 21 16:04:08 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA05489 for freebsd-hackers-outgoing; Mon, 21 Sep 1998 16:04:08 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from smtp04.primenet.com (smtp04.primenet.com [206.165.6.134]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA05405 for ; Mon, 21 Sep 1998 16:03:47 -0700 (PDT) (envelope-from tlambert@usr04.primenet.com) Received: (from daemon@localhost) by smtp04.primenet.com (8.8.8/8.8.8) id QAA16617; Mon, 21 Sep 1998 16:03:15 -0700 (MST) Received: from usr04.primenet.com(206.165.6.204) via SMTP by smtp04.primenet.com, id smtpd016573; Mon Sep 21 16:03:08 1998 Received: (from tlambert@localhost) by usr04.primenet.com (8.8.5/8.8.5) id QAA20590; Mon, 21 Sep 1998 16:03:06 -0700 (MST) From: Terry Lambert Message-Id: <199809212303.QAA20590@usr04.primenet.com> Subject: Re: lkm query To: ncb05@uow.edu.au (Nicholas Charles Brawn) Date: Mon, 21 Sep 1998 23:03:06 +0000 (GMT) Cc: freebsd-hackers@FreeBSD.ORG In-Reply-To: from "Nicholas Charles Brawn" at Sep 21, 98 11:55:05 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > I'm interested in knowing whether it is possible to modify values in a > loaded lkm via userland tools. I'm aware of syscall(), but the syscall > number of the lkm may vary depending on other loaded modules. The type > of module is "misc". This is typically achieved through exportation of a pseduo-device into the device space to allow for control of the module. The LKM prototype code was, in fact, a statically linked driver on an SVR4.0.2 kernel (since I had access to System V source code through my university, and through my own transferrable SVR3.2 source licenses for three of the pieces of hardware I own -- the license came with the hardware; it's transferrable after all). I did the initial work because SVR4.0.2 did not support loadable devices. I then ported it to SunOS, which supported loadable devices, but not loadable system calls. Once in the KVA, the device driver was free to blow any data it wanted... including sysent[] entries. 8-). For system calls, the slot number is returned in the modstat, precisely because the slot may be randomly assigned. The intent is that a program loading a system call will use the modstat type interface to get this number, and then call "syscall(2)" using the number as the first argument. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message