From owner-freebsd-hackers Mon Mar 11 16:52:57 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id QAA05281 for hackers-outgoing; Mon, 11 Mar 1996 16:52:57 -0800 (PST) Received: from doleh.com (doleh.nai.net [205.139.1.114]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id QAA05276 for ; Mon, 11 Mar 1996 16:52:54 -0800 (PST) Received: (from yaser@localhost) by doleh.com (8.6.12/96.03.01.0) id TAA05485; Mon, 11 Mar 1996 19:54:07 -0500 From: "Yaser K. Doleh" Message-Id: <199603120054.TAA05485@doleh.com> Subject: Re: First attempt to write a device driver To: msmith@atrad.adelaide.edu.au (Michael Smith) Date: Mon, 11 Mar 1996 19:54:06 -0500 (EST) Cc: freebsd-hackers@FreeBSD.org In-Reply-To: <199603120016.KAA24351@genesis.atrad.adelaide.edu.au> from "Michael Smith" at Mar 12, 96 10:46:43 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk I have one more questions which I could not figure out by looking at the source. The card have 64K shared memory which can be mapped into the machine address space. I can map 16K, 32K or the whole 64K into the address space. My question is how can I find an empty slot in the area 640 - 1MB that I can map this memory into. The driver must choose the location and set a register in the Token Ring card to tell it where to map the memory. My second question is "Do I use pmap_mapdev function ?" Michael Smith said in a letter > > Make sure the above is in your config, make sure you have interrupts > enabled on the card. > It must be the card not sending any interrupts. I guess I have to RTFM that IBM manual again. > You mean the 'visual' mode doesn't know your driver? That's because there's > no way for it to find all the names of drivers installed itself, so that > information is in the table at the top of /sys/i386/i386/userconfig.c. > Look for the string "EDIT THIS LIST", and create an entry like the other > network devices. > Yes, that's what I was looking for. Thank you. > Looks like you've got the rest of the skeleton working fine. > Yes, most of it is there. > > I am also thinking of really hooking the driver to the ethernet code > > and just convert tokenring<->ethernet in my driver. So to the machine > > it will look like this is an ethernet driver but to the network > > it will look like its a tokenring. > > Um, that's an interesting approach. I'd be inclined to seperate the two so > that the token-specific code could be reused for other hardware though. > That was a suggestion of somebody else which made me think "This is a good idea, I can get the Hardware driver working first and test it this way then I can worry about the higher layer later". I am not at that point yet, I just wanted to see what people will think about this approach. If I decide to take this approach, I will definitly seperate the driver from the conversion routines. I also have been looking at if_ethersubr.c and if_fddisubr.c files to see how easy will it be to write similar functions to handle Token Ring. > Have a look at /sys/net/if_ether.c. There's already code in there to handle > LLC (look for "LLC" 8) which I believe is the major obstacle. Your driver > shouldn't try to interpret the contents of packets itself. Thanks, I'll check it out. Very truly yours Yaser Doleh Yaser@Doleh.Com