summaryrefslogtreecommitdiffstats
path: root/sys/pc98/conf
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2000-06-13 22:28:50 +0000
committerpeter <peter@FreeBSD.org>2000-06-13 22:28:50 +0000
commit647ef85d48424b2f17b827cdc91e595b17c66455 (patch)
tree356af9076580e616e17aaffdac3db15319e62b95 /sys/pc98/conf
parentc859e3ccfbf4963472ba1374f7ea67b524d43395 (diff)
downloadFreeBSD-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/pc98/conf')
-rw-r--r--sys/pc98/conf/GENERIC190
-rw-r--r--sys/pc98/conf/GENERIC.hints70
-rw-r--r--sys/pc98/conf/gethints.pl87
3 files changed, 279 insertions, 68 deletions
diff --git a/sys/pc98/conf/GENERIC b/sys/pc98/conf/GENERIC
index 38f871b..5ecef77 100644
--- a/sys/pc98/conf/GENERIC
+++ b/sys/pc98/conf/GENERIC
@@ -25,6 +25,8 @@ cpu I686_CPU
ident GENERIC
maxusers 32
+hints "GENERIC.hints"
+
#makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols
options PC98 #PC98
@@ -72,18 +74,10 @@ options COMPAT_OLDISA # Old ISA driver shims
options COMPAT_OLDPCI # Old PCI driver shims
# Floppy drives
-device fdc0 at isa? port IO_FD1 irq 11 drq 2
-device fd0 at fdc0 drive 0
-device fd1 at fdc0 drive 1
-device fd2 at fdc0 drive 2
-device fd3 at fdc0 drive 3
+device fdc
# IDE controller and disks
-device wdc0 at isa? port IO_WD1 irq 9
-device wd0 at wdc0 drive 0
-#device wd1 at wdc0 drive 1
-#device wd2 at wdc0 drive 2
-#device wd3 at wdc0 drive 3
+device wdc
# ATAPI devices on wdc
device wcd #IDE CD-ROM
@@ -104,21 +98,48 @@ device sym # NCR/Symbios Logic (newer chipsets)
options BS_TARG_SAFEMODE
+device bs
# PC-9801-92
-device bs0 at isa? port IO_SCSI irq 5 drq 3 flags 0
+#hint.bs.0.at="isa"
+#hint.bs.0.port="0xCC0"
+#hint.bs.0.irq="5"
+#hint.bs.0.drq="3"
+#hint.bs.0.flags="0"
# SC-98
-# device bs0 at isa? port IO_SCSI irq 5 drq 3 flags 0x10000
+#hint.bs.0.at="isa"
+#hint.bs.0.port="0xCC0"
+#hint.bs.0.irq="5"
+#hint.bs.0.drq="3"
+#hint.bs.0.flags="0x10000"
# HA-55BS2 and later
-#device bs0 at isa? port IO_SCSI irq 5 drq 3 flags 0x20000
+#hint.bs.0.at="isa"
+#hint.bs.0.port="0xCC0"
+#hint.bs.0.irq="5"
+#hint.bs.0.drq="3"
+#hint.bs.0.flags="0x20000"
# ELECOM type
-#device bs0 at isa? port IO_SCSI irq 5 drq 3 flags 0x30000
+#hint.bs.0.at="isa"
+#hint.bs.0.port="0xCC0"
+#hint.bs.0.irq="5"
+#hint.bs.0.drq="3"
+#hint.bs.0.flags="0x30000"
# SMIT
-#device bs0 at isa? port IO_SCSI irq 5 drq 3 iomem 0xdd000 iosiz 0x1000 flags 0x40000
+#hint.bs.0.at="isa"
+#hint.bs.0.port="0xCC0"
+#hint.bs.0.irq="5"
+#hint.bs.0.drq="3"
+#hint.bs.0.iomem="0xdd000"
+#hint.bs.0.iosiz="0x1000"
+#hint.bs.0.flags="0x40000"
# Logitec LHA-20x
-#device bs0 at isa? port IO_SCSI irq 5 drq 3 flags 0x50000
+#hint.bs.0.at="isa"
+#hint.bs.0.port="0xCC0"
+#hint.bs.0.irq="5"
+#hint.bs.0.drq="3"
+#hint.bs.0.flags="0x50000"
# PC-9801-100
-device aic0 at isa? port 0x1840 irq 5 flags 0x10000
+device aic
# SCSI peripherals
device scbus # SCSI bus (required)
@@ -133,59 +154,92 @@ device amr # AMI MegaRAID
device mlx # Mylex DAC960 family
# keyboard driver
-device pckbd0 at isa? port IO_KBD irq 1
+device pckbd
-device gdc0 at isa?
+device gdc
# 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
# Floating point support - do not disable.
-device npx0 at nexus? port IO_NPX irq 8
+device npx
# Power management support (see LINT for more options)
-#device apm0 at nexus? disable flags 0x20 # Advanced Power Management
+#device apm
# PCCARD (PCMCIA) support
device card
-device pcic0 at isa? irq 6 port 0x3e0
+device pcic
# Serial (COM) ports
#
options COM_MULTIPORT
#
# COM1
-device sio0 at isa? port IO_COM1 irq 4
+device sio
# COM2 (2nd CCU)
-device sio1 at isa? port 0x238 irq 5 flags 0x12000010
+#hint.sio.1.at="isa"
+#hint.sio.1.port="0x238"
+#hint.sio.1.irq="5"
+#hint.sio.1.flags="0x12000010"
# PC-9861K, PC-9801-101, MDC-926Rs
-#device sio1 at isa? port IO_COM2 irq 5 flags 0x01000000
-#device sio2 at isa? port IO_COM3 irq 6 flags 0x02000000
+#hint.sio.1.at="isa"
+#hint.sio.1.port="0x0B1"
+#hint.sio.1.irq="5"
+#hint.sio.1.flags="0x01000000"
+#hint.sio.2.at="isa"
+#hint.sio.2.port="0x0B9"
+#hint.sio.2.irq="6"
+#hint.sio.2.flags="0x02000000"
# PC-9801-120 (PnP off)
-#device sio1 at isa? port 0x8b0 irq 5 flags 0x11000000
+#hint.sio.1.at="isa"
+#hint.sio.1.port="0x8b0"
+#hint.sio.1.irq="5"
+#hint.sio.1.flags="0x11000000"
# MC-16550II, MC-RS98
-#device sio1 at isa? port 0xd2 irq 5 flags 0x14000101
-#device sio2 at isa? port 0x8d2 flags 0x14000101
+#hint.sio.1.at="isa"
+#hint.sio.1.port="0xd2"
+#hint.sio.1.irq="5"
+#hint.sio.1.flags="0x14000101"
+#hint.sio.2.at="isa"
+#hint.sio.2.port="0x8d2"
+#hint.sio.2.flags="0x14000101"
# RSB-2000, RSB-3000, B98-02
-#device sio1 at isa? port 0xb0 flags 0x15000101
-#device sio2 at isa? port 0xb1 flags 0x15000101
+#hint.sio.1.at="isa"
+#hint.sio.1.port="0xb0"
+#hint.sio.1.flags="0x15000101"
+#hint.sio.2.at="isa"
+#hint.sio.2.port="0xb1"
+#hint.sio.2.flags="0x15000101"
# RSB-384
-#device sio1 at isa? port 0xb0 flags 0x16000000
-#device sio2 at isa? port 0xb1 flags 0x16000000
+#hint.sio.1.at="isa"
+#hint.sio.1.port="0xb0"
+#hint.sio.1.flags="0x16000000"
+#hint.sio.2.at="isa"
+#hint.sio.2.port="0xb1"
+#hint.sio.2.flags="0x16000000"
# RSA-98III
-#device sio1 at isa? port 0x50e0 irq 5 flags 0x18000101
-#device sio2 at isa? port 0x51e0 flags 0x18000101
+#hint.sio.1.at="isa"
+#hint.sio.1.port="0x50e0"
+#hint.sio.1.irq="5"
+#hint.sio.1.flags="0x18000101"
+#hint.sio.2.at="isa"
+#hint.sio.2.port="0x51e0"
+#hint.sio.2.flags="0x18000101"
# ESP98
#options COM_ESP
-#device sio1 at isa? port 0x18b0 irq 5 flags 0x19000000
+#hint.sio.1.at="isa"
+#hint.sio.1.port="0x18b0"
+#hint.sio.1.irq="5"
+#hint.sio.1.flags="0x19000000"
-device mse0 at isa? port IO_MSE irq 13
+device mse
# NEW Parallel port
-device ppc0 at isa? irq 14
+device ppc
device ppbus # Parallel port bus (required)
device lpt # Printer
device plip # TCP/IP over parallel
@@ -193,7 +247,7 @@ device ppi # Parallel port interface device
#device vpo # Requires scbus and da
# OLD Parallel port
# Please stay olpt driver after ppc driver
-device olpt0 at isa? port IO_LPT
+device olpt
# PCI Ethernet NICs.
@@ -232,6 +286,7 @@ device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'')
# ed10: EC/EP-98X
# ed11: SIU-98-D
#
+# XXX convert to hints
#device ed0 at isa? port 0x00d0 irq 6
##device ed0 at isa? port 0x10d0 irq 6 iomem 0xc8000 # SMC EtherEZ98
#device ed5 at isa? port 0x00d0 irq 6 iomem 0xd0000 iosiz 16384 flags 0x600000
@@ -254,11 +309,10 @@ device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'')
# FE_8BIT_SUPPORT is needed to support LAC-98
#
options FE_8BIT_SUPPORT # LAC-98 support
-device fe0 at isa? port 0x00d0 irq 3
-device fe1 at isa? port 0x73d0 irq 5
+device fe
-device ep0 at isa? port 0x40d0 irq 3
-device lnc0 at isa? port 0x03d0 irq 6
+device ep
+device lnc
device sn
# WaveLAN/IEEE 802.11 wireless NICs. Note: the WaveLAN/IEEE really
@@ -278,41 +332,41 @@ device xe
#device snd
-#device sb0 at isa? port 0x20d2 irq 10 drq 3
-#device sbxvi0 at isa? drq 3
-#device sbmidi0 at isa? port 0x80d2
-#device opl0 at isa? port 0x28d2
-#device nss0 at isa? port 0xa460 irq 12
-#device mss0 at isa? port 0xf40 irq 12 drq 1
-#device mpu0 at isa? port 0xe0d0 irq 6
+#device sb
+#device sbxvi
+#device sbmidi
+#device opl
+#device nss
+#device mss
+#device mpu
-#device joy0 at isa? port 0x04d2
+#device joy
# The newpcm driver (use INSTEAD of snd0 and all VOXWARE drivers!).
#
# Windows Sound System
-#device pcm0 at isa? port 0xf40 irq 12 drq 1 flags 0x10000
+#device pcm
#
# Sound Blaster 16 (This device need the bridge driver.)
#device pcm
-#device sbc0 at isa? port 0x20d2 irq 10 drq 3
+#device sbc
# Pseudo devices - the number indicates how many units to allocated.
-pseudo-device loop # Network loopback
-pseudo-device ether # Ethernet support
-pseudo-device sl 1 # 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 1 # 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
-#pseudo-device compat_atdisk #IBM-PC HDD support
+#device compat_atdisk #IBM-PC HDD support
# USB support
#device uhci # UHCI PCI->USB interface
diff --git a/sys/pc98/conf/GENERIC.hints b/sys/pc98/conf/GENERIC.hints
new file mode 100644
index 0000000..baaa737
--- /dev/null
+++ b/sys/pc98/conf/GENERIC.hints
@@ -0,0 +1,70 @@
+# $FreeBSD$
+hint.fdc.0.at="isa"
+hint.fdc.0.port="0x090"
+hint.fdc.0.irq="11"
+hint.fdc.0.drq="2"
+hint.fd.0.at="fdc0"
+hint.fd.0.drive="0"
+hint.fd.1.at="fdc0"
+hint.fd.1.drive="1"
+hint.fd.2.at="fdc0"
+hint.fd.2.drive="2"
+hint.fd.3.at="fdc0"
+hint.fd.3.drive="3"
+hint.wdc.0.at="isa"
+hint.wdc.0.port="0x640"
+hint.wdc.0.irq="9"
+hint.wd.0.at="wdc0"
+hint.wd.0.drive="0"
+#hint.wd.1.at="wdc0"
+#hint.wd.1.drive="1"
+#hint.wd.2.at="wdc0"
+#hint.wd.2.drive="2"
+#hint.wd.3.at="wdc0"
+#hint.wd.3.drive="3"
+hint.bs.0.at="isa"
+hint.bs.0.port="0xCC0"
+hint.bs.0.irq="5"
+hint.bs.0.drq="3"
+hint.bs.0.flags="0"
+hint.aic.0.at="isa"
+hint.aic.0.port="0x1840"
+hint.aic.0.irq="5"
+hint.aic.0.flags="0x10000"
+hint.pckbd.0.at="isa"
+hint.pckbd.0.port="0x041"
+hint.pckbd.0.irq="1"
+hint.gdc.0.at="isa"
+hint.sc.0.at="isa"
+hint.npx.0.at="nexus"
+hint.npx.0.port="0x0F8"
+hint.npx.0.irq="8"
+hint.pcic.0.at="isa"
+hint.pcic.0.irq="6"
+hint.pcic.0.port="0x3e0"
+hint.sio.0.at="isa"
+hint.sio.0.port="0x030"
+hint.sio.0.irq="4"
+hint.sio.1.at="isa"
+hint.sio.1.port="0x238"
+hint.sio.1.irq="5"
+hint.sio.1.flags="0x12000010"
+hint.mse.0.at="isa"
+hint.mse.0.port="0x7FD9"
+hint.mse.0.irq="13"
+hint.ppc.0.at="isa"
+hint.ppc.0.irq="14"
+hint.olpt.0.at="isa"
+hint.olpt.0.port="0x040"
+hint.fe.0.at="isa"
+hint.fe.0.port="0x00d0"
+hint.fe.0.irq="3"
+hint.fe.1.at="isa"
+hint.fe.1.port="0x73d0"
+hint.fe.1.irq="5"
+hint.ep.0.at="isa"
+hint.ep.0.port="0x40d0"
+hint.ep.0.irq="3"
+hint.lnc.0.at="isa"
+hint.lnc.0.port="0x03d0"
+hint.lnc.0.irq="6"
diff --git a/sys/pc98/conf/gethints.pl b/sys/pc98/conf/gethints.pl
new file mode 100644
index 0000000..d5990d0
--- /dev/null
+++ b/sys/pc98/conf/gethints.pl
@@ -0,0 +1,87 @@
+#! /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_A20CT/0x0F6/;
+ $val =~ s/IO_A2OEN/0x0F2/;
+ $val =~ s/IO_BEEPF/0x3FDB/;
+ $val =~ s/IO_BMS/0x7FD9/;
+ $val =~ s/IO_CGROM/0x0A1/;
+ $val =~ s/IO_COM1/0x030/;
+ $val =~ s/IO_COM2/0x0B1/;
+ $val =~ s/IO_COM3/0x0B9/;
+ $val =~ s/IO_DMA/0x001/;
+ $val =~ s/IO_DMAPG/0x021/;
+ $val =~ s/IO_EGC/0x4A0/;
+ $val =~ s/IO_FD1/0x090/;
+ $val =~ s/IO_FD2/0x0C8/;
+ $val =~ s/IO_FDPORT/0x0BE/;
+ $val =~ s/IO_GDC1/0x060/;
+ $val =~ s/IO_GDC2/0x0A0/;
+ $val =~ s/IO_ICU1/0x000/;
+ $val =~ s/IO_ICU2/0x008/;
+ $val =~ s/IO_KBD/0x041/;
+ $val =~ s/IO_LPT/0x040/;
+ $val =~ s/IO_MOUSE/0x7FD9/;
+ $val =~ s/IO_MOUSETM/0xDFBD/;
+ $val =~ s/IO_MSE/0x7FD9/;
+ $val =~ s/IO_NMI/0x050/;
+ $val =~ s/IO_NPX/0x0F8/;
+ $val =~ s/IO_PPI/0x035/;
+ $val =~ s/IO_REEST/0x0F0/;
+ $val =~ s/IO_RTC/0x020/;
+ $val =~ s/IO_SASI/0x080/;
+ $val =~ s/IO_SCSI/0xCC0/;
+ $val =~ s/IO_SIO1/0x0D0/;
+ $val =~ s/IO_SIO2/0x8D0/;
+ $val =~ s/IO_SOUND/0x188/;
+ $val =~ s/IO_SYSPORT/0x031/;
+ $val =~ s/IO_TIMER1/0x071/;
+ $val =~ s/IO_WAIT/0x05F/;
+ $val =~ s/IO_WD1/0x640/;
+ $val =~ s/IO_WD1_EPSON/0x80/;
+ $val =~ s/IO_WD1_NEC/0x640/;
+ 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";
+ }
+}
OpenPOWER on IntegriCloud