[BACK]Return to MAKEDEV.mi CVS log [TXT][DIR] Up to [local] / src / etc

Annotation of src/etc/MAKEDEV.mi, Revision 1.21

1.1       todd        1: include(MAKEDEV.sub)dnl
                      2: dnl
1.21    ! todd        3: vers(a,{-$OpenBSD: MAKEDEV.mi,v 1.20 2002/01/23 06:43:53 todd Exp $-})dnl
1.1       todd        4: dnl
                      5: divert(1)dnl
                      6: {-#-}
                      7: {-#-} Copyright (c) 2001 Todd T. Fries <todd@OpenBSD.org>
                      8: {-#-} All rights reserved.
                      9: {-#-}
                     10: {-#-} Redistribution and use in source and binary forms, with or without
                     11: {-#-} modification, are permitted provided that the following conditions
                     12: {-#-} are met:
                     13: {-#-} 1. Redistributions of source code must retain the above copyright
                     14: {-#-}    notice, this list of conditions and the following disclaimer.
                     15: {-#-} 2. The name of the author may not be used to endorse or promote products
                     16: {-#-}    derived from this software without specific prior written permission.
                     17: {-#-}
                     18: {-#-} THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
                     19: {-#-} INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
                     20: {-#-} AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
                     21: {-#-} THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
                     22: {-#-} EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
                     23: {-#-} PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
                     24: {-#-} OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
                     25: {-#-} WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
                     26: {-#-} OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
                     27: {-#-} ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
                     28: {-#-}
                     29: dnl
                     30: dnl Diversions:  (upon termination, concatenated output queues)
                     31: dnl
                     32: dnl 0 - very top
                     33: dnl 1 - descriptions of devices
                     34: dnl 2 - init of script, function definitions, etc
                     35: dnl 3 - beginning of global recursive R() function
                     36: dnl 7 - body of MAKEDEV, device creations, etc
                     37: dnl 9 - end
                     38: dnl
                     39: dnl HOW TO ADD A DEVICE:
                     40: dnl
                     41: dnl In this file, you must use at least two macros:
                     42: dnl
                     43: dnl  Use '__devitem(uniqueid,name-pattern,description)' to create an entry
                     44: dnl  in the description at the top of the generated MAKEDEV file:
                     45: dnl
                     46: dnl    __devitem(sca,sca*,Sugar Generic device)dnl
                     47: dnl
                     48: dnl  This is ultimately shown as:
                     49: dnl
                     50: dnl    #  sca*   Sugar Generic device
                     51: dnl
                     52: dnl  Use '_mkdev(uniqueid,shell-pattern,{-shell-script-})dnl' to create
                     53: dnl  a shell script fragment used to 'create' the device (be sure to match
                     54: dnl  the uniqueid from above):
                     55: dnl
                     56: dnl    _mkdev(sca,sca*,{-M sca$U c major_sca_c $U
                     57: dnl           M rsca$U b major_sca_b Add($U,128)-})dnl
                     58: dnl
                     59: dnl  This is ultimately expanded into:
                     60: dnl
                     61: dnl    sca*)  M sca$U c 24 $U
                     62: dnl           M sca$U b 42 $(($U+128));;
                     63: dnl
                     64: dnl In the MAKEDEV.md file, add a '_DEV(uniqueid,charmajor,blockmajor)'
                     65: dnl entry:
                     66: dnl
                     67: dnl   _DEV(sca,24,42)
                     68: dnl
                     69: dnl Final step is to add an entry to the 'all' entry below. For a short
                     70: dnl example:
                     71: dnl
1.4       todd       72: dnl   _mkdev({-all-},{-all-},{-dnl
1.1       todd       73: dnl   _dl({-std-},{-std-},{-sca-},{-sca0 sca1 sca2 sca3-})-})dnl
                     74: dnl
                     75: dnl would expand to:
                     76: dnl
                     77: dnl   all)
                     78: dnl        R std sca0 sca1 sca2 sca3
                     79: dnl        ;;
                     80: dnl
                     81: dnl presuming '_DEV(sca..' and '_DEV(std)' were in the MAKEDEV.md file.
                     82: dnl
                     83: dnl
                     84: dnl Everything is 'automatically' added to 'MAKEDEV' based on whether or
                     85: dnl not the '_DEV()' entry has a corresponding _mkdev() and __devitem()
                     86: dnl entry in MAKEDEV.sub (this file).
                     87: dnl
                     88: dnl Note: be very wary of adding whitespace, carriage returns, or not
                     89: dnl finishing a macro with ')dnl' .. otherwise, extra blank lines show up
                     90: dnl in the output.
                     91: dnl
                     92: _mkdev(loc,local,{-test -s $T.local && sh $T.local-})dnl
                     93: dnl
                     94: __devtitle(make,Device "make" file.  Valid arguments)dnl
1.4       todd       95: __devitem({-all-},{-all-},
                     96: {-makes all known devices{-,-} including local devices.
1.1       todd       97: {-#-}          Tries to make the ``standard'' number of each type.-})dnl
                     98: dnl
                     99: dnl 'all' is special.  The 'D'evice 'L'ist (or _dl) macro checks to see if
                    100: dnl a particular devices is in the MAKEDEV.md file, and if so, includes the
                    101: dnl necessary devices.  Otherwise the devices are not included in the 'all'
                    102: dnl target.  Note this keeps line lengths to less than column 70.  For the
                    103: dnl gory details see the definition of '_dl' in MAKEDEV.sub
                    104: dnl
1.18      todd      105: twrget(all,attyB,sd,5,6,7,8,9)dnl
                    106: target(all,sd,0,1,2,3,4)dnl
                    107: target(all,mcd,0)dnl
                    108: twrget(all,fdesc,fd)dnl
                    109: target(all,pty,0)dnl
                    110: target(all,st,0)dnl
                    111: target(all,ch,0)dnl
                    112: target(all,cd,0)dnl
                    113: target(all,mcd,0)dnl
                    114: target(all,std)dnl
                    115: target(all,vnd,0,1,2,3)dnl
                    116: target(all,ccd,0,1,2,3)dnl
                    117: target(all,wd,0,1,2,3)dnl
                    118: target(all,raid,0,1,2,3)dnl
                    119: target(all,xy,0,1,2,3)dnl
                    120: target(all,xd,0,1,2,3)dnl
                    121: target(all,rz,0,1,2,3,4)dnl
                    122: target(all,rd,0)dnl
                    123: target(all,hp,0,1,2,3)dnl
                    124: target(all,hk,0,1,2,3)dnl
                    125: target(all,up,0,1,2,3)dnl
                    126: target(all,ra,0,1,2,3)dnl
                    127: target(all,rb,0,1,2,3)dnl
                    128: target(all,rx,0,1)dnl
                    129: target(all,rl,0,1,2,3)dnl
                    130: target(all,hd,0,1,2,3,4)dnl
                    131: twrget(all,flo,fd,0,0B,0C,0D,0E,0F,0G,0H)dnl
                    132: twrget(all,flo,fd,1,1B,1C,1D,1E,1F,1G,1H)dnl
                    133: twrget(all,aflo,fd,0,1,2,3)dnl
                    134: target(all,bpf,0,1,2,3,4,5,6,7,8,9)dnl
                    135: target(all,tun,0,1,2,3)dnl
                    136: target(all,pctr)dnl
                    137: target(all,pctr0)dnl
                    138: target(all,altq)dnl
                    139: target(all,pf)dnl
                    140: twrget(all,cry,crypto)dnl
                    141: target(all,apm)dnl
1.19      todd      142: twrget(all,tth,ttyh,0,1)dnl
1.18      todd      143: target(all,ttyA,0,1)dnl
                    144: target(all,ttyB,0,1,2,3,4,5)dnl
                    145: twrget(all,attyB,ttyB,0,1,2,3,4)dnl
                    146: target(all,tty0,0,1,2,3)dnl
                    147: twrget(all,mac_tty0,tty0,0,1)dnl
                    148: twrget(all,tzs,tty,a,b,c,d)dnl
                    149: twrget(all,czs,cua,a,b,c,d)dnl
                    150: target(all,ttyc,0,1,2,3,4,5,6,7)dnl
                    151: twrget(all,com,tty0,0,1,2,3)dnl
                    152: twrget(all,mac_ttye,ttye,0)dnl
                    153: target(all,ttye,0,1,2,3,4,5,6)dnl
                    154: target(all,lkm)dnl
                    155: twrget(all,mmcl,mmclock)dnl
                    156: target(all,lpt,0,1,2)dnl
                    157: twrget(all,lpt,lpa,0,1,2)dnl
                    158: target(all,joy,0,1)dnl
                    159: target(all,rnd,random)dnl
                    160: target(all,ses,0)dnl
                    161: target(all,uk,0)dnl
                    162: target(all,ss,0)dnl
1.20      todd      163: target(all,st,0)dnl
1.18      todd      164: target(all,wt,0)dnl
                    165: target(all,wdt,0)dnl
                    166: target(all,xfs,0)dnl
                    167: twrget(all,au,audio,0)dnl
                    168: twrget(all,speak,speaker)dnl
                    169: target(all,asc,0)dnl
                    170: target(all,music,0)dnl
                    171: target(all,radio,0)dnl
                    172: target(all,tuner,0)dnl
                    173: target(all,rmidi,0,1,2,3,4,5,6,7)dnl
                    174: target(all,usbs)dnl
                    175: target(all,adb)dnl
                    176: target(all,iop,0,1)dnl
                    177: target(all,pci)dnl
                    178: twrget(all,wsmouse,wscons)dnl
                    179: twrget(all,btw,bwtwo,0)dnl
                    180: twrget(all,ctw,cgtwo,0)dnl
                    181: twrget(all,ctr,cgthree,0)dnl
                    182: twrget(all,cfr,cgfour,0)dnl
                    183: twrget(all,csx,cgsix,0)dnl
                    184: twrget(all,ceg,cgeight,0)dnl
                    185: twrget(all,cfo,cgfourteen,0)dnl
                    186: target(all,tcx,0)dnl
                    187: twrget(all,mac_grf,grf,0,1,2,3)dnl
                    188: target(all,grf,0,1,2,3,4,5,6)dnl
                    189: target(all,par,0)dnl
                    190: twrget(all,amouse,mouse,0,1)dnl
                    191: twrget(all,akbd,kbd)dnl
                    192: target(all,ppi,0)dnl
                    193: target(all,view0,0,1,2,3,4,5)dnl
                    194: target(all,local)dnl
                    195: dnl
1.1       todd      196: _mkdev(all,{-all-},{-dnl
1.18      todd      197: show_target(all)dnl
                    198: -})dnl
                    199: dnl
1.1       todd      200: __devitem(floppy,floppy,devices to be put on install floppies)dnl
                    201: __devitem(std,{-std-},standard devices)dnl
                    202: dnl
1.18      todd      203: dnl
                    204: dnl
1.1       todd      205: dnl _std
                    206: dnl
                    207: dnl $1: tty
                    208: dnl $2: memstuff
                    209: dnl $3: ksyms
                    210: dnl $4: drum
                    211: dnl $5: klog
                    212: dnl
                    213: define({-_std-},{-dnl
                    214: std)
                    215:        M console       c 0 0 600
                    216:        M tty           c $1 0
                    217:        M mem           c $2 0 640 kmem
                    218:        M kmem          c $2 1 640 kmem
                    219:        M null          c $2 2
                    220:        M zero          c $2 12
                    221:        M stdin         c major_fdesc_c 0
                    222:        M stdout        c major_fdesc_c 1
                    223:        M stderr        c major_fdesc_c 2
                    224:        M ksyms         c $3 0 640 kmem
                    225:        M drum          c $4 0 640 kmem
                    226:        M klog          c $5 0 600-})dnl
                    227: dnl
1.18      todd      228: target(usb,usb,0,1)dnl
                    229: target(usb,urio,0)dnl
                    230: target(usb,uscanner,0)dnl
                    231: target(usb,uhid,0,1,2,3)dnl
                    232: target(usb,ulpt,0,1)dnl
                    233: target(usb,ugen,0,1)dnl
                    234: target(usb,utty,0,1)dnl
                    235: dnl
1.1       todd      236: __devitem({-usbs-},usbs,make USB devices)dnl
                    237: _mkdev(usbs,usbs,{-dnl
1.18      todd      238: show_target({-usb-})dnl
                    239: -})dnl
1.1       todd      240: __devtitle(tap,Tapes)dnl
                    241: __devitem(wt,{-wt*     -},QIC-interface (e.g. not SCSI) 3M cartridge tape)dnl
                    242: _mkdev(wt,wt*,
                    243: {-name=wt
                    244:        n=Mult($U,8) m=Add($n,4)
                    245:        M $name$U       b major_wt_b $n 640 operator
                    246:        M r$name$U      c major_wt_c $n 640 operator
                    247:        M n$name$U      b major_wt_b $m 640 operator
                    248:        M nr$name$U     c major_wt_c $m 640 operator-})dnl
                    249: __devitem(tz,tz*,{-SCSI tapes{-,-} DEC TK50 cartridge tape-})dnl
                    250: __devitem(st,{-st*-},SCSI tapes)dnl
                    251: _mkdev(st,st*,{-n=Mult($U,16)
                    252:        for pre in " " n e en
                    253:        do
                    254:                M ${pre}st$U    b major_st_b $n 660 operator
                    255:                M ${pre}rst$U   c major_st_c $n 660 operator
                    256:                n=Add($n,1)
                    257:        done-})dnl
                    258: _mkdev(st_hp300,ct*|mt*|st*,
                    259: {-case $i in
                    260:        ct*) name=ct blk=major_ct_b chr=major_ct_c;;
                    261:        mt*) name=mt blk=major_mt_b chr=major_mt_c;;
                    262:        st*) name=st blk=major_st_hp300_b chr=major_st_hp300_c;;
                    263:        esac
                    264:        case $U in
                    265:        [0-7])
                    266:                four=Add($U,4) eight=Add($U,8)
                    267:                twelve=Add($U,12) twenty=Add($U,20)
                    268:                M r$name$U      c $chr $U 660 operator
                    269:                M r$name$four   c $chr $four 660 operator
                    270:                M r$name$eight  c $chr $eight 660 operator
                    271:                M r$name$twelve c $chr $twelve 660 operator
                    272:                MKlist="$MKlist;ln r$name$four nr$name$U";: sanity w/pdp11 v7
                    273:                MKlist="$MKlist;ln r$name$twelve nr$name$eight";: ditto
                    274:                RMlist="$RMlist nr$name$U nr$name$eight"
                    275:                ;;
                    276:        *)
                    277:                echo bad unit for tape in: $1
                    278:                ;;
                    279:        esac-})dnl
                    280: __devitem(st_hp300,st*,Exabyte tape)dnl
                    281: __devitem(ct,ct*,HP300 HP-IB cartridge tape)dnl
                    282: __devitem(mt,mt*,(Magnetic) 9-track reel tape)dnl
                    283: __devtitle(dis,Disks)dnl
                    284: __devitem(rz,rz*,SCSI disks)dnl
                    285: __devitem(sd,{-sd*-},SCSI disks{-,-} includes flopticals)dnl
                    286: __devitem(hd,{-hd*-},HP300 HP-IB disks)dnl
                    287: __devitem(cd,{-cd*-},SCSI cdrom drives)dnl
                    288: __devitem(acd,acd*,ATAPI cdrom drives)dnl
1.6       todd      289: _mkdev(cd,cd*,{-dodisk2 cd $U major_cd_b major_cd_c $U 0{--}ifstep(cd)-})dnl
                    290: __devitem(mcd,mcd*,Mitsumi cdrom drives)dnl
                    291: _mkdev(mcd,mcd*,{-dodisk2 mcd $U major_mcd_b major_mcd_c $U 0{--}ifstep(mcd)dnl
1.1       todd      292: -})dnl
                    293: __devitem(ch,{-ch*-},SCSI media changer)dnl
                    294: _mcdev(ch,ch*,ch,{-major_ch_c-},660,operator)dnl
                    295: __devitem(uk,uk*,SCSI Unknown device)dnl
                    296: _mcdev(uk,uk*,uk,{-major_uk_c-},640,operator)dnl
                    297: __devitem(ss,ss*,SCSI scanners)dnl
                    298: _mkdev(ss,ss*,{-M ss$U c major_ss_c $U 440 operator
                    299:        RMlist="$RMlist scan$U"
                    300:        MKlist="$MKlist;umask 77;ln -s ss$U scan$U"-})dnl
                    301: __devitem(ses,ses*,SES/SAF-TE SCSI devices)dnl
                    302: _mkdev(ses,ses*,{-M ses$U c major_ses_c $U 640 operator-})dnl
                    303: __devitem(ramd,ramdisk,makes all devices for a ramdisk kernel)dnl arc
1.20      todd      304: _mkdev(ramd,ramdisk,{-dnl
                    305: show_target(ramd)dnl
                    306: -})dnl
1.18      todd      307: ifelse(MACHINE,mvmeppc,{-dnl
                    308: target(ramd,tty0,0,1,2,3)dnl
                    309: twrget(ramd,wsdisp,ttyC,0)dnl
                    310: target(ramd,rd,0)dnl
                    311: target(ramd,wd,0,1,2,3)dnl
                    312: target(ramd,sd,0,1,2,3,4)dnl
1.21    ! todd      313: target(ramd,cd,0,1)dnl
        !           314: target(ramd,st,0,1)dnl
        !           315: target(ramd,bpf,0)dnl
        !           316: target(ramd,rd,0)dnl
        !           317: -})dnl
        !           318: ifelse(MACHINE,sparc,{-dnl
        !           319: target(ramd,fd,0)dnl
        !           320: target(ramd,sd,0,1,2,3)dnl
        !           321: target(ramd,rd,0)dnl
        !           322: target(ramd,cd,0)dnl
        !           323: -})dnl
        !           324: ifelse(MACHINE,sparc64,{-dnl
        !           325: target(ramd,fd,0)dnl
        !           326: target(ramd,rd,0)dnl
        !           327: target(ramd,sd,0,1,2,3)dnl
        !           328: target(ramd,wd,0,1,2,3)dnl
        !           329: target(ramd,cd,0,1)dnl
1.18      todd      330: target(ramd,st,0,1)dnl
1.21    ! todd      331: target(ramd,bpf,0)dnl
1.18      todd      332: -})dnl
                    333: ifelse(MACHINE,i386,{-dnl
                    334: target(ramd,tty0,0,1,2,3)dnl
                    335: twrget(ramd,wsdisp,ttyC,0)dnl
                    336: target(ramd,wt,0)dnl
                    337: target(ramd,fd,0)dnl
                    338: target(ramd,rd,0)dnl
                    339: target(ramd,wd,0,1,2,3)dnl
                    340: target(ramd,sd,0,1,2,3)dnl
1.21    ! todd      341: target(ramd,cd,0,1)dnl
1.18      todd      342: target(ramd,st,0,1)dnl
                    343: target(ramd,mcd,0)dnl
                    344: -})dnl
1.21    ! todd      345: ifelse(MACHINE,alpha,{-dnl
        !           346: target(ramd,sd,0,1,2)dnl
        !           347: target(ramd,wd,0)dnl
        !           348: target(ramd,tty0,0,1)dnl
        !           349: target(ramd,st,0)dnl
        !           350: target(ramd,cd,0)dnl
        !           351: target(ramd,ttyB,0,1)dnl
        !           352: target(ramd,ttyE,0,1)dnl
        !           353: -})dnl
        !           354: ifelse(MACHINE,amiga,{-dnl
        !           355: target(ramd,kbd)dnl
        !           356: target(ramd,pty,0)dnl
        !           357: target(ramd,tty0,0)dnl
        !           358: target(ramd,ttyA,0,1)dnl
        !           359: target(ramd,ttyB,0,1)dnl
        !           360: target(ramd,ttye,0,1,2,3,4,5,6)dnl
        !           361: target(ramd,cd,0,1)dnl
        !           362: target(ramd,sd,0,1,2,3)dnl
        !           363: target(ramd,st,0,1)dnl
        !           364: target(ramd,fd,0,1)dnl
        !           365: target(ramd,wd,0,1)dnl
        !           366: target(ramd,rd,0)dnl
        !           367: -})dnl
        !           368: ifelse(MACHINE,hp300,{-dnl
        !           369: target(ramd,ct,0,1)dnl
        !           370: target(ramd,hd,0,1,2,3,4)dnl
        !           371: target(ramd,sd,0,1,2,3,4)dnl
        !           372: target(ramd,rd,0,1)dnl
        !           373: target(ramd,pty,0)dnl
        !           374: target(ramd,hil)dnl
        !           375: target(ramd,grf,0)dnl
        !           376: target(ramd,apci,0)dnl
        !           377: target(ramd,ite,0)dnl
        !           378: target(ramd,dca,0)dnl
        !           379: target(ramd,dcm,0,1)dnl
        !           380: target(ramd,bpf,0,1)dnl
        !           381: target(ramd,tun,0,1)dnl
        !           382: -})dnl
        !           383: ifelse(MACHINE,hppa,{-dnl
        !           384: target(ramd,st,0,1)dnl
        !           385: target(ramd,sd,0,1,2,3)dnl
        !           386: target(ramd,rd,0,1)dnl
        !           387: target(ramd,pty,0)dnl
        !           388: target(ramd,hil)dnl
        !           389: target(ramd,com,0,1)dnl
        !           390: target(ramd,bpf,0,1)dnl
        !           391: target(ramd,tun,0,1)dnl
        !           392: -})dnl
        !           393: ifelse(MACHINE,mac68k,{-dnl
        !           394: target(ramd,sd,0,1,2,3)dnl
        !           395: target(ramd,st,0,1)dnl
        !           396: target(ramd,adb)dnl
        !           397: target(ramd,asc,0)dnl
        !           398: target(ramd,grf,0,1)dnl
        !           399: target(ramd,ttye,0)dnl
        !           400: twrget(ramd,mac_tty0,tty0,0,1)dnl
        !           401: target(ramd,pty,0)dnl
        !           402: -})dnl
        !           403: ifelse(MACHINE,macppc,{-
        !           404: target(ramd,sd,0,1,2,3,4)dnl
        !           405: target(ramd,st,0,1)dnl
        !           406: target(ramd,cd,0,1)dnl)dnl
        !           407: target(ramd,rd,0)dnl
        !           408: target(ramd,ttyE,0)dnl
        !           409: target(ramd,tty0,0,1)dnl
        !           410: target(ramd,pty,0)dnl
        !           411: -})dnl
        !           412: ifelse(MACHINE,vax,{-
        !           413: target(ramd,fd,0)dnl
        !           414: target(ramd,sd,0,1,2,3)dnl
        !           415: target(ramd,rd,0)dnl
        !           416: target(ramd,cd,0)dnl
        !           417: target(ramd,bpf,0)dnl
        !           418: -})dnl
        !           419: target(ramd,std)dnl
1.20      todd      420: target(ramd,random)dnl
                    421: target(ramd,bpf,0)dnl
1.1       todd      422: __devitem(rd,{-rd*-},"ramdisk" pseudo-disks)dnl
1.6       todd      423: _mkdev(rd,rd*,{-dodisk2 rd $U major_rd_b major_rd_c $U 0{--}ifstep(rd)-})dnl
1.1       todd      424: __devitem(xd,xd*,Xylogic 753/7053 disks)dnl
                    425: __devitem(xy,xy*,{-    Xylogic 450/451 disks-})dnl
                    426: __devitem(flo,{-fd*-},{-Floppy disk drives (3 1/2"{-,-} 5 1/4")-})dnl
                    427: _mkdev(flo,fd*,
                    428: {-typnam=$U${i#fd[01]*}
                    429:        case $typnam in
                    430:        0|1)    typnum=0;; # no type specified, assume A
                    431:        *A)             typnam=0; typnum=0;;
                    432:        *B)             typnum=1;;
                    433:        *C)             typnum=2;;
                    434:        *D)             typnum=3;;
                    435:        *E)             typnum=4;;
                    436:        *F)             typnum=5;;
                    437:        *G)             typnum=6;;
                    438:        *H)             typnum=7;;
                    439:        *)              echo bad type $typnam for $i; exit 1;;
                    440:        esac
                    441:        case $U in
                    442:        0|1)    blk=major_flo_b; chr=major_flo_c;;
                    443:        *)      echo bad unit $U for $i; exit 1;;
                    444:        esac
                    445:        nam=fd${typnam}
                    446:        n=Add(Mult($U,128),Mult($typnum,16))
                    447:        M ${nam}a       b $blk $n 640 operator
                    448:        M ${nam}b       b $blk Add($n,1) 640 operator
                    449:        M ${nam}c       b $blk Add($n,2) 640 operator
                    450:        M r${nam}a      c $chr $n 640 operator
                    451:        M r${nam}b      c $chr Add($n,1) 640 operator
                    452:        M r${nam}c      c $chr Add($n,2) 640 operator-},664)dnl
                    453: __devitem(aflo,floppy,devices needed for install floppies)dnl
                    454: _mkdev(aflo,fd*,{-case $U in 0|1|2|3)
                    455:        M fd${U}a b major_aflo_b Mult($U,16) 640 operator
                    456:        M fd${U}b b major_aflo_b Add(Mult($U,16),1) 640 operator
                    457:        M rfd${U}a c major_aflo_c Mult($U,16) 640 operator
                    458:        M rfd${U}b c major_aflo_c Add(Mult($U,16),1) 640 operator;;
                    459:        *) echo bad unit for floppy disk in: $i;;
                    460:        esac-})dnl
                    461: __devitem(iop,iop*,I2O controller device)dnl
                    462: _mcdev(iop,iop*,iop,{-major_iop_c-},660)dnl
                    463: __devitem(wdt,wdt0,watchdog timer)dnl
                    464: _mcdev(wdt,wdt0,wdt,{-major_wdt_c-},440,operator)dnl
                    465: __devitem(local,local,configuration specific devices)dnl
                    466: __devitem(wd,{-wd*-},{-"winchester" disk drives (ST506,IDE,ESDI,RLL,...)-})dnl
                    467: __devitem(ccd,ccd*,concatenated disk devices)dnl
                    468: __devitem(raid,raid*,RAIDframe disk devices)dnl
                    469: __devitem(vnd,vnd*,"file" pseudo-disks)dnl
1.6       todd      470: _mkdev(vnd,vnd*,{-dodisk vnd $U major_vnd_b major_vnd_c $U 0{--}ifstep(vnd)
                    471:        dodisk svnd $U major_vnd_b major_vnd_c $U 128{--}ifstep(vnd)-})dnl
1.18      todd      472: __devitem(ra,ra*,{-MSCP disks (ra??, hd??)-})dnl
                    473: __devitem(hp,hp*,{-massbuss rm??-})dnl
                    474: __devitem(hk,hk*,{-unibus rk06 and rk07-})dnl
                    475: __devitem(up,up*,{-other unibus devices (e.g. on Emulex sc-21v controller)-})dnl
                    476: __devitem(rb,rb*,{-730 idc w/ rb80 and/or rb02-})dnl
                    477: __devitem(rx,rx*,{-MSCP floppy disk (rx33/50/...)-})dnl
                    478: __devitem(rl,rl*,{-unibus r102-})dnl
                    479: __devitem(hd,hd*,{-HDC9224 hd disks on VS2000-})dnl
1.1       todd      480: dnl
                    481: dnl For normal disk devices, add a disk_q entry; anything else define like
                    482: dnl the rest (such as vnd above).
                    483: dnl
1.18      todd      484: disk_q({-ccd-})dnl
                    485: disk_q({-hd-})dnl
                    486: disk_q({-hk-})dnl
                    487: disk_q({-hp-})dnl
                    488: disk_q({-ra-})dnl
                    489: disk_q({-raid-})dnl
                    490: disk_q({-rb-})dnl
                    491: disk_q({-rl-})dnl
                    492: disk_q({-rx-})dnl
                    493: disk_q({-sd-})dnl
1.1       todd      494: disk_q({-xy-})dnl
                    495: disk_q({-xd-})dnl
1.18      todd      496: disk_q({-up-})dnl
                    497: disk_q({-wd-})dnl
1.1       todd      498: disk_q({-rz-})dnl
                    499: dnl
                    500: __devitem(loc,local,configuration specific devices)dnl
                    501: _mkdev(loc,local,{-test -s $T.local && sh $T.local-})dnl
                    502: _mkdev({-disks-},{-undefine({-C_ase-})show_disks()undefine({-C_ase-})-},
                    503: {-case $i in
                    504: show_disks2()dnl
1.6       todd      505:        esac-})dnl
1.1       todd      506: __mkdev({-disks-}){--}dnl
                    507: dnl
                    508: __devtitle(cons,Console ports)dnl
                    509: __devitem(ttyv0,ttyv0,pccons or pcvt screen 0)dnl
                    510: __devitem(ttyv,ttyv*,pcvt)dnl
                    511: __devitem(ttye,ttye*,ite bitmapped consoles)dnl
1.13      todd      512: __devitem(mac_ttye,ttye*,ite bitmapped consoles)dnl
1.1       todd      513: __devitem(wscons,ttyC0,wscons screen 0)dnl
                    514: _mkdev({-wscons-},{-wscons-},{-dnl
                    515: _dl(dnl
                    516: {-wscons-},{-ttyCcfg-},
1.3       todd      517: {-wsdisp-},{-ttyC0 ttyC1 ttyC2 ttyC3 ttyC4 ttyC5 ttyC6 ttyC7 ttyC8 ttyC9-},
                    518: {-wsdisp-},{-ttyCa ttyCb-},
1.1       todd      519: {-wsmux-},{-wsmux-},
                    520: {-wskbd-},{-wskbd0 wskbd1 wskbd2 wskbd3-},
                    521: {-wsmouse-},{-wsmouse0 wsmouse1 wsmouse2 wsmouse3-})-})dnl
1.3       todd      522: __devitem(wsdisp,ttyC*,wscons virtual consoles)dnl
                    523: _mkdev({-wsdisp-},ttyC*,{-U=${i##ttyC}
                    524:        case $U in
1.8       todd      525:        [0-9a-f]) M ttyC$U c major_wsdisp_c {-$(( 16#$U ))-} 600;;
                    526:        cfg) M ttyCcfg c major_wsdisp_c 255 600;;
1.3       todd      527:        *) echo bad unit $U for $i; exit 1;;
1.6       todd      528:        esac-})dnl
1.1       todd      529: __devitem(wskbd,wskbd*,wscons keyboards)dnl
                    530: _mkdev(wskbd,wskbd*,{-M wskbd$U c major_wskbd_c $U 600-})dnl
                    531: __devitem(wsmux,wsmux,wscons keyboard/mouse mux devices)dnl
                    532: _mkdev(wsmux,wsmux|wsmouse|wskbd,{-M wsmouse c major_wsmux_c 0 600
                    533:        M wskbd c major_wsmux_c 1 600-})dnl
                    534: __devitem(pcons,console,PROM console)dnl
                    535: __devtitle(point,Pointing devices)dnl
                    536: __devitem(wsmouse,wsmouse*,wscons mice)dnl
                    537: _mkdev(wsmouse,wsmouse*,{-M wsmouse$U c major_wsmouse_c $U 600-})dnl
                    538: __devitem(quad,quadmouse,"quadrature mouse")dnl
                    539: __devtitle(pty,Pseudo terminals)dnl
                    540: __devitem(tty,tty*,set of 16 slave psuedo terminals)dnl
                    541: __devitem(pty,pty*,set of 16 master pseudo terminals)dnl
                    542: _mkdev(pty,pty*,{-case $U in
                    543:        0) off=0 name=p;;
                    544:        1) off=16 name=q;;
                    545:        2) off=32 name=r;;
                    546:        3) off=48 name=s;;
                    547: # Note that telnetd, rlogind, and xterm (at least) only look at p-s.
                    548:        4) off=64 name=t;;
                    549:        5) off=80 name=u;;
                    550:        6) off=96 name=v;;
                    551:        7) off=112 name=w;;
                    552:        8) off=128 name=x;;
                    553:        9) off=144 name=y;;
                    554:        10) off=160 name=z;;
                    555:        11) off=176 name=P;;
                    556:        12) off=192 name=Q;;
                    557:        13) off=206 name=R;;
                    558:        14) off=224 name=S;;
                    559:        15) off=240 name=T;;
                    560:        *) echo bad unit for pty in: $i; continue;;
                    561:        esac
                    562:        n=0
                    563:        while [ $n -lt 16 ]
                    564:        do
                    565:                nam=$name$(hex $n)
                    566:                M tty$nam c major_tty_c Add($off,$n)
                    567:                M pty$nam c major_pty_c Add($off,$n)
                    568:                n=Add($n,1)
                    569:        done-})dnl
                    570: __devitem(dc,dc*,{-4 channel serial interface (keyboard{-,-} mouse{-,-}modem{-,-} printer)-})dnl
                    571: __devtitle(prn,Printers)dnl
                    572: __devitem(par,par*,motherboard parallel port)dnl
                    573: __devitem(lpt,lpt*,IEEE 1284 centronics printer)dnl
                    574: _mkdev(lpt,lpt*|lpa*,
                    575: {-case $i in
                    576:        lpt*) n=lpt f=0;;
                    577:        lpa*) n=lpa f=128;;
                    578:        esac
                    579:        M $n$U c major_lpt_c Add($U,$f) 600-})dnl
                    580: __devitem(lpa,lpa*,interruptless lp)dnl
                    581: __devitem(ppi,ppi*,HP-IB plotters)dnl
                    582: __devtitle({-usb-},USB devices)dnl
                    583: __devitem({-usb-},usb*,Bus control devices used by usbd for attach/detach)dnl
                    584: _mkdev({-usb-},usb*,{-[ "$i" = "usb" ] && u= || u=$U
                    585:        M usb$u c major_usb_c $U 660-})dnl
                    586: __devitem(uhid,uhid*,Generic HID devices)dnl
                    587: _mcdev({-uhid-},uhid*,{-uhid-},{-major_uhid_c-},660)dnl
                    588: __devitem(ulpt,ulpt*,Printer devices)dnl
                    589: _mcdev({-ulpt-},ulpt*,{-ulpt-},{-major_ulpt_c-},660)dnl
                    590: __devitem(utty,utty*,Serial ports)dnl
                    591: _mcdev({-utty-},utty*,{-utty-},{-major_utty_c-},660)dnl
                    592: __devitem(urio,urio*,Diamond Multimedia Rio 500)dnl
                    593: _mcdev({-urio-},urio*,{-urio-},{-major_urio_c-},660)dnl
1.2       todd      594: __devitem(uscan,uscanner*,Scanners)dnl
                    595: _mcdev({-uscan-},uscanner*,{-uscanner-},{-major_uscan_c-},660)dnl
1.1       todd      596: __devitem(ugen,ugen*,Generic device)dnl
                    597: _mkdev(ugen,ugen*,{-n=Mult($U,16)
                    598:        for j in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
                    599:        do
                    600:                M ugen$U.$j c major_ugen_c Add($n,$j) 660
                    601:        done-})dnl
                    602: __devtitle(cpu,Cpus)dnl
                    603: __devitem(cpu,cpu*,cpus)dnl
                    604: __devtitle(call,Call units)dnl
                    605: __devtitle(term,Terminal ports)dnl
                    606: __devtitle(termp,Terminal multiplexers)dnl
                    607: __devitem(dca,dca*,HP200/300 single port serial interface)dnl
                    608: __devitem(dcm,dcm*,HP200/300 4 port serial mux interface)dnl
                    609: __devitem(apci,apci*,HP400 4 port serial mux interface)dnl
                    610: __devitem({-com-},{-tty0*-},NS16x50 serial ports)dnl
                    611: _mkdev(com,{-tty0*-},{-M tty$U c major_com_c $U 660 dialer uucp
                    612:        M cua$U c major_com_c Add($U,128) 660 dialer uucp-})dnl
                    613: __devitem(ttyc,ttyc*,Cyclades serial ports)dnl
                    614: __devitem(tzs,tty[a-z]*,Zilog 8530 Serial Port)dnl
                    615: _mkdev(tzs,{-tty[a-z]-},{-u=${i#tty*}
                    616:        case $u in
                    617:        a) n=0 ;;
                    618:        b) n=1 ;;
                    619:        c) n=4 ;;
                    620:        d) n=5 ;;
                    621:        *) echo unknown tty device $i ;;
                    622:        esac
                    623:        M tty$u c major_tzs_c $n 660 dialer uucp-})dnl
                    624: __devitem(tth,ttyh*,Sab82532 serial devices)dnl
                    625: _mkdev(tth,ttyh*,{-M ttyh$U c major_tth_c $U 660 dialer uucp-})dnl
                    626: __devitem(czs,cua[a-z]*,Zilog 8530 Serial Port)dnl
                    627: _mkdev(czs,cua[a-z],{-u=${i#cua*}
                    628:        case $u in
                    629:        a) n=0 ;;
                    630:        b) n=1 ;;
                    631:        c) n=4 ;;
                    632:        d) n=5 ;;
                    633:        *) echo unknown cua device $i ;;
                    634:        esac
                    635:        M cua$u c major_czs_c Add($n,128) 660 dialer uucp-})dnl
                    636: __devitem(arm_tty,tty*,{-alias for PC COM ports{-,-} this is what the system really wants-})dnl
                    637: __devitem(tty0,tty00,standard serial port)dnl
1.13      todd      638: __devitem(mac_tty0,tty00,standard serial port)dnl
1.1       todd      639: __devitem(ttyA,ttyA*,mfc serial ports)dnl
                    640: __devitem(attyB,ttyB*,ISA COM ports)dnl  amiga
                    641: __devitem(ttyz,tty[a-d],onboard zs serial ports)dnl
                    642: __devitem(cuaz,cua[a-d],onboard zs serial ports)dnl
                    643: __devitem(ttyB,ttyB?,DEC 3000 ZS8530 ("scc") serial ports)dnl
                    644: __devitem(scc,scc*,82530 serial interface)dnl
                    645: __devitem(arc_ttyC,ttyC0,pccons)dnl
                    646: __devitem(i386_ttyC,ttyC*,pcvt)dnl
                    647: __devitem(ttyC,ttyC?,{-AlphaStation NS16550 ("com serial ports")-})dnl
                    648: __devitem(ttyE,ttyE?,Workstation console (framebuffer & keyboard) tty emulators)dnl
                    649: __devitem(ser02,ser02,{-serial2 port (channel A on 8530)-})dnl
                    650: __devitem(mdm02,mdm02,{-modem2 port (channel B on 8530)-})dnl
                    651: __devtitle(spec,Special purpose devices)dnl
                    652: __devitem(apm,apm      ,power management device)dnl
                    653: _mkdev(apm,apm*,{-M apm        c major_apm_c 0 644
                    654:        M apmctl        c major_apm_c 8 644-})dnl
                    655: __devitem(pcmcia,pcmcia*,PCMCIA card drivers)dnl
                    656: __devitem(pctr,pctr*,PC Performance Tuning Register access device)dnl
                    657: _mkdev(pctr,pctr,{-M pctr c major_pctr_c 0 644-})dnl
                    658: __devitem(au,audio*,audio device)dnl
                    659: _mkdev(au,audio*,{-M sound$U   c major_au_c $U
                    660:        M mixer$U       c major_au_c Add($U,16)
                    661:        M audio$U       c major_au_c Add($U,128)
                    662:        M audioctl$U    c major_au_c Add($U,192)
                    663:        MKlist="$MKlist;[ -e audio ] || ln -s audio$U audio"
                    664:        MKlist="$MKlist;[ -e mixer ] || ln -s mixer$U mixer"
                    665:        MKlist="$MKlist;[ -e sound ] || ln -s sound$U sound"
                    666:        MKlist="$MKlist;[ -e audioctl ] || ln -s audioctl$U audioctl"-})dnl
1.13      todd      667: __devitem(asc,asc*,ASC Audio device)dnl
                    668: _mkdev(asc,asc*,{-M asc$U major_asc_c 0-})dnl
1.1       todd      669: __devitem(music,music*,midi devices)dnl
                    670: _mkdev(music,music*,{-M music$U     c major_music_c $U
                    671:        M sequencer$U c major_music_c Add($U,128)
                    672:        MKlist="$MKlist;[ -e music ] || ln -s music$U music"
                    673:        MKlist="$MKlist;[ -e sequencer ] || ln -s sequencer$U sequencer"-})dnl
1.8       todd      674: __devitem(radio,radio*,FM tuner device)dnl
                    675: _mkdev(radio,radio*,{-M radio$U     c major_radio_c $U 644
                    676:        MKlist="$MKlist;[ -e radio ] || ln -s radio$U radio"-})dnl
1.1       todd      677: __devitem(fdesc,fd,makes fd/* for the fdescfs)dnl
                    678: _mkdev(fdesc,fd,{-RMlist="mkdir -p fd;$RMlist" n=0
                    679:        while [ $n -lt 64 ];do M fd/$n c major_fdesc_c $n;n=Add($n,1);done
                    680:        MKlist="$MKlist;chmod 555 fd"-})dnl
                    681: __devtitle(graph,Graphics devices)dnl
1.13      todd      682: __devitem(mac_grf,grf*,{-custom chip (grf0){-,-} Retina Z2/Z3 (grf1/grf2){-,-}
1.1       todd      683: {-#-}          Cirrus boards (grf3){-,-} A2410 (grf4) video or
                    684: {-#-}          CyberVision 64 (grf5)-})dnl
                    685: __devitem(grf_amiga,grf*,{-Motherboard bitmapped video.-})dnl
                    686: __devitem(grf_hp300,grf*,raw interface to HP300 graphics devices)dnl
                    687: __devitem(ite,ite*,terminal emulator interface to HP300 graphics devices)dnl
                    688: __devitem({-hil-},{-hil-},HP300 HIL input devices)dnl
                    689: __devitem(oppr,openprom)dnl
                    690: _cdev(oppr,openprom,70,0)dnl
                    691: __devitem(btw,bwtwo*)dnl
                    692: _mcdev(btw,bwtwo*,bwtwo,{-major_btw_c-},666)dnl
                    693: __devitem(ctw,cgtwo*)dnl
                    694: _mcdev(ctw,cgtwo*,cgtwo,{-major_ctw_c-},666)dnl
                    695: __devitem(ctr,cgthree*)dnl
                    696: _mcdev(ctr,cgthree*,cgthree,{-major_ctr_c-},666)dnl
                    697: __devitem(cfr,cgfour*)dnl
                    698: _mcdev(cfr,cgfour*,cgfour,{-major_cfr_c-},666)dnl
                    699: __devitem(csx,cgsix*)dnl
                    700: _mcdev(csx,cgsix*,cgsix,{-major_csx_c-},666)dnl
                    701: __devitem(ceg,cgeight*)dnl
                    702: _mcdev(ceg,cgeight*,cgeight,{-major_ceg_c-},666)dnl
                    703: __devitem(cfo,cgfourteen*)dnl
                    704: _mcdev(cfo,cgfourteen*,cgfourteen,{-major_cfo_c-})dnl
                    705: __devitem(tcx,tcx*)dnl
                    706: _mcdev(tcx,tcx*,tcx,{-major_tcx_c-})dnl
                    707: __devitem(cry,crypto,hardware crypto access driver)dnl
                    708: _mkdev(cry,crypto,{-M crypto c major_cry_c-} 0)dnl
                    709: __devitem(pf,pf*,Packet Filter)dnl
                    710: _mkdev(pf,{-pf*-},{-M pf c major_pf_c 0 600-})dnl
                    711: __devitem(bpf,bpf*,Berkeley Packet Filter)dnl
                    712: _mkdev(bpf,{-bpf*-},{-M bpf$U c major_bpf_c $U 600-},600)dnl
                    713: _mkdev(tun,{-tun*-},{-M tun$U c major_tun_c $U 600-},600)dnl
                    714: __devitem(altq,altq/,ALTQ control interface)dnl
                    715: _mkdev(altq,altq,{-RMlist="mkdir -p altq;$RMlist"
                    716:        for d in altq cbq wfq afm fifoq red rio localq hfsc cdnr blue priq; do
                    717:                M altq/$d c major_altq_c $U 644
                    718:                U=Add($U,1)
                    719:        done-})dnl
                    720: __devitem(speak,speaker,pc speaker)dnl
1.15      todd      721: _mkdev(speak,speaker,{-M speaker c major_speak_c 0 600-})dnl
1.1       todd      722: __devitem(kbd,kbd,keyboard (provides events, for X11))dnl
                    723: _cdev(kbd,kbd,{-major_kbd_c-},0,600)dnl
                    724: __devitem(kbd_atari,kbd,Atari keyboard)dnl
                    725: __devitem(akbd,kbd,Amiga keyboard)dnl
                    726: __devitem(rkbd,kbd,raw keyboard)dnl
                    727: __devitem(kbdctl,kbdctl,keyboard control)dnl
                    728: __devitem(beep,beep,riscpc speaker)dnl
                    729: __devitem(iic,iic*,IIC bus device)dnl
                    730: __devitem(rtc,rtc*,RTC device)dnl
                    731: __devitem(view,view*,generic interface to graphic displays)dnl
                    732: __devitem(aconf,aconf,{-autoconfig information (not yet)-})dnl
                    733: __devitem(mouse-,mouse-*,"mouse link")dnl
                    734: __devitem(mouse,mouse,mouse (provides events, for X11))dnl
                    735: __devitem(amouse,mouse*,Amiga mice)dnl
                    736: __devitem(lkm,lkm,loadable kernel modules interface)dnl
                    737: _cdev(lkm,lkm,{-major_lkm_c-},0,640,kmem)dnl
                    738: __devitem(mmcl,mmclock,memory mapped clock)dnl
                    739: __devitem(tun,tun*,network tunnel driver)dnl
                    740: __devitem(rnd,*random,inkernel random data source)dnl
                    741: _mkdev(rnd,*random,{-n=0
                    742:        for pre in " " s u p a
                    743:        do
                    744:                M ${pre}random c major_rnd_c $n 644
                    745:                n=Add($n,1)
                    746:        done-},644)dnl
                    747: __devitem(joy,joy*,joystick driver)dnl
1.8       todd      748: _mcdev(joy,joy*,joy,{-major_joy_c-},666)dnl
1.1       todd      749: __devitem(mag,magma*,magma card (makes 16 tty and 2 bpp))dnl
1.18      todd      750: __devitem(bppmag,bppmag[mno],magma parallel port device)dnl
1.17      jason     751: __devitem(spif,spif*,spif card (makes 8 tty and 1 bpp))dnl
1.18      todd      752: __devitem(bppsp,bpp[jkl],spif parallel port device)dnl
                    753: _mkdev(mag,magma*,{-case $U in
                    754:        0)      offset=0  nam=m;;
                    755:        1)      offset=16 nam=n;;
                    756:        2)      offset=32 nam=o;;
                    757:        *)      echo "bad unit for $i: $U"; exit 127;;
                    758:        esac
                    759:        offset=Mult($U,64)
                    760:        n=0
                    761:        while [ $n -lt 16 ]
                    762:        do
                    763:                name=${nam}`hex $n`
                    764:                M tty$name c major_mag_c Add($offset,$n) 660 dialer uucp
                    765:                n=Add($n,1)
                    766:        done
                    767:        M bpp${nam}0 c major_bppmag_c Add($offset,0) 600
                    768:        M bpp${nam}1 c major_bppmag_c Add($offset,1) 600-})dnl
                    769: _mkdev(spif,spif*,{-case $U in
                    770:        0)      offset=0  nam=j;;
                    771:        1)      offset=16 nam=k;;
                    772:        2)      offset=32 nam=l;;
                    773:        *)      echo "bad unit for $i: $U"; exit 127;;
                    774:        esac
                    775:        offset=Mult($U,64)
                    776:        n=0
                    777:        while [ $n -lt 8 ]
                    778:        do
                    779:                name=${nam}`hex $n`
                    780:                M tty$name c major_spif_c Add($offset,$n) 660 dialer uucp
                    781:                n=Add($n,1)
                    782:        done
                    783:        M bpp${nam}0 c major_bppsp_c Add($offset,0) 600-})dnl
                    784: __devitem(bpp,bpp*,parallel port devices)dnl
1.1       todd      785: __devitem(xfs,xfs*,XFS filesystem devices)dnl
                    786: _mcdev(xfs,xfs*,xfs,{-major_xfs_c-},600)dnl
                    787: __devitem(hil,hil,HIL input devices)dnl
                    788: __devitem(rmidi,rmidi*,raw midi devices)dnl
                    789: _mcdev(rmidi,rmidi*,rmidi,{-major_rmidi_c-},666)dnl
                    790: __devtitle(plat,Platform-specific devices)dnl
                    791: __devitem(fb,fb*,framebuffer device)dnl
                    792: __devitem(bktr,bktr*,video capturing)dnl
                    793: _mcdev(bktr,bktr*,bktr,{-major_bktr_c-},644)dnl
                    794: __devitem(tuner,tuner*,tuner device)dnl
                    795: _mkdev(tuner,tuner*,{-M tuner$U c major_tuner_c Add(Mult($U,2),16) 644-},644)dnl
1.7       todd      796: __devitem(pci,pci,PCI bus device)dnl
                    797: _mkdev(pci,pci,{-M pci c major_pci_c 0 664-},664)dnl
1.13      todd      798: __devitem(adb,adb,Apple Desktop bus event interface)dnl
                    799: _mkdev(adb,adb,{-M adb c major_adb_c 0-})dnl
1.15      todd      800: __devitem(pdc,pdc,PDC device)dnl
1.1       todd      801: _mkdev(local,local,{-test -s $T.local && sh $T.local-},666)dnl
                    802: dnl
                    803: divert(1)dnl
                    804: include(etc.MACHINE/MAKEDEV.md)dnl
                    805: dnl
                    806: dnl
                    807: divert(0)dnl
                    808: #!/bin/sh -
                    809: #
                    810: # THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
                    811: # generated from:
                    812: #
                    813: show_vers()dnl <-- now that all files are included, show versions
                    814: #
1.6       todd      815: {-#-}  $Open{--}BSD$
1.1       todd      816: dnl
                    817: divert(2)dnl
                    818: PATH=/sbin:/usr/sbin:/bin:/usr/bin
                    819: T=$0
                    820:
                    821: # set this to echo for Echo-Only debugging
                    822: [ "$eo" ] || eo=
                    823:
                    824: hex()
                    825: {
                    826:        case ${--}1 in
                    827:                [0-9]) echo -n {-$-}1;;
                    828:                10) echo -n a;;
                    829:                11) echo -n b;;
                    830:                12) echo -n c;;
                    831:                13) echo -n d;;
                    832:                14) echo -n e;;
                    833:                15) echo -n f;;
                    834:        esac
                    835: }
                    836: trunc()
                    837: {
                    838:        # XXX pdksh can't seem to deal with locally scoped variables
                    839:        # in ${foo#$bar} expansions
                    840:        arg1="{-$-}1"
                    841:        arg2="{-$-}2"
                    842:        case {-$-}3 in
                    843:        l)   echo ${arg2#$arg1} ;;
                    844:        r|*) echo ${arg1#$arg2} ;;
                    845:        esac
                    846: }
                    847: unt()
                    848: {
                    849:        # XXX pdksh can't seem to deal with locally scoped variables
                    850:        # in ${foo#$bar} expansions
                    851:        arg="{-$-}1"
                    852:        tmp="${arg#[a-zA-Z]*}"
                    853:        tmp="${tmp%*[a-zA-Z]}"
                    854:        while [ "$tmp" != "$arg" ]
                    855:        do
                    856:                arg=$tmp
                    857:                tmp="${arg#[a-zA-Z]*}"
                    858:                tmp="${tmp%*[a-zA-Z]}"
                    859:        done
                    860:        echo $arg
                    861: }
                    862: dnl
1.5       todd      863: dnl dodisk(name,unit,blkmaj,chrmaj,unit,off[,stepping])
                    864: dnl   arg: 1    2    3      4      5    6    7
1.1       todd      865: dnl
                    866: dodisk()
                    867: {
1.5       todd      868:        n=Add(Mult(${5},${7:-16}),${6}) count=0
1.1       todd      869:        RMlist="$RMlist {-$-}1{-$-}2? r{-$-}1{-$-}2?"
1.13      todd      870:        [ 0$7 -ne 8 ] && l="i j k l m n o p"
                    871:        for d in a b c d e f g h $l
1.1       todd      872:        do
                    873:                M {-$-}1{-$-}2$d        b {-$-}3 Add($n,$count) 640
                    874:                M r{-$-}1{-$-}2$d       c {-$-}4 Add($n,$count) 640
                    875:                let count=count+1
                    876:        done
                    877:        MKlist="$MKlist;chown root.operator {-$-}1{-$-}2? r{-$-}1{-$-}2?"
                    878: }
                    879: dnl
1.5       todd      880: dnl dodisk2(name,unit,blkmaj,chrmaj,unit,off[,stepping])
1.1       todd      881: dnl
                    882: dnl 1. name    - prefix name of the device
                    883: dnl 2. unit    - beginning unit number for block devices
                    884: dnl 3. blkmaj  - block device major number
                    885: dnl 4. chrmaj  - character device major number
                    886: dnl 5. unit    - beginning unit number for character devices
                    887: dnl 6. off     - offset from 0 for all minor numbers (see svnd for an example)
1.5       todd      888: dnl 7. step    - optional, defaults to 16, number of partitions per device
1.1       todd      889: dnl
                    890: dodisk2()
                    891: {
1.5       todd      892:        n=Add(Mult({-$-}5,${7:-16}),{-$-}6)
1.1       todd      893:        M {-$-}1{-$-}2a b {-$-}3 $n 640 operator
                    894:        M r{-$-}1{-$-}2a c {-$-}4 $n 640 operator
                    895:        n=Add($n,2)
                    896:        M {-$-}1{-$-}2c b {-$-}3 $n 640 operator
                    897:        M r{-$-}1{-$-}2c c {-$-}4 $n 640 operator
                    898: }
                    899:
                    900: # M name b/c major minor [mode] [group]
                    901: RMlist="rm -f"
                    902: MKlist=":"
                    903: mkl() {
                    904: dnl
                    905: dnl uncomment if multi mknod happens
                    906: dnl
                    907: ifelse(1,0,
                    908: [ "${mklist[{-$-}1]}" ] && mklist[{-$-}1]="${mklist[{-$-}1]} {-$-}2 {-$-}3 {-$-}4 {-$-}5" || {
                    909:           mklist[{-$-}1]="mknod -m {-$-}1 {-$-}2 {-$-}3 {-$-}4 {-$-}5"
                    910:           modes="$modes {-$-}1"
                    911:      },
                    912: dnl
                    913: dnl non multi mknod
                    914: dnl
                    915:  [ "${mklist[{-$-}1]}" ] && {
                    916:   mklist[{-$-}1]="${mklist[{-$-}1]};mknod -m {-$-}1 {-$-}2 {-$-}3 {-$-}4 {-$-}5"
                    917:  } || {
                    918:   mklist[{-$-}1]="mknod -m {-$-}1 {-$-}2 {-$-}3 {-$-}4 {-$-}5"
                    919:   modes="$modes {-$-}1"
                    920:  })
                    921: }
                    922: M() {
                    923:        RMlist="$RMlist {-$-}1"
                    924:        mkl ${5-666} {-$-}1 {-$-}2 {-$-}3 {-$-}4
                    925:        mklist="$mklist {-$-}1"
                    926:        G={-$-}{6:-wheel}
                    927:        [ "{-$-}7" ] && {
                    928:                MKlist="$MKlist;chown {-$-}7.{-$-}G {-$-}1"
                    929:        } || {
                    930:                case $G in
                    931:                wheel)g=0;;kmem)g=2;;operator)g=5;;tty)g=4;;dialer)g=117;;
                    932:                esac
                    933:                [ "${grplist[$g]}" ] && {
                    934:                        grplist[$g]="${grplist[$g]} {-$-}1"
                    935:                } || {
                    936:                        groups="$groups $g"
                    937:                        grplist[$g]="chgrp $G {-$-}1"
                    938:                }
                    939:        }
                    940:        return 0
                    941: }
                    942: divert(7)dnl
                    943: dnl
                    944: dnl there is no blank line at the end of etc.arch/MAKEDEV.md files, so add one
                    945: dnl on the following line:
                    946:
                    947: show_devs()dnl
                    948: dnl
                    949: divert(9)dnl
                    950: *)
                    951:        echo $i: unknown device
                    952:        ;;
                    953: esac
                    954: done
                    955: }
                    956: _recurse "$@"
                    957: if [ "$os" = "SunOS" ]; then
                    958:        eo=transform
                    959:        transform() {
                    960:                case $mode in
                    961:                600) mask=077;;
                    962:                640) mask=027;;
                    963:                660) mask=007;;
                    964:                644) mask=022;;
                    965:                666) mask=0;;
                    966:                440) mask=227;;
                    967:                esac
                    968:                echo `echo "$@"|sed \
                    969:                        's/mknod -m \([0-9]*\) /umask '$mask';mknod /;s/-m [0-9]* //g;\
                    970:                         s/operator/5/g;s/root.kmem/root.2/g;s/root\./root:/g'`
                    971:        }
                    972: fi
                    973: list="$RMlist"
                    974: for mode in $modes; do
                    975:        list="$list;${mklist[$mode]}"
                    976: done
                    977: for group in $groups; do
                    978:        list="$list;${grplist[$group]}"
                    979: done
                    980: list="$list;$MKlist"
                    981: if [ "$eo" = "echo" -o "$eo" = "transform" ]; then
                    982:        $eo "$list"
                    983: else
                    984:        echo "$list" | sh
                    985: fi
                    986: divert(3)dnl
                    987: dnl
                    988: R() {
                    989: for i in "$@"
                    990: do
                    991: U=`unt $i`
                    992: [ "$U" ] || U=0
                    993:
                    994: case $i in
                    995: dnl