Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Jan 2001 11:22:42 -0800
From:      Mike Smith <msmith@freebsd.org>
To:        Alfred Perlstein <bright@wintelcom.net>
Cc:        FreeBSD stable <freebsd-stable@FreeBSD.ORG>, doc@FreeBSD.ORG
Subject:   Re: Dell PERC 3 support? 
Message-ID:  <200101231922.f0NJMgS01273@mass.dis.org>
In-Reply-To: Your message of "Tue, 23 Jan 2001 10:50:39 PST." <20010123105038.S26076@fw.wintelcom.net> 

next in thread | previous in thread | raw e-mail | index | archive | help
> > 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 <msmith@freebsd.org>

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", <major>, 65538, 8, 4},

   Where <major> 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 = <major>, 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-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200101231922.f0NJMgS01273>