From owner-freebsd-hackers Mon Nov 29 10:10:35 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from celery.dragondata.com (celery.dragondata.com [205.253.12.6]) by hub.freebsd.org (Postfix) with ESMTP id 2382615402 for ; Mon, 29 Nov 1999 10:10:26 -0800 (PST) (envelope-from toasty@celery.dragondata.com) Received: (from toasty@localhost) by celery.dragondata.com (8.9.3/8.9.3) id MAA50933 for hackers@freebsd.org; Mon, 29 Nov 1999 12:12:23 -0600 (CST) (envelope-from toasty) From: Kevin Day Message-Id: <199911291812.MAA50933@celery.dragondata.com> Subject: Getting structures from kernelspace to userspace To: hackers@freebsd.org Date: Mon, 29 Nov 1999 12:12:23 -0600 (CST) X-Mailer: ELM [version 2.5 PL1] 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 In the embedded system I'm working on, I have a need to get detailed hard drive information in a userland process. Specifically, I need the contents of all the values in wddrives[]. While I've made it work, I've run into a few difficulties. If someone thinks this is useful enough, I'll clean it up to make it more presentable for inclusion, as well as a port to the ATA driver. I added the following routine to sys/i386/isa/wd.c : static intsysctl_hw_wddrives SYSCTL_HANDLER_ARGS{ int error=0; int i; for (i=0;i #include static struct disk wddrives[NWD]; /* table of units */ void foo(void) { unsigned int len; int i; len = sizeof(struct disk) * NWD; for (i=0;i