From owner-freebsd-hackers Thu Oct 31 09:21:39 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id JAA22039 for hackers-outgoing; Thu, 31 Oct 1996 09:21:39 -0800 (PST) Received: from bacall.lodgenet.com (bacall.lodgenet.com [205.138.147.242]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id JAA22026 for ; Thu, 31 Oct 1996 09:21:33 -0800 (PST) Received: (from mail@localhost) by bacall.lodgenet.com (8.6.12/8.6.12) id LAA18112 for ; Thu, 31 Oct 1996 11:21:18 -0600 Received: from garbo.lodgenet.com(204.124.123.250) by bacall via smap (V1.3) id smaa18076; Thu Oct 31 11:21:07 1996 Received: from jake.lodgenet.com (jake.lodgenet.com [204.124.120.30]) by garbo.lodgenet.com (8.6.12/8.6.9) with ESMTP id LAA20388 for ; Thu, 31 Oct 1996 11:17:30 -0600 Received: from jake.lodgenet.com (localhost.lodgenet.com [127.0.0.1]) by jake.lodgenet.com (8.7.6/8.6.12) with ESMTP id LAA06956; Thu, 31 Oct 1996 11:17:00 -0600 (CST) Message-Id: <199610311717.LAA06956@jake.lodgenet.com> X-Mailer: exmh version 1.6.9 8/22/96 To: "Allen W. Gambert" cc: hackers@FreeBSD.ORG Subject: Re: problems with device driver In-reply-to: Your message of "Thu, 31 Oct 1996 10:45:45 EST." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 31 Oct 1996 11:16:56 -0600 From: "Eric L. Hernes" Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk "Allen W. Gambert" writes: >I've checked the majors.i386 file and decided to use major device number >77, the last free entry in that file. After creating the device nodes I >use kermit to try to open the device. I keep getting 'Sorry, can't open >connection: /dev/mb0: Device not configured'. I believe this is caused >by the open routine returning 'ENXIO'. The problem is the kernel is not >calling my open routine but instead some other open routine. I know its >not calling my open routine because its not printing out the printf's >i've placed at the beginning of 'mbopen'. 2.1* or -current. Under 2.1* you've got to edit sys/i386/i386/conf.c and add an entry to the cdev switch, in the 77th slot if that's your major number. Under -current, you've got to add the cdevsw[] entry to your driver and call cdevsw_add() somewhere in your probe or attach, probably attach. you can test basic open/close/read/write/ioctl straight from the shell by: open: $ exec 9>/dev/mydev close: $ exec 9>&- read: (and open/close) $ cat /dev/mydev write: (and open/close) $ cat somefile >/dev/mydev ioctl: $ stty >My question is what can I do to determine why my open routine is not >being called but instead some other open routine is being called? I must be >over looking something, but I just cant seem to figure out what. If >someone can point me in the right direction I would greatly appreciate it. > install the devsw entries. >Also. I was hoping to make this device driver an lkm instead of hard >coding it into the kernel. The only problem is I cant seem to find any >documentation on lkm other than the man pages. Does anyone know where I >might be able to find some documentation on lkm? > have a look-see at http://www.freebsd.org/~erich/ddwg.html (or thereabouts), its sparse and a little (lot) out of date, but it should get you going. >Thanks for you help. > >Allen > g'luck, eric. -- erich@lodgenet.com http://rrnet.com/~erich erich@rrnet.com