diff options
author | peter <peter@FreeBSD.org> | 2000-06-13 22:28:50 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2000-06-13 22:28:50 +0000 |
commit | 647ef85d48424b2f17b827cdc91e595b17c66455 (patch) | |
tree | 356af9076580e616e17aaffdac3db15319e62b95 /sys/alpha | |
parent | c859e3ccfbf4963472ba1374f7ea67b524d43395 (diff) | |
download | FreeBSD-src-647ef85d48424b2f17b827cdc91e595b17c66455.zip FreeBSD-src-647ef85d48424b2f17b827cdc91e595b17c66455.tar.gz |
Borrow phk's axe and apply the next stage of config(8)'s evolution.
Use Warner Losh's "hint" driver to decode ascii strings to fill the
resource table at boot time.
config(8) no longer generates an ioconf.c table - ie: the configuration
no longer has to be compiled into the kernel. You can reconfigure your
isa devices with the likes of this at loader(8) time:
set hint.ed.0.port=0x320
userconfig will be rewritten to use this style interface one day and will
move to /boot/userconfig.4th or something like that.
It is still possible to statically compile in a set of hints into a kernel
if you do not wish to use loader(8). See the "hints" directive in GENERIC
as an example.
All device wiring has been moved out of config(8). There is a set of
helper scripts (see i386/conf/gethints.pl, and the same for alpha and pc98)
that extract the 'at isa? port foo irq bar' from the old files and produces
a hints file. If you install this file as /boot/device.hints (and update
/boot/defaults/loader.conf - You can do a build/install in sys/boot) then
loader will load it automatically for you. You can also compile in the
hints directly with: hints "device.hints" as well.
There are a few things that I'm not too happy with yet. Under this scheme,
things like LINT would no longer be useful as "documentation" of settings.
I have renamed this file to 'NOTES' and stored the example hints strings
in it. However... this is not something that config(8) understands, so
there is a script that extracts the build-specific data from the
documentation file (NOTES) to produce a LINT that can be config'ed and
built. A stack of man4 pages will need updating. :-/
Also, since there is no longer a difference between 'device' and
'pseudo-device' I collapsed the two together, and the resulting 'device'
takes a 'number of units' for devices that still have it statically
allocated. eg: 'device fe 4' will compile the fe driver with NFE set
to 4. You can then set hints for 4 units (0 - 3). Also note that
'device fe0' will be interpreted as "zero units of 'fe'" which would be
bad, so there is a config warning for this. This is only needed for
old drivers that still have static limits on numbers of units.
All the statically limited drivers that I could find were marked.
Please exercise EXTREME CAUTION when transitioning!
Moral support by: phk, msmith, dfr, asmodai, imp, and others
Diffstat (limited to 'sys/alpha')
-rw-r--r-- | sys/alpha/conf/GENERIC | 48 | ||||
-rw-r--r-- | sys/alpha/conf/GENERIC.hints | 26 | ||||
-rw-r--r-- | sys/alpha/conf/NOTES | 48 | ||||
-rw-r--r-- | sys/alpha/conf/SIMOS | 14 | ||||
-rw-r--r-- | sys/alpha/conf/gethints.pl | 94 |
5 files changed, 175 insertions, 55 deletions
diff --git a/sys/alpha/conf/GENERIC b/sys/alpha/conf/GENERIC index 2f76c85..81bafbc 100644 --- a/sys/alpha/conf/GENERIC +++ b/sys/alpha/conf/GENERIC @@ -27,6 +27,8 @@ cpu EV5 ident GENERIC maxusers 32 +hints "GENERIC.hints" + #makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols # Platforms supported @@ -72,8 +74,7 @@ device pci options COMPAT_OLDPCI # PCI compatability shims # Floppy drives -device fdc0 at isa? port IO_FD1 irq 6 drq 2 -device fd0 at fdc0 drive 0 +device fdc # ATA and ATAPI devices device ata @@ -97,27 +98,26 @@ device cd # CD device pass # Passthrough device (direct SCSI access) # atkbdc0 controls both the keyboard and the PS/2 mouse -device atkbdc0 at isa? port IO_KBD -device atkbd0 at atkbdc? irq 1 -device psm0 at atkbdc? irq 12 +device atkbdc 1 +device atkbd +device psm -device vga0 at isa? +device vga # splash screen/screen saver -pseudo-device splash +device splash # syscons is the default console driver, resembling an SCO console -device sc0 at isa? +device sc 1 # real time clock -device mcclock0 at isa? port 0x70 +device mcclock # Serial (COM) ports -device sio0 at isa? port IO_COM1 irq 4 -device sio1 at isa? port IO_COM2 irq 3 flags 0x50 +device sio # Parallel port -device ppc0 at isa? irq 7 +device ppc device ppbus # Parallel port bus (required) device lpt # Printer device plip # TCP/IP over parallel @@ -143,19 +143,19 @@ device wb # Winbond W89C840F device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # Pseudo devices - the number indicates how many units to allocated. -pseudo-device loop # Network loopback -pseudo-device ether # Ethernet support -pseudo-device sl # Kernel SLIP -pseudo-device ppp 1 # Kernel PPP -pseudo-device tun # Packet tunnel. -pseudo-device pty # Pseudo-ttys (telnet etc) -pseudo-device md # Memory "disks" -pseudo-device gif 4 # IPv6 and IPv4 tunneling -pseudo-device faith 1 # IPv6-to-IPv4 relaying/(translation) - -# The `bpf' pseudo-device enables the Berkeley Packet Filter. +device loop # Network loopback +device ether # Ethernet support +device sl # Kernel SLIP +device ppp 1 # Kernel PPP +device tun # Packet tunnel. +device pty # Pseudo-ttys (telnet etc) +device md # Memory "disks" +device gif 4 # IPv6 and IPv4 tunneling +device faith 1 # IPv6-to-IPv4 relaying/(translation) + +# The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! -pseudo-device bpf #Berkeley packet filter +device bpf #Berkeley packet filter # USB support device uhci # UHCI PCI->USB interface diff --git a/sys/alpha/conf/GENERIC.hints b/sys/alpha/conf/GENERIC.hints new file mode 100644 index 0000000..a007536 --- /dev/null +++ b/sys/alpha/conf/GENERIC.hints @@ -0,0 +1,26 @@ +# $FreeBSD$ +hint.fdc.0.at="isa" +hint.fdc.0.port="0x3F0" +hint.fdc.0.irq="6" +hint.fdc.0.drq="2" +hint.fd.0.at="fdc0" +hint.fd.0.drive="0" +hint.atkbdc.0.at="isa" +hint.atkbdc.0.port="0x060" +hint.atkbd.0.at="atkbdc" +hint.atkbd.0.irq="1" +hint.psm.0.at="atkbdc" +hint.psm.0.irq="12" +hint.vga.0.at="isa" +hint.sc.0.at="isa" +hint.mcclock.0.at="isa" +hint.mcclock.0.port="0x70" +hint.sio.0.at="isa" +hint.sio.0.port="0x3F8" +hint.sio.0.irq="4" +hint.sio.1.at="isa" +hint.sio.1.port="0x2F8" +hint.sio.1.irq="3" +hint.sio.1.flags="0x50" +hint.ppc.0.at="isa" +hint.ppc.0.irq="7" diff --git a/sys/alpha/conf/NOTES b/sys/alpha/conf/NOTES index 2f76c85..81bafbc 100644 --- a/sys/alpha/conf/NOTES +++ b/sys/alpha/conf/NOTES @@ -27,6 +27,8 @@ cpu EV5 ident GENERIC maxusers 32 +hints "GENERIC.hints" + #makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols # Platforms supported @@ -72,8 +74,7 @@ device pci options COMPAT_OLDPCI # PCI compatability shims # Floppy drives -device fdc0 at isa? port IO_FD1 irq 6 drq 2 -device fd0 at fdc0 drive 0 +device fdc # ATA and ATAPI devices device ata @@ -97,27 +98,26 @@ device cd # CD device pass # Passthrough device (direct SCSI access) # atkbdc0 controls both the keyboard and the PS/2 mouse -device atkbdc0 at isa? port IO_KBD -device atkbd0 at atkbdc? irq 1 -device psm0 at atkbdc? irq 12 +device atkbdc 1 +device atkbd +device psm -device vga0 at isa? +device vga # splash screen/screen saver -pseudo-device splash +device splash # syscons is the default console driver, resembling an SCO console -device sc0 at isa? +device sc 1 # real time clock -device mcclock0 at isa? port 0x70 +device mcclock # Serial (COM) ports -device sio0 at isa? port IO_COM1 irq 4 -device sio1 at isa? port IO_COM2 irq 3 flags 0x50 +device sio # Parallel port -device ppc0 at isa? irq 7 +device ppc device ppbus # Parallel port bus (required) device lpt # Printer device plip # TCP/IP over parallel @@ -143,19 +143,19 @@ device wb # Winbond W89C840F device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # Pseudo devices - the number indicates how many units to allocated. -pseudo-device loop # Network loopback -pseudo-device ether # Ethernet support -pseudo-device sl # Kernel SLIP -pseudo-device ppp 1 # Kernel PPP -pseudo-device tun # Packet tunnel. -pseudo-device pty # Pseudo-ttys (telnet etc) -pseudo-device md # Memory "disks" -pseudo-device gif 4 # IPv6 and IPv4 tunneling -pseudo-device faith 1 # IPv6-to-IPv4 relaying/(translation) - -# The `bpf' pseudo-device enables the Berkeley Packet Filter. +device loop # Network loopback +device ether # Ethernet support +device sl # Kernel SLIP +device ppp 1 # Kernel PPP +device tun # Packet tunnel. +device pty # Pseudo-ttys (telnet etc) +device md # Memory "disks" +device gif 4 # IPv6 and IPv4 tunneling +device faith 1 # IPv6-to-IPv4 relaying/(translation) + +# The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! -pseudo-device bpf #Berkeley packet filter +device bpf #Berkeley packet filter # USB support device uhci # UHCI PCI->USB interface diff --git a/sys/alpha/conf/SIMOS b/sys/alpha/conf/SIMOS index 1345069b..12ecba7 100644 --- a/sys/alpha/conf/SIMOS +++ b/sys/alpha/conf/SIMOS @@ -55,13 +55,13 @@ device cd # revision 1.20 of this file. #device de -pseudo-device loop -pseudo-device ether -pseudo-device sl -pseudo-device ppp 1 -pseudo-device tun -pseudo-device pty -pseudo-device gzip # Exec gzipped a.out's +device loop +device ether +device sl +device ppp 1 +device tun +device pty +device gzip # Exec gzipped a.out's # KTRACE enables the system-call tracing facility ktrace(2). # This adds 4 KB bloat to your kernel, and slightly increases diff --git a/sys/alpha/conf/gethints.pl b/sys/alpha/conf/gethints.pl new file mode 100644 index 0000000..e29adb1 --- /dev/null +++ b/sys/alpha/conf/gethints.pl @@ -0,0 +1,94 @@ +#! /usr/bin/perl +# +# This is a transition aid. It extracts old-style configuration information +# from a config file and writes an equivalent device.hints file to stdout. +# You can use that with loader(8) or statically compile it in with the +# 'hints' directive. See how GENERIC and GENERIC.hints fit together for +# a static example. You should use loader(8) if at all possible. +# +# $FreeBSD$ + +while (<STDIN>) { + chop; + s/#.*//; + next unless /^device/; + ($dev, $nameunit, $at, $where, @rest) = split; + next unless $at eq "at" && $where ne ""; + $name = $nameunit; + $name =~ s/[0-9]*$//g; + $unit = $nameunit; + $unit =~ s/.*[^0-9]//g; + $where =~ s/\?$//; + print "hint.$name.$unit.at=\"$where\"\n"; + while ($key = shift(@rest)) { + if ($key eq "disable") { + print "hint.$name.$unit.disabled=\"1\"\n"; + next; + } + if ($key eq "port") { + $val = shift(@rest); + $val =~ s/IO_AHA0/0x330/; + $val =~ s/IO_AHA1/0x334/; + $val =~ s/IO_ASC1/0x3EB/; + $val =~ s/IO_ASC2/0x22B/; + $val =~ s/IO_ASC3/0x26B/; + $val =~ s/IO_ASC4/0x2AB/; + $val =~ s/IO_ASC5/0x2EB/; + $val =~ s/IO_ASC6/0x32B/; + $val =~ s/IO_ASC7/0x36B/; + $val =~ s/IO_ASC8/0x3AB/; + $val =~ s/IO_BT0/0x330/; + $val =~ s/IO_BT1/0x334/; + $val =~ s/IO_CGA/0x3D0/; + $val =~ s/IO_COM1/0x3F8/; + $val =~ s/IO_COM2/0x2F8/; + $val =~ s/IO_COM3/0x3E8/; + $val =~ s/IO_COM4/0x2E8/; + $val =~ s/IO_DMA1/0x000/; + $val =~ s/IO_DMA2/0x0C0/; + $val =~ s/IO_DMAPG/0x080/; + $val =~ s/IO_FD1/0x3F0/; + $val =~ s/IO_FD2/0x370/; + $val =~ s/IO_GAME/0x201/; + $val =~ s/IO_GSC1/0x270/; + $val =~ s/IO_GSC2/0x2E0/; + $val =~ s/IO_GSC3/0x370/; + $val =~ s/IO_GSC4/0x3E0/; + $val =~ s/IO_ICU1/0x020/; + $val =~ s/IO_ICU2/0x0A0/; + $val =~ s/IO_KBD/0x060/; + $val =~ s/IO_LPT1/0x378/; + $val =~ s/IO_LPT2/0x278/; + $val =~ s/IO_LPT3/0x3BC/; + $val =~ s/IO_MDA/0x3B0/; + $val =~ s/IO_NMI/0x070/; + $val =~ s/IO_NPX/0x0F0/; + $val =~ s/IO_PMP1/0x026/; + $val =~ s/IO_PMP2/0x178/; + $val =~ s/IO_PPI/0x061/; + $val =~ s/IO_RTC/0x070/; + $val =~ s/IO_TIMER1/0x040/; + $val =~ s/IO_TIMER2/0x048/; + $val =~ s/IO_UHA0/0x330/; + $val =~ s/IO_VGA/0x3C0/; + $val =~ s/IO_WD1/0x1F0/; + $val =~ s/IO_WD2/0x170/; + if ($val ne "?") { + print "hint.$name.$unit.port=\"$val\"\n"; + } + next; + } + if ($key eq "irq" || $key eq "drq" || $key eq "drive" || + $key eq "iomem" || $key eq "iosiz" || $key eq "flags"|| + $key eq "bus" || $key eq "target" || $key eq "unit") { + $key =~ s/iomem/maddr/; + $key =~ s/iosiz/msize/; + $val = shift(@rest); + if ($val ne "?") { + print "hint.$name.$unit.$key=\"$val\"\n"; + } + next; + } + print "unrecognized config token $key\n"; + } +} |