From owner-freebsd-doc Tue Jan 23 11: 7:37 2001 Delivered-To: freebsd-doc@freebsd.org Received: from mass.dis.org (mass.dis.org [216.240.45.41]) by hub.freebsd.org (Postfix) with ESMTP id DE6E837B404; Tue, 23 Jan 2001 11:07:15 -0800 (PST) Received: from mass.dis.org (localhost [127.0.0.1]) by mass.dis.org (8.11.1/8.11.1) with ESMTP id f0NJMgS01273; Tue, 23 Jan 2001 11:22:42 -0800 (PST) (envelope-from msmith@mass.dis.org) Message-Id: <200101231922.f0NJMgS01273@mass.dis.org> X-Mailer: exmh version 2.1.1 10/15/1999 To: Alfred Perlstein Cc: FreeBSD stable , doc@FreeBSD.ORG Subject: Re: Dell PERC 3 support? In-reply-to: Your message of "Tue, 23 Jan 2001 10:50:39 PST." <20010123105038.S26076@fw.wintelcom.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 23 Jan 2001 11:22:42 -0800 From: Mike Smith Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > > Adding new disk types is just too damn painful. 8( > > How about a mini-howto? Both you and I messed it up several times. > It would help to reduce the chance if there was a step-by-step > out there to remind the disk driver gurus. :) Please arrange to have this put wherever it'll do the most good... Adding Your new Disk Driver, Mini-Howto r1.0 ------------------------------------------------------------------ (c) 2001 Michael Smith Adding a disk driver to FreeBSD is relatively easy, but there are a number of non-obvious steps that must be followed for it to all work right. We assume here that you have already successfully developed and tested your driver, and that you're ready to commit it to the tree. If you're not committing it, you can still generate diffs for the various files to make the actual commit process move more quickly. 1) Commit the driver. This part is obvious. 2) Commit the module Makefile. All drivers should build as modules. You probably built as a module while you were testing, so don't forget this part. Don't forget to add your module to the parent Makefile as well. 3) Commit the manpage. All drivers should have manpages. The manpage should try to list all the hardware your driver supports, as well as all the diagnostic messages it might print and their causes. Don't forget to add the manpage to the list in the Makefile. Don't put your manpage in an arch-specific directory unless the driver or device is *absolutely* architecture-specific. 4) Update the list in sysinstall/devices.c. For a disk device, the entry should look like: {DEVICE_TYPE_DISK, "foo%d", "FOO disk", , 65538, 8, 4}, Where is the cdev major number of your driver. 5) Update libdisk/create_chunk.c, by adding a line to parse the disk name in MakeDev(): else if (!strncmp(p, "foo", 4)) cmaj = , p += strlen("foo"); 6) Update libdisk/disk.c, by adding an entry for your disk driver's name in the device_list[] array. 7) Update MAKEDEV to create disk devices for your driver, and (optionally) a control device. You should update: - The 'Disks:' comment at the head of the file. - The 'Individual slices.' conditional. - The (unmarked) 'whole disk' conditional. Use one of the other disk device entries as an example here. The 'name' and 'chr' variables are set to the name and character major number of the disk respectively. The subconditionals exist to deal with the different name lengths (to parse the unit number), and you should add your driver to the appropriate case. -- ... every activity meets with opposition, everyone who acts has his rivals and unfortunately opponents also. But not because people want to be opponents, rather because the tasks and relationships force people to take different points of view. [Dr. Fritz Todt] V I C T O R Y N O T V E N G E A N C E To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message