| 1 | #! /bin/sh |
| 2 | # @(#)MAKEDEV 4.16 7/23/83 |
| 3 | # |
| 4 | # Device "make" file. Valid arguments: |
| 5 | # std standard devices |
| 6 | # local configuration specific devices |
| 7 | # Tapes: |
| 8 | # ht* massbus tm03 & tu?? |
| 9 | # tm* unibus tm11 & te10 emulations (e.g. Emulex tc-11) |
| 10 | # ts* unibus ts11 |
| 11 | # mt* massbus tu78 |
| 12 | # ut* unibus tu45 emulations (e.g.si 9700) |
| 13 | # uu* tu58 cassettes on dl11 controller |
| 14 | # Disks: |
| 15 | # hp* massbus rm?? |
| 16 | # hk* unibus rk06 and rk07 |
| 17 | # up* other unibus devices (e.g. on Emulex sc-21v controller) |
| 18 | # ra* unibus uda50 w/ ra?? |
| 19 | # rl* unibus rl02 |
| 20 | # rb* 730 idc w/ rb80 and/or rb02 |
| 21 | # rx* unibus rx211 floppy disk |
| 22 | # Terminal multiplexors: |
| 23 | # dz* unibus dz11 and dz32 |
| 24 | # dh* unibus dh11 and emulations (e.g. Able dmax, Emulex cs-11) |
| 25 | # dmf* unibus dmf32 |
| 26 | # Pseudo terminals: |
| 27 | # pty* set of 16 master and slave pseudo terminals |
| 28 | # Printers: |
| 29 | # ct* unibus parallel interface to CAT typesetter |
| 30 | # lp* unibus lp11 parallel interface |
| 31 | # va* unibus varian parallel interface |
| 32 | # vp* unibus versatec parallel interface |
| 33 | # Call units: |
| 34 | # dn* unibus dn11 and emulations (e.g. Able Quadracall) |
| 35 | # Special purpose devices: |
| 36 | # ik* unibus interface to ikonas frame buffer |
| 37 | # ps* unibus interface to e&s picture system 2 |
| 38 | # ad* unibus interface to data translation a/d converter |
| 39 | umask 77 |
| 40 | for i |
| 41 | do |
| 42 | case $i in |
| 43 | |
| 44 | std) |
| 45 | /etc/mknod console c 0 0 |
| 46 | /etc/mknod drum c 7 0 ; chmod 644 drum |
| 47 | /etc/mknod floppy c 8 0 |
| 48 | /etc/mknod tu0 b 8 0 |
| 49 | /etc/mknod tu1 b 8 1 |
| 50 | /etc/mknod kUmem c 3 3 ;: no one has ever tried using this |
| 51 | /etc/mknod kmem c 3 1 ; chmod 644 kmem |
| 52 | /etc/mknod mem c 3 0 ; chmod 644 mem |
| 53 | /etc/mknod null c 3 2 ; chmod 666 null |
| 54 | /etc/mknod tty c 2 0 ; chmod 666 tty |
| 55 | ;; |
| 56 | |
| 57 | ht*|tm*|ts*|mt*|ut*) |
| 58 | umask 0 ; unit=`expr $i : '..\(.*\)'` |
| 59 | case $i in |
| 60 | ht*) blk=1; chr=5 ;; |
| 61 | tm*) blk=5; chr=14;; |
| 62 | ts*) blk=6; chr=16;; |
| 63 | mt*) blk=7; chr=19;; |
| 64 | ut*) blk=10; chr=17;; |
| 65 | esac |
| 66 | case $unit in |
| 67 | 0|1|2|3|4|5|6|7) |
| 68 | four=`expr $unit + 4` ; eight=`expr $unit + 8` |
| 69 | twelve=`expr $unit + 12`; twenty=`expr $unit + 20` |
| 70 | /etc/mknod mt$unit b $blk $unit |
| 71 | /etc/mknod mt$four b $blk $four |
| 72 | /etc/mknod mt$eight b $blk $eight |
| 73 | /etc/mknod mt$twelve b $blk $twelve |
| 74 | /etc/mknod nmt$unit b $blk $four ;: sanity w/pdp11 v7 |
| 75 | /etc/mknod nmt$eight b $blk $twelve ;: ditto |
| 76 | /etc/mknod nrmt$unit c $chr $four ;: sanity w/pdp11 v7 |
| 77 | /etc/mknod nrmt$eight c $chr $twelve ;: ditto |
| 78 | /etc/mknod rmt$unit c $chr $unit |
| 79 | /etc/mknod rmt$four c $chr $four |
| 80 | /etc/mknod rmt$eight c $chr $eight |
| 81 | /etc/mknod rmt$twelve c $chr $twelve |
| 82 | if [ $i = ut ] |
| 83 | then |
| 84 | /etc/mknod mt$twenty b $blk $twenty |
| 85 | /etc/mknod rmt$twenty c $chr $twenty |
| 86 | fi |
| 87 | umask 77 |
| 88 | ;; |
| 89 | *) |
| 90 | echo bad unit for tape in: $1 |
| 91 | ;; |
| 92 | esac |
| 93 | ;; |
| 94 | |
| 95 | hp*|hk*|up*|ra*|rl*|rb*) |
| 96 | unit=`expr $i : '..\(.*\)'` |
| 97 | case $i in |
| 98 | hp*) name=hp; blk=0; chr=4;; |
| 99 | hk*) name=hk; blk=3; chr=11;; |
| 100 | up*) name=up; blk=2; chr=13;; |
| 101 | ra*) name=ra; blk=9; chr=9;; |
| 102 | rb*) name=rb; blk=11; chr=23;; |
| 103 | rl*) name=rl; blk=14; chr=32;; |
| 104 | esac |
| 105 | case $unit in |
| 106 | 0|1|2|3|4|5|6|7) |
| 107 | /etc/mknod ${name}${unit}a b $blk `expr $unit '*' 8 + 0` |
| 108 | /etc/mknod ${name}${unit}b b $blk `expr $unit '*' 8 + 1` |
| 109 | /etc/mknod ${name}${unit}c b $blk `expr $unit '*' 8 + 2` |
| 110 | /etc/mknod ${name}${unit}g b $blk `expr $unit '*' 8 + 6` |
| 111 | /etc/mknod r${name}${unit}a c $chr `expr $unit '*' 8 + 0` |
| 112 | /etc/mknod r${name}${unit}b c $chr `expr $unit '*' 8 + 1` |
| 113 | /etc/mknod r${name}${unit}c c $chr `expr $unit '*' 8 + 2` |
| 114 | /etc/mknod r${name}${unit}g c $chr `expr $unit '*' 8 + 6` |
| 115 | if [ $name != hk ] |
| 116 | then |
| 117 | /etc/mknod ${name}${unit}d b $blk `expr $unit '*' 8 + 3` |
| 118 | /etc/mknod ${name}${unit}e b $blk `expr $unit '*' 8 + 4` |
| 119 | /etc/mknod ${name}${unit}f b $blk `expr $unit '*' 8 + 5` |
| 120 | /etc/mknod ${name}${unit}h b $blk `expr $unit '*' 8 + 7` |
| 121 | /etc/mknod r${name}${unit}d c $chr `expr $unit '*' 8 + 3` |
| 122 | /etc/mknod r${name}${unit}e c $chr `expr $unit '*' 8 + 4` |
| 123 | /etc/mknod r${name}${unit}f c $chr `expr $unit '*' 8 + 5` |
| 124 | /etc/mknod r${name}${unit}h c $chr `expr $unit '*' 8 + 7` |
| 125 | fi |
| 126 | ;; |
| 127 | *) |
| 128 | echo bad unit for disk in: $i |
| 129 | ;; |
| 130 | esac |
| 131 | ;; |
| 132 | |
| 133 | rx*) |
| 134 | unit=`expr $i : '..\(.*\)'` |
| 135 | name=rx; chr=30; blk=12; |
| 136 | case $unit in |
| 137 | 0|1|2|3|4|5|6|7) |
| 138 | /etc/mknod ${name}${unit} b $blk `expr $unit '*' 8 + 0` |
| 139 | /etc/mknod r${name}${unit}a c $chr `expr $unit '*' 8 + 0` |
| 140 | /etc/mknod r${name}${unit}b c $chr `expr $unit '*' 8 + 1` |
| 141 | /etc/mknod r${name}${unit}c c $chr `expr $unit '*' 8 + 2` |
| 142 | /etc/mknod r${name}${unit}d c $chr `expr $unit '*' 8 + 3` |
| 143 | ;; |
| 144 | *) |
| 145 | echo bad unit for floppy disk in: $i |
| 146 | ;; |
| 147 | esac |
| 148 | ;; |
| 149 | |
| 150 | uu*) |
| 151 | unit=`expr $i : '..\(.*\)'` |
| 152 | name=uu; blk=13; |
| 153 | case $unit in |
| 154 | 0|1|2|3) |
| 155 | /etc/mknod ${name}${unit} b $blk `expr $unit '*' 2 + 0` |
| 156 | /etc/mknod ${name}${unit}a b $blk `expr $unit '*' 2 + 1` |
| 157 | ;; |
| 158 | *) |
| 159 | echo bad unit for uu cassette in: $i |
| 160 | ;; |
| 161 | esac |
| 162 | ;; |
| 163 | |
| 164 | dz*) |
| 165 | unit=`expr $i : 'dz\(.*\)'` |
| 166 | case $unit in |
| 167 | 0|1|2|3|4|5|6|7) |
| 168 | eval `echo $unit | awk ' { u = $1 } END { |
| 169 | for (i = 0; i < 8; i++) |
| 170 | printf("/etc/mknod tty%02d c 1 %d; ",u*8+i,u*8+i); }'` |
| 171 | ;; |
| 172 | *) |
| 173 | echo bad unit for dz in: $i |
| 174 | ;; |
| 175 | esac |
| 176 | ;; |
| 177 | |
| 178 | dh*|dmf*) |
| 179 | case $i in |
| 180 | dh*) name=dh; major=12;; |
| 181 | dmf*) name=dmf; major=22;; |
| 182 | esac |
| 183 | unit=`expr $i : "$name\(.*\)"` |
| 184 | case $unit in |
| 185 | 0) ch=h ;; 1) ch=i ;; 2) ch=j ;; 3) ch=k ;; |
| 186 | 4) ch=l ;; 5) ch=m ;; 6) ch=n ;; 7) ch=o ;; |
| 187 | *) echo bad unit for $name in: $i ;; |
| 188 | esac |
| 189 | case $ch in |
| 190 | h|i|j|k|l|m|n|o) |
| 191 | eval `echo $ch $unit $major | |
| 192 | awk ' { ch = $1; u = 16 * $2; m = $3 } END { |
| 193 | for (i = 0; i < 16; i++) |
| 194 | printf("/etc/mknod tty%s%x c %d %d; ",ch,i,m,u+i); }'` |
| 195 | ;; |
| 196 | esac |
| 197 | ;; |
| 198 | |
| 199 | lp*|va*|vp*) |
| 200 | case $i in |
| 201 | lp*) name=lp; major=15;; |
| 202 | va*) name=va; major=10;; |
| 203 | vp*) name=vp; major=6;; |
| 204 | esac |
| 205 | unit=`expr $i : "$name\(.*\)"` |
| 206 | case $unit in |
| 207 | 0|1|2|3|4|5|6|7) |
| 208 | /etc/mknod $i c $major $unit; |
| 209 | chmod 666 $i |
| 210 | ;; |
| 211 | *) |
| 212 | echo bad unit for $name in: $i |
| 213 | ;; |
| 214 | esac |
| 215 | ;; |
| 216 | |
| 217 | pty*) |
| 218 | class=`expr $i : 'pty\(.*\)'` |
| 219 | case $class in |
| 220 | 0) offset=0 name=p;; |
| 221 | 1) offset=16 name=q;; |
| 222 | 2) offset=32 name=r;; |
| 223 | *) echo bad unit for pty in: $i;; |
| 224 | esac |
| 225 | case $class in |
| 226 | 0|1|2) |
| 227 | umask 0 |
| 228 | eval `echo $offset $name | awk ' { b=$1; n=$2 } END { |
| 229 | for (i = 0; i < 16; i++) |
| 230 | printf("/etc/mknod tty%s%x c 20 %d; \ |
| 231 | /etc/mknod pty%s%x c 21 %d; ", \ |
| 232 | n, i, b+i, n, i, b+i); }'` |
| 233 | umask 77 |
| 234 | ;; |
| 235 | esac |
| 236 | ;; |
| 237 | |
| 238 | dn*|ik*|ps*|ad*|ct*) |
| 239 | unit=`expr $i : '..\(.*\)'` |
| 240 | case $i in |
| 241 | ct*) name=ct; chr=18;; |
| 242 | dn*) name=cu; chr=24;; |
| 243 | ps*) name=ps; chr=27;; |
| 244 | ad*) name=ad; chr=29;; |
| 245 | ik*) name=ik; chr=31;; |
| 246 | esac |
| 247 | case $unit in |
| 248 | 0|1|2|3|4|5|6|7) |
| 249 | umask 0 |
| 250 | /etc/mknod ${name}${unit} c ${chr} ${unit} |
| 251 | umask 77 |
| 252 | ;; |
| 253 | *) |
| 254 | echo bad unit for ${name} in: $i |
| 255 | ;; |
| 256 | esac |
| 257 | ;; |
| 258 | |
| 259 | local) |
| 260 | sh MAKEDEV.local |
| 261 | ;; |
| 262 | esac |
| 263 | done |