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