Commit | Line | Data |
---|---|---|
a298d207 GCI |
1 | #!/usr/bin/perl |
2 | # | |
6ad7895a JH |
3 | # Copyright (c) 1994 GB Data Consulting |
4 | # All rights reserved. | |
a298d207 | 5 | # |
6ad7895a JH |
6 | # Redistribution and use in source and binary forms, with or without |
7 | # modification, are permitted provided that the following conditions | |
8 | # are met: | |
9 | # 1. Redistributions of source code must retain the above copyright | |
10 | # notice, this list of conditions and the following disclaimer. | |
11 | # 2. Redistributions in binary form must reproduce the above copyright | |
12 | # notice, this list of conditions and the following disclaimer in the | |
13 | # documentation and/or other materials provided with the distribution. | |
14 | # 3. The name of the Author may not be used to endorse or promote products | |
15 | # derived from this software without specific prior written permission. | |
a298d207 | 16 | # 4. This license extends only to network distributed versions. |
6ad7895a JH |
17 | # All even number versions are non-network. |
18 | # THIS SOFTWARE IS PROVIDED BY GB DATA AND CONTRIBUTORS ``AS IS'' AND | |
19 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
21 | # ARE DISCLAIMED. IN NO EVENT SHALL GB DATA OR CONTRIBUTORS BE LIABLE | |
22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
24 | # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
25 | # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
26 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
27 | # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
28 | # SUCH DAMAGE. | |
a298d207 GCI |
29 | # |
30 | # | |
31 | # | |
32 | # | |
33 | # $Id:$ | |
34 | # | |
6ad7895a JH |
35 | |
36 | &config; | |
37 | &standard_devices; | |
38 | &menu; | |
39 | ||
40 | sub menu { | |
41 | system "clear"; | |
42 | ||
43 | print " ConfigIt!\n"; | |
44 | print " A auto-configuration system\n"; | |
45 | print "\n\n\n"; | |
46 | ||
47 | print " 1 Disk devices\n"; | |
48 | print " 2 Serial devices\n"; | |
49 | print " 3 Network devices\n"; | |
50 | print " 4 Console devices\n"; | |
51 | print " 5 Tape devices\n"; | |
52 | print " 6 Misc devices and options\n"; | |
a298d207 | 53 | print " 7 Parallel devices\n"; |
6ad7895a JH |
54 | print "\n\n"; |
55 | print "Please enter you choice or q to quit: "; | |
56 | chop ($choice = <STDIN>); | |
57 | ||
a298d207 | 58 | if ($choice eq ('q' || 'Q')) |
6ad7895a JH |
59 | { |
60 | print (CONFIG "\n\n\n"); | |
61 | close CONFIG; | |
62 | exit; } | |
6ad7895a JH |
63 | elsif ($choice == 1) |
64 | { &disk_devices; } | |
65 | elsif ($choice == 2 && !$serdevsflag) | |
66 | { &serial_devices; } | |
67 | elsif ($choice == 3 && !$netdevsflag) | |
68 | { &network_devices; } | |
69 | elsif ($choice == 4) | |
70 | { &console_devices; } | |
71 | elsif ($choice == 5) | |
72 | { &tape_devices; } | |
73 | elsif ($choice == 6) | |
74 | { &misc_dev_option; } | |
a298d207 GCI |
75 | elsif ($choice == 7) |
76 | { ¶llel_ports; } | |
6ad7895a JH |
77 | else |
78 | { &menu; } | |
79 | &menu; | |
80 | ||
81 | } | |
82 | ||
83 | ||
84 | sub config { | |
85 | system "clear"; | |
86 | print " ConfigIt!\n"; | |
87 | print " A Auto-configuration System\n\n"; | |
88 | print "Please enter the name of your system: "; | |
89 | chop ($systemname = <STDIN>); | |
90 | $systemname =~ tr/a-z/A-Z/; | |
91 | open (CONFIG, ">>$systemname"); | |
92 | ||
93 | } | |
94 | ||
95 | ||
96 | sub config_serial_devices { | |
97 | print (CONFIG "\n#Multi-port Config\n"); | |
98 | print "Multi-port Comm-Cards are not supported at this time....\n\n"; | |
99 | sleep 3; | |
100 | ||
101 | } | |
102 | ||
103 | ||
104 | sub console_devices { | |
105 | system "clear"; | |
106 | print " Console Devices\n\n"; | |
107 | print " 1 Syscons\n"; | |
108 | print " 2 Pccons\n"; | |
109 | print "\n\n\n"; | |
110 | print "Please enter your choice (q or Q to quit): "; | |
111 | chop ($cdevs = <STDIN>); | |
112 | ||
113 | if ($cdevs == 1 && !$condevsflag) | |
114 | { &syscons; } | |
115 | elsif ($cdevs == 2 && !$condevsflag) | |
116 | { &pccons; } | |
117 | elsif ($cdevs eq 'q') | |
118 | { return; } | |
119 | elsif ($cdevs eq 'Q') | |
120 | { return; } | |
121 | else { | |
122 | &console_devices; } | |
123 | } | |
124 | ||
125 | ||
126 | ||
127 | sub disk_devices { | |
128 | ||
6ad7895a JH |
129 | system "clear"; |
130 | local ($choice); | |
131 | print " Disk Device Sub-section\n\n"; | |
132 | print " 1 WD drives\n"; | |
133 | print " 2 SCSI drives\n"; | |
134 | print " 3 Floppy & QIC-40/80 Drives\n"; | |
135 | print " 4 Mitsumi CD-ROM Drive\n"; | |
136 | print "\n\n"; | |
137 | print "Please enter your choice: "; | |
138 | chop ($choice = <STDIN>); | |
139 | ||
a298d207 | 140 | if ($choice eq ('q' || 'Q')) |
6ad7895a JH |
141 | { return; } |
142 | elsif ($choice == 1 && !$wdflag) | |
143 | { &wd_drives; } | |
144 | elsif ($choice == 2 && !$scsidevflag) | |
145 | { &scsi_drives; } | |
146 | elsif ($choice == 3 && !$floppyflag) | |
147 | { &floppy_drives; } | |
148 | elsif ($choice == 4 && !$mitsumiflag) | |
149 | { &mitsumi_drive; } | |
150 | else | |
151 | { &disk_devices; } | |
152 | } | |
153 | ||
154 | ||
155 | sub doonecard { | |
a298d207 | 156 | $cardnum = @_[0]; |
6ad7895a JH |
157 | |
158 | system "clear"; | |
159 | print " 1 AT&T EN100/STARLAN 10\n"; | |
160 | print " 2 ISOLAN AT 4141-0\n or ISOLINK 4110\n"; | |
161 | print " 3 WD/SMC 8003 & 8013\n"; | |
162 | print " 4 SMC Ultra Elite 16\n"; | |
163 | print " 5 3com 3c503\n"; | |
164 | print " 6 NE1000/NE2000\n"; | |
a298d207 | 165 | print "\n\nPlease enter the type of network card number $cardnum : "; |
6ad7895a JH |
166 | chop ($netcardchoice = <STDIN>); |
167 | print "Please enter the port (in hex) address of the card: "; | |
168 | chop ($netcardadd = <STDIN>); | |
169 | print "Please enter the irq of the card: "; | |
170 | chop ($netcardirq = <STDIN>); | |
a298d207 | 171 | |
6ad7895a JH |
172 | if ($netcardchoice != 2) |
173 | { print "Please enter the I/O mem of the card: "; | |
174 | chop ($netcardiomem = <STDIN>); | |
175 | } | |
a298d207 GCI |
176 | |
177 | if ($netcardchoice != (2 || 1)) | |
178 | { | |
179 | if ($ednum < 1) { | |
180 | $cardty = 'ed0'; | |
181 | $ednum++; | |
182 | } else { | |
183 | $cardty = "ed$ednum"; | |
184 | $ednum++; | |
185 | } | |
186 | $interp = 'edintr'; | |
187 | } | |
188 | ||
189 | if ($netcardchoice == 2) | |
190 | { | |
191 | if ($isnum < 1) { | |
192 | $cardty = 'is0'; | |
193 | $isnum++; | |
194 | } else { | |
195 | $cardty = "is$isnum"; | |
196 | $isnum++; | |
197 | } | |
198 | $interp = 'isintr'; | |
199 | } | |
200 | ||
201 | if ($netcardchoice == 1) | |
202 | { | |
203 | if ($ienum < 1) { | |
204 | $cardty = 'ie0'; | |
205 | $ienum++; | |
206 | } else { | |
207 | $cardty = "ie$ienum"; | |
208 | $ienum++ | |
209 | } | |
210 | $interp = 'ieintr'; | |
211 | } | |
212 | ||
213 | print (CONFIG "device $cardty at isa? port $netcardadd net irq $netcardirq iomem $netcardiomem vector $interp\n"); | |
6ad7895a JH |
214 | |
215 | } | |
216 | ||
217 | ||
218 | sub floppy_drives | |
219 | { | |
220 | $floppyflag = 1; | |
221 | system "clear"; | |
a298d207 GCI |
222 | print (CONFIG "\n#Disk devices\n\n"); |
223 | ||
6ad7895a JH |
224 | print "How many floppys do you have?: "; |
225 | chop ($flch = <STDIN>); | |
226 | if ($flch > 0) | |
227 | { | |
228 | print (CONFIG "controller fdc0 at isa? port \"IO_FD1\" bio irq 6 drq 2 vector fdintr\n"); | |
229 | print (CONFIG "disk fd0 at fdc0 drive 0\n"); | |
230 | print (CONFIG "disk fd1 at fdc0 drive 1\n"); | |
231 | } | |
232 | if ($flch > 0) | |
233 | { | |
234 | print "Do you have a QIC-40/80 drive?: "; | |
235 | chop ($qic40 = <STDIN>); | |
236 | if ($qic40 eq 'y' || $qic40 eq 'Y') | |
237 | { | |
238 | print (CONFIG "tape ft0 at fdc0 drive 2\n"); | |
239 | } | |
240 | } | |
241 | } | |
242 | ||
243 | ||
244 | sub misc_dev_option { | |
245 | system "clear"; | |
246 | $miscdevflag = 1; | |
247 | print (CONFIG "\n# Misc Devices\n"); | |
248 | print "Do you want kernel tracing?: "; | |
249 | chop ($ktrace = <STDIN>); | |
a298d207 | 250 | if ($ktrace eq ('y' || 'Y')) |
6ad7895a JH |
251 | { |
252 | print (CONFIG "options KTRACE\n"); | |
253 | } | |
254 | print "Do you want kernel debugging?: "; | |
255 | chop ($kddb = <STDIN>); | |
a298d207 | 256 | if ($kddb eq ('y' || 'Y')) |
6ad7895a JH |
257 | { |
258 | print (CONFIG "pseudo-device ddb\n"); | |
259 | } | |
260 | print "Do you want fast symlinks?: "; | |
261 | chop ($fastlinks = <STDIN>); | |
a298d207 | 262 | if ($fastlinks eq ('y' || 'Y')) |
6ad7895a JH |
263 | { |
264 | print (CONFIG "options FASTLINKS\n"); | |
265 | } | |
266 | print "Do you want PC file system support?: "; | |
267 | chop ($pcfs = <STDIN>); | |
a298d207 | 268 | if ($pcfs eq ('y' || 'Y')) |
6ad7895a JH |
269 | { |
270 | print (CONFIG "options PCFS\n"); | |
271 | } | |
272 | print "Do you want Memory File System support?: "; | |
273 | chop ($mfs = <STDIN>); | |
a298d207 | 274 | if ($mfs eq ('y' || 'Y')) |
6ad7895a JH |
275 | { |
276 | print (CONFIG "options MFS\n"); | |
277 | } | |
278 | print "Do you want QUOTA support?: "; | |
279 | chop ($quota = <STDIN>); | |
a298d207 | 280 | if ($quota eq ('y' || 'Y')) |
6ad7895a JH |
281 | { |
282 | print (CONFIG "options QUOTA\n"); | |
283 | } | |
284 | print "Do you want FIFO support?: "; | |
285 | chop ($fifo = <STDIN>); | |
a298d207 | 286 | if ($fifo eq ('y' || 'Y')) |
6ad7895a JH |
287 | { |
288 | print (CONFIG "options FIFO\n"); | |
289 | } | |
290 | print "Do you want ISO File System support?: "; | |
291 | chop ($isofs = <STDIN>); | |
a298d207 | 292 | if ($isofs eq ('y' || 'Y')) |
6ad7895a JH |
293 | { |
294 | print (CONFIG "options ISOFS\n"); | |
295 | } | |
296 | ||
297 | } | |
298 | ||
299 | ||
300 | sub mitsumi_drive { | |
301 | system "clear"; | |
302 | $mitsumiflag = 1; | |
a298d207 | 303 | print (CONFIG "\n#Disk devices\n\n"); |
6ad7895a JH |
304 | |
305 | print "What address (hex) is the mitsumi controller at?: "; | |
306 | chop ($mitadd = <STDIN>); | |
307 | print "What interupt is the mitsumi controller at?: "; | |
308 | chop ($mitint = <STDIN>); | |
309 | print (CONFIG "device mcd at isa? port $mitadd bio irq $mitint vector mcdint\n"); | |
310 | } | |
311 | ||
a298d207 GCI |
312 | # |
313 | # Multi-port support for serial_devices.pl | |
314 | # | |
315 | # $Id:$ | |
316 | # | |
317 | ||
318 | ||
319 | sub multiport { | |
320 | $numstandm = @_[0]; | |
321 | system "clear"; | |
322 | print "NOTE: Only 1 multiport card is supported by ConfigIt.\n"; | |
323 | print "Please enter the number of ports on the card: "; | |
324 | chop ($multinum = <STDIN>); | |
325 | print "Please enter the starting port of the card: "; | |
326 | chop ($startm = <STDIN>); | |
327 | print "Please enter the port number of the master port or 0 if none: "; | |
328 | chop ($multimaster = <STDIN>); | |
329 | print "Please enter the intrupt of the card: "; | |
330 | chop ($multiint = <STDIN>); | |
331 | print (CONFIG "\n#Multi-port serial devices\n\n"); | |
332 | print (CONFIG "options \"COM_MULTIPORT\"\n"); | |
333 | ||
334 | $portm = $startm; | |
335 | $startm =~ tr/a-z/A-Z/; | |
336 | ||
337 | for ($i = 1; $i < $multinum + 1; $i++) { | |
338 | $siom = $i + $numstandm; | |
339 | $siom = $siom - 1; | |
340 | if ($siom < 10) { $sio = "sio0"; } else { $sio = "sio"; } | |
341 | ||
342 | if ($multimaster != $i) { | |
343 | print (CONFIG "device $sio$siom at isa? port $portm flags 0x501 vector siointr\n"); | |
344 | } else { | |
345 | print (CONFIG "device $sio$siom at isa? port $portm tty irq $multiint flags 0x501 vector siointr\n"); | |
346 | } | |
347 | $portm =~ tr/A-Z/a-z/; | |
348 | $numorig = hex ("$portm"); | |
349 | $numadd = hex ("0x08"); | |
350 | $numend = $numadd + $numorig; | |
351 | $endm = sprintf ("%lx", $numend); | |
352 | $end1m = $endm; | |
353 | $portm = "0x$end1m"; | |
354 | $portm =~ tr/a-z/A-Z/; | |
355 | ||
356 | } | |
357 | if ($numstandm > 0) { &standard_serial; } | |
358 | } | |
6ad7895a JH |
359 | |
360 | sub network_devices { | |
361 | system "clear"; | |
362 | $netdevsflag = 1; | |
363 | print (CONFIG "\n# Network devices\n"); | |
a298d207 GCI |
364 | print "How many networking cards do you have: "; |
365 | chop ($numnet = <STDIN>); | |
366 | ||
367 | if ($numnet != 0) { | |
368 | for ($i = 1; $i <= $numnet ; $i++) | |
369 | { | |
370 | &doonecard($i); | |
6ad7895a | 371 | } |
a298d207 GCI |
372 | } |
373 | ||
6ad7895a JH |
374 | print "Do you need the SLIP device in the kernel?: "; |
375 | chop ($slipch = <STDIN>); | |
a298d207 | 376 | if ($slipch eq ('y' || 'Y')) |
6ad7895a | 377 | { |
a298d207 GCI |
378 | print "How many slip devices do you need: "; |
379 | chop ($slipno = <STDIN>); | |
380 | print (CONFIG "pseudo-device slip $slipno\n"); | |
6ad7895a | 381 | } |
a298d207 | 382 | |
6ad7895a JH |
383 | print "Do you need the PPP device in the kernel?: "; |
384 | chop ($pppch = <STDIN>); | |
a298d207 | 385 | if ($pppch eq ('y' || 'Y')) |
6ad7895a | 386 | { |
a298d207 GCI |
387 | print "How many PPP devices do you need: "; |
388 | chop ($pppno = <STDIN>); | |
389 | print (CONFIG "pseudo-device ppp $pppno\n"); | |
6ad7895a | 390 | } |
a298d207 | 391 | |
6ad7895a JH |
392 | print "Do you want Berkeley Packet Filter support?: "; |
393 | chop ($bpf = <STDIN>); | |
a298d207 | 394 | if ($bpf eq ('y' || 'Y')) |
6ad7895a JH |
395 | { |
396 | print (CONFIG "pseudo-device bpf\n"); | |
397 | } | |
a298d207 | 398 | |
6ad7895a JH |
399 | print "Do you want Internetwork Gateway support?: "; |
400 | chop ($gateway = <STDIN>); | |
a298d207 | 401 | if ($gateway eq ('y' || 'Y')) |
6ad7895a JH |
402 | { |
403 | print (CONFIG "option GATEWAY\n"); | |
404 | } | |
a298d207 | 405 | |
6ad7895a JH |
406 | print "Do you want NFS support?: "; |
407 | chop ($nfs = <STDIN>); | |
a298d207 | 408 | if ($nfs eq ('y' || 'Y')) |
6ad7895a JH |
409 | { |
410 | print (CONFIG "option NFS\n"); | |
411 | } | |
a298d207 | 412 | |
6ad7895a JH |
413 | print "How many pty's do you want?: "; |
414 | chop ($ptyno = <STDIN>); | |
a298d207 | 415 | if ($ptyno eq ('y' || 'Y')) |
6ad7895a JH |
416 | { |
417 | print (CONFIG "pseudo-device pty $ptyno\n"); | |
418 | } | |
419 | ||
420 | } | |
421 | ||
422 | ||
a298d207 GCI |
423 | # |
424 | # | |
425 | # | |
426 | ||
427 | sub parallel_ports { | |
428 | ||
429 | print "How many parallel ports do you have: "; | |
430 | chop ($paranum = <STDIN>); | |
431 | ||
432 | if ($paranum) { | |
433 | print (CONFIG "\n#Parallel devices\n\n"); | |
434 | ||
435 | for ($i = 1; $i <= $paranum; $i++) { | |
436 | $lpanum = $i - 1; | |
437 | print "Please enter the address for parallel port number $i : "; | |
438 | chop ($paraport = <STDIN>); | |
439 | print "If you are running with out interupts on this port please\n"; | |
440 | print "anwser 0 to the following question.\n"; | |
441 | print "Please enter the interupt for parallel port number $i : "; | |
442 | chop ($paraint = <STDIN>); | |
443 | if ($paraint) { | |
444 | print (CONFIG "device lpa$lpanum at isa? port $paraport tty irq $paraint vector lptintr\n"); | |
445 | } else { | |
446 | print (CONFIG "device lpa$lpanum at isa? port $paraport tty vector lptintr\n"); | |
447 | } | |
448 | ||
449 | } | |
450 | ||
451 | } | |
452 | ||
453 | } | |
454 | ||
6ad7895a JH |
455 | sub pccons { |
456 | $condevsflag = 1; | |
457 | print (CONFIG "\n# Console devices\n\n"); | |
458 | print (CONFIG "device pc0 at isa? port \"IO_KBD\" tty irq 1 vector pcrint\n"); | |
459 | ||
460 | } | |
461 | ||
462 | ||
463 | sub scsi_drives { | |
464 | $scsidevsflag = 1; | |
465 | system "clear"; | |
a298d207 | 466 | print (CONFIG "\n# SCSI Devices\n\n"); |
6ad7895a JH |
467 | print " 1 Adaptec 1542/Bustec 542\n"; |
468 | print " 2 Adaptec 1742\n"; | |
469 | print " 3 Bustec 742\n"; | |
470 | print " 4 Ultrastore 14F/34F\n"; | |
471 | print "\n\n"; | |
472 | print "Enter your choice or q to quit: "; | |
473 | chop ($scsicho = <STDIN>); | |
474 | ||
475 | if ($scsicho eq 'q' || $scsicho eq 'Q') | |
476 | { | |
477 | return; | |
478 | } | |
479 | elsif ($scsicho == 1) | |
480 | { | |
481 | $scsicard = "aha0"; | |
482 | $scsiio = "\"IO_AHA0\""; | |
483 | $scsiint = "ahaintr"; | |
484 | } | |
485 | elsif ($scsicho == 2) | |
486 | { | |
487 | $scsicard = "ahb0"; | |
488 | $scsiint = "ahbintr"; | |
489 | } | |
490 | elsif ($scsicho == 3) | |
491 | { | |
492 | $scsicard = "bt0"; | |
493 | $scsiio = "\"IO_BT0\""; | |
494 | $scsiint = "btintr"; | |
495 | } | |
496 | elsif ($scsicho == 4) | |
497 | { | |
498 | $scsicard = "uha0"; | |
499 | $scsiio = "\"IO_UHA0\""; | |
500 | $scsiio = "uhaintr"; | |
501 | } | |
502 | else { &scsi_drives; } | |
503 | ||
504 | if ($scsicho == 2) | |
505 | { | |
506 | print "Please enter the interupt the AHA-1742 is on: "; | |
507 | chop ($scsiirq = <STDIN>); | |
508 | print (CONFIG "contoller ahb0 at isa? bio irq $scsiirq vector $scsiint\n"); | |
509 | } | |
510 | elsif ($scsicho == 1 || $scsicho == 4) | |
511 | { | |
512 | print "Please enter the interupt the SCSI controller is on: "; | |
513 | chop ($scsiirq = <STDIN>); | |
514 | print "Please enter the dma channel the SCSI controller is on: "; | |
515 | chop ($scsidrq = <STDIN>); | |
516 | print (CONFIG "controller $scsicard at isa? port $scsiio bio irq $scsiirq drq $scsidrq vector $scsiint\n"); | |
517 | } | |
518 | else | |
519 | { | |
520 | print "Please enter the interupt the SCSI controller is on: "; | |
521 | chop ($scsiirq = <STDIN>); | |
522 | print (CONFIG "controller $scsicard at isa? port $scsiio bio irq $scsiirq vector $scsiint\n"); | |
523 | } | |
524 | ||
525 | print (CONFIG "device sd0\n"); | |
526 | print (CONFIG "device sd1\n"); | |
527 | print (CONFIG "device sd2\n"); | |
528 | print (CONFIG "device sd3\n"); | |
529 | print (CONFIG "device st1\n"); | |
530 | print (CONFIG "device st2\n"); | |
531 | print (CONFIG "device cd0\n"); | |
532 | ||
533 | } | |
534 | ||
a298d207 GCI |
535 | # |
536 | # Do serial ports, only standard ones are here | |
537 | # | |
538 | # | |
6ad7895a JH |
539 | |
540 | sub serial_devices { | |
541 | system "clear"; | |
542 | $serdevsflag = 1; | |
6ad7895a | 543 | |
a298d207 GCI |
544 | print "Do you have a multi-port card (Non-standard serial card): "; |
545 | chop ($multicard = <STDIN>); | |
546 | print "Please enter the number of standard serial ports you have: "; | |
547 | chop ($numstand = <STDIN>); | |
6ad7895a | 548 | |
a298d207 GCI |
549 | if ($multicard eq ( 'y' || 'Y')) { |
550 | print "Please enter the number of standard serial ports you also have: "; | |
551 | &multiport($numstand); | |
552 | } else { | |
553 | &standard_serial($numstand); | |
554 | } | |
555 | print "Do you wish to have bidirectionl serial ports: "; | |
556 | chop ($bidir = <STDIN>); | |
557 | if ($bidir eq ('y' || 'Y')) { | |
558 | print (CONFIG "options \"COM_BIDIR\"\n"); | |
559 | } | |
6ad7895a JH |
560 | } |
561 | ||
562 | ||
563 | sub standard_devices { | |
564 | system "clear"; | |
565 | print "What timezone are you in? (cst = 6): "; | |
566 | chop ($time = <STDIN>); | |
567 | print "What type of cpu do you have? ( 386 or 486 ): "; | |
568 | chop ($cputype = <STDIN>); | |
569 | ||
570 | if ($cputype == 386) | |
571 | { | |
572 | print "Do you have a 387?: "; | |
573 | chop ($mathco = <STDIN>); | |
574 | } | |
575 | ||
576 | if ($cputype == 486) | |
577 | { | |
578 | print "Is it a DX or SX?: "; | |
579 | chop ($dxsx = <STDIN>); | |
580 | if ($dxsz eq 'SX' || $dxsx eq 'sx') | |
581 | { | |
582 | $mathco = 'n'; | |
583 | } | |
584 | } | |
585 | ||
a298d207 GCI |
586 | chop ($date = `date`); |
587 | chop ($whoami = `whoami`); | |
588 | ||
589 | print (CONFIG "\n#\n#Config file for $systemname\n"); | |
590 | print (CONFIG "#Generated by ConfigIt!\n"); | |
591 | print (CONFIG "#Generated at $date by $whoami\n#\n#\n\n"); | |
592 | ||
593 | print (CONFIG "#Generic Items\n\n"); | |
6ad7895a JH |
594 | print (CONFIG "machine \"i386\"\n"); |
595 | print (CONFIG "cpu \"I","$cputype","_CPU\"\n"); | |
a298d207 | 596 | |
6ad7895a JH |
597 | if ($mathco eq 'n' || $mathco eq 'N') |
598 | { | |
a298d207 GCI |
599 | print "Do you wish to use the new math emulator (its better): "; |
600 | chop ($choicesti = <STDIN>); | |
601 | if ($choicesti eq ('y' || 'Y')) { | |
602 | print (CONFIG "options GPL_MATH_EMULATE\n"); | |
603 | } else { | |
6ad7895a JH |
604 | print (CONFIG "options MATH_EMULATE\n"); |
605 | } | |
a298d207 GCI |
606 | } |
607 | ||
608 | print "The following is used to set certain parameters.\n"; | |
609 | print "Please enter the number of users you expect: "; | |
610 | chop ($maxusers = <STDIN>); | |
611 | if ($maxusers <= 10) { $maxusers = 10; } | |
6ad7895a | 612 | print (CONFIG "ident $systemname\n"); |
a298d207 | 613 | print (CONFIG "maxusers $maxusers\n"); |
6ad7895a JH |
614 | print (CONFIG "maxfdescs 2000\n"); |
615 | print (CONFIG "timezone $time dst\n"); | |
616 | print (CONFIG "options \"COMPAT_43\"\n"); | |
617 | print (CONFIG "options UCONSOLE\n"); | |
618 | print (CONFIG "options XSERVER\n"); | |
619 | print (CONFIG "options INET\n"); | |
620 | print "What device is root on? (e.g. \"wd0\"): "; | |
621 | chop ($root = <STDIN>); | |
a298d207 GCI |
622 | if ($root) { |
623 | $roots = "root on $root"; | |
624 | } else { print "ABORTING you must have a root!\n"; exit; } | |
625 | ||
6ad7895a JH |
626 | print "What device is swap on? (e.g. \"wd0\" or \"wd0 and wd1\"): "; |
627 | chop ($swap = <STDIN>); | |
a298d207 GCI |
628 | if ($swap) { |
629 | $swaps = "swap on $swap"; | |
630 | } | |
6ad7895a JH |
631 | print "What device is dump on? (e.g. \"wd0\"): "; |
632 | chop ($dump = <STDIN>); | |
a298d207 GCI |
633 | if ($dumps) { |
634 | $dumps = "dumps on $dump"; | |
635 | } | |
636 | ||
637 | print (CONFIG "config \"386bsd\" $roots $swaps $dumps \n"); | |
6ad7895a JH |
638 | print (CONFIG "pseudo-device vnodepager\n"); |
639 | print (CONFIG "pseudo-device swappager\n"); | |
640 | print (CONFIG "pseudo-device devpager\n"); | |
641 | print (CONFIG "pseudo-device ether\n"); | |
642 | print (CONFIG "pseudo-device loop\n"); | |
643 | print (CONFIG "pseudo-device log\n"); | |
644 | print (CONFIG "pseudo-device speaker\n"); | |
645 | print (CONFIG "device isa0\n"); | |
646 | ||
647 | } | |
648 | ||
649 | ||
a298d207 GCI |
650 | # |
651 | # Do standard serial ports | |
652 | # | |
653 | ||
654 | sub standard_serial { | |
655 | $sernumss = @_[0]; | |
656 | ||
657 | print "Are the $sernumss standard ports at the standard location and interup: "; | |
658 | chop ($standss = <STDIN>); | |
659 | if ($standss eq ('y' || 'Y')) { | |
660 | ||
661 | if ($sernumss == 0 || $sernumss > 4) | |
662 | { print "invalid number of serial ports!!\n\n"; | |
663 | print "Please hit any key to continue."; | |
664 | while (!($kbhit = <STDIN>)) {} | |
665 | &serial_devices;} | |
666 | ||
667 | if ($sernumss < 3) { | |
668 | print (CONFIG "\n#Standard serial devices\n\n"); | |
669 | print (CONFIG "device sio00 at isa? port \"IO_COM1\" tty irq 4 vector siointr\n"); | |
670 | print (CONFIG "device sio01 at isa? port \"IO_COM2\" tty irq 3 vector siointr\n"); | |
671 | } else { | |
672 | print (CONFIG "\n#Standard serial devices\n\n"); | |
673 | print (CONFIG "device sio00 at isa? port \"IO_COM1\" tty irq 4 vector siointr\n"); | |
674 | print (CONFIG "device sio01 at isa? port \"IO_COM2\" tty irq 3 vector siointr\n"); | |
675 | print (CONFIG "device sio02 at isa? port \"IO_COM3\" tty irq 5 vector siointr\n"); | |
676 | print (CONFIG "device sio03 at isa? port \"IO_COM4\" tty irq 9 vector siointr\n"); } | |
677 | ||
678 | } else { | |
679 | print (CONFIG "\n#Standard serial devices\n\n"); | |
680 | ||
681 | for ($i = 1;$i <= $sernum;$i++) { | |
682 | print "Please enter the intrupt for serial port number $i: "; | |
683 | chop ($intt = <STDIN>); | |
684 | print "Please enter the address for serial port number $i: "; | |
685 | chop ($portk = <STDIN>); | |
686 | $iik = $i - 1; | |
687 | print (CONFIG "device sio0$iik at isa port $portk tty irq $intt vector siointr\n"); | |
688 | ||
689 | } | |
690 | } | |
691 | } | |
692 | ||
693 | ||
6ad7895a JH |
694 | |
695 | sub syscons { | |
696 | print (CONFIG "\n#Console device\n"); | |
697 | ||
698 | $condevsflag = 1; | |
699 | system "clear"; | |
700 | print (CONFIG "device sc0 at isa? port \"IO_KBD\" tty irq 1 vector scintr\n"); | |
701 | print "How many virtual terminals do you want? (max 8): "; | |
702 | chop ($numvty = <STDIN>); | |
703 | if ($numvty == 0 || $numvty > 8) | |
704 | { $numvty = 1; } | |
705 | print (CONFIG "options \"NCONS=$numvty\"\n"); | |
706 | print (CONFIG "options \"STAR_SAVER\"\n"); | |
707 | print (CONFIG "options \"FADE_SAVER\"\n"); | |
708 | print (CONFIG "options \"SNAKE_SAVER\"\n"); | |
709 | print (CONFIG "options \"BLANK_SAVER\"\n"); | |
710 | ||
711 | } | |
712 | ||
713 | ||
714 | sub tape_devices | |
715 | { | |
716 | system "clear"; | |
a298d207 | 717 | print (CONFIG "\n# QIC-02 Tape devices\n\n"); |
6ad7895a JH |
718 | $tapdevsflag = 1; |
719 | print "Do you have a QIC-02 tape drive?: "; | |
720 | chop ($qic02 = <STDIN>); | |
a298d207 | 721 | if ($qic02 eq ('y' || 'Y')) |
6ad7895a JH |
722 | { |
723 | print "What address is it at? (Hex): "; | |
724 | chop ($qic02add = <STDIN>); | |
725 | print "What interupt is it at?: "; | |
726 | chop ($qic02int = <STDIN>); | |
727 | print (CONFIG "device wt0 at isa? port $qic02add bio irq $qic02int drq 1 vector wtintr\n"); | |
728 | } | |
729 | } | |
730 | ||
731 | ||
732 | sub wd_drives { | |
733 | $wdflag = 1; | |
734 | local ($choice); | |
735 | system "clear"; | |
a298d207 GCI |
736 | print (CONFIG "\n#Disk devices\n\n"); |
737 | ||
6ad7895a JH |
738 | print " WD Drive Configuration\n\n"; |
739 | print "How many WD drives do you have (Max of 4): "; | |
740 | chop ($choice = <STDIN>); | |
741 | ||
742 | if ($choice >= 3 ) { | |
743 | print "\n"; | |
744 | print (CONFIG "controller wdc0 at isa? port \"IO_WD1\" bio irq 14 vector wdintr\n"); | |
745 | print "\n"; | |
746 | print (CONFIG "disk wd0 at wdc0 drive 0\n"); | |
747 | print (CONFIG "disk wd1 at wdc1 drive 1\n"); | |
748 | print (CONFIG "controller wdc1 at isa? port \"IO_WD2\" bio irq 15 vector wdintr\n"); | |
749 | print (CONFIG "disk wd2 at wdc1 drive 0\n"); | |
750 | print (CONFIG "disk wd3 at wdc1 drive 1\n"); | |
751 | print "\n"; | |
752 | } else { | |
753 | print "\n"; | |
754 | print (CONFIG "controller wdc0 at isa? port \"IO_WD1\" bio irq 14 vector wdintr\n"); | |
755 | print "\n"; | |
756 | print (CONFIG "disk wd0 at wdc0 drive 0\n"); | |
757 | print (CONFIG "disk wd1 at wdc0 drive 1\n"); | |
758 | print "\n"; | |
759 | } | |
760 | } | |
761 |