From: "Eric S. Raymond" <esr@thyrsus.com>
To: Linux Kernel List <linux-kernel@vger.kernel.org>
Cc: Linus Torvalds <torvalds@transmeta.com>
Subject: ISA hardware discovery -- the elegant solution
Date: Sun, 13 Jan 2002 20:58:39 -0500 [thread overview]
Message-ID: <20020113205839.A4434@thyrsus.com> (raw)
I've been thinking about the hardware-discovery problem for ISA devices,
and there may be an elegant solution. It will take a number of small changes
to the kernel sources, however.
The kernel's device drivers have, of course, to include probe
routines, and those hard-compiled in typically log the presence of
their hardware to /var/log/mesg when it loads. By scanning that
file, we in effect get to use those probes.
My autoconfigurator's probe table now has a small number of tests than
do regexp matches against the dmesg log. As is, this solution does not
scale well, because each regexp has to be discovered by eyeball and then
maintained in the table by hand.
But suppose the format of boot-time driver messages were standardized in a
format that included their config symbol in a discoverable form?
I have hand-edited a copy of my current /var/log/dmesg to illustrate
how I think this could work.
:MTRR: your CPUs had inconsistent fixed MTRR settings
:MTRR: probably your BIOS does not setup all CPUs
:PCI: PCI BIOS revision 2.10 entry at 0xfd7c0, last bus=1
:PCI: Using configuration type 1
:PCI: Probing PCI hardware
BIOS disabled PCI ordering compliance, so we enabled it again.
:IO_APIC: AMD Errata #22 may be present. In the event of instability try
: booting with the "noapic" option.
:NET: Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
:RTNETLINK: Initializing RT netlink socket
Starting kswapd
allocated 32 pages and 32 bhs reserved for the highmem bounces
:JBD: Journalled Block Device driver loaded
:UNIX_PTY: 2048 Unix98 ptys configured
block: 128 slots per queue, batch=32
:IDE: Uniform Multi-Platform E-IDE driver Revision: 6.31
:IDE: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
:SCSI: SCSI subsystem driver Revision: 1.00
scsi0 : Adaptec AIC7XXX EISA/VLB/PCI SCSI HBA DRIVER, Rev 6.2.4
<Adaptec aic7899 Ultra160 SCSI adapter>
aic7899: Ultra160 Wide Channel A, SCSI Id=7, 32/253 SCBs
scsi1 : Adaptec AIC7XXX EISA/VLB/PCI SCSI HBA DRIVER, Rev 6.2.4
<Adaptec aic7899 Ultra160 SCSI adapter>
aic7899: Ultra160 Wide Channel B, SCSI Id=7, 32/253 SCBs
Vendor: IBM-PSG Model: ST318451LW !# Rev: B833
Type: Direct-Access ANSI SCSI revision: 03
Vendor: IBM-PSG Model: ST318451LW !# Rev: B833
Type: Direct-Access ANSI SCSI revision: 03
Vendor: HP Model: C5683A Rev: C005
Type: Sequential-Access ANSI SCSI revision: 02
scsi0:A:0:0: Tagged Queuing enabled. Depth 253
scsi0:A:1:0: Tagged Queuing enabled. Depth 253
Vendor: PIONEER Model: DVD-ROM DVD-305 Rev: 1.00
Type: CD-ROM ANSI SCSI revision: 02
Vendor: PLEXTOR Model: CD-R PX-W1210S Rev: 1.02
Type: CD-ROM ANSI SCSI revision: 02
Attached scsi disk sda at scsi0, channel 0, id 0, lun 0
Attached scsi disk sdb at scsi0, channel 0, id 1, lun 0
(scsi0:A:0): 160.000MB/s transfers (80.000MHz DT, offset 63, 16bit)
SCSI device sda: 35548320 512-byte hdwr sectors (18201 MB)
Partition check:
sda: sda1 sda2 < sda5 >
(scsi0:A:1): 160.000MB/s transfers (80.000MHz DT, offset 63, 16bit)
SCSI device sdb: 35548320 512-byte hdwr sectors (18201 MB)
sdb: sdb1 sdb2
Attached scsi CD-ROM sr0 at scsi1, channel 0, id 0, lun 0
Attached scsi CD-ROM sr1 at scsi1, channel 0, id 1, lun 0
(scsi1:A:0): 20.000MB/s transfers (20.000MHz, offset 16)
:BLK_DEV_SR: scsi3-mmc drive: 16x/40x cd/rw xa/form2 cdda tray
Uniform CD-ROM driver Revision: 3.12
(scsi1:A:1): 20.000MB/s transfers (20.000MHz, offset 16)
:BLK_DEV_SR: scsi3-mmc drive: 32x/32x writer cd/rw xa/form2 cdda tray
:USB_DEVFS: registered new driver usbdevfs
:USB: registered new driver hub
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 16384 buckets, 128Kbytes
TCP: Hash tables configured (established 262144 bind 65536)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
kjournald starting. Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem) readonly.
Freeing unused kernel memory: 96k freed
Adding Swap: 1807272k swap-space (priority -1)
:EXT3_FS: FS 2.4-0.9.16, 02 Dec 2001 on sd(8,5), internal journal
:BLK_DEV_MD: md driver 0.90.0 MAX_MD_DEVS=256, MD_SB_DISKS=27
kjournald starting. Commit interval 5 seconds
:EXT3_FS: FS 2.4-0.9.16, 02 Dec 2001 on sd(8,1), internal journal
EXT3-fs: mounted filesystem with ordered data mode.
kjournald starting. Commit interval 5 seconds
:EXT3_FS: FS 2.4-0.9.16, 02 Dec 2001 on sd(8,18), internal journal
EXT3-fs: mounted filesystem with ordered data mode.
:BLK_DEV_ST: Version 20011103, bufsize 32768, wrt 30720, max init. bufs 4, s/g segs 16
Attached scsi tape st0 at scsi0, channel 0, id 2, lun 0
The convention I propose is that at least one line of a driver probe message
should begin with :, followed by the driver config symbol, followed by :.
I am not attached to that particular punctuation, it is simply an unambiguous
way of indicating "this is a config symbol".
With this change, generating a report on ISA hardware and other
facilities configured in at boot time would be trivial. This would
make the autoconfigurator much more capable. Best of all, the only
change required to accomplish this would be safe edits of print format
strings.
I would be willing to generate a patch to implement this change.
--
<a href="http://www.tuxedo.org/~esr/">Eric S. Raymond</a>
To stay young requires the unceasing cultivation of the ability to
unlearn old falsehoods.
-- Lazarus Long
next reply other threads:[~2002-01-14 2:14 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-14 1:58 Eric S. Raymond [this message]
2002-01-14 2:54 ` ISA hardware discovery -- the elegant solution Larry McVoy
2002-01-14 8:46 ` Eric W. Biederman
2002-01-14 8:48 ` Eric S. Raymond
2002-01-14 9:17 ` H. Peter Anvin
2002-01-14 17:34 ` Eric W. Biederman
-- strict thread matches above, loose matches on Subject: below --
2002-01-14 8:03 Zwane Mwaikambo
2002-01-14 9:44 ` Alan Cox
2002-01-14 14:00 ` Zwane Mwaikambo
[not found] <fa.dardpev.1m1emjp@ifi.uio.no>
2002-01-14 10:14 ` Giacomo Catenazzi
2002-01-14 16:16 ` Eric S. Raymond
2002-01-14 16:38 ` Giacomo Catenazzi
2002-01-14 16:34 ` Eric S. Raymond
2002-01-14 17:48 ` Alan Cox
2002-01-14 17:55 ` Mr. James W. Laferriere
2002-01-14 18:08 ` Alan Cox
2002-01-14 17:59 ` Eric S. Raymond
2002-01-14 18:35 ` Alan Cox
2002-01-14 11:17 Michael Lazarou (ETL)
2002-01-14 16:11 ` Eric S. Raymond
2002-01-14 16:59 ` Eli Carter
2002-01-14 17:11 ` Wichert Akkerman
2002-01-14 18:33 ` Oliver Xymoron
2002-01-14 23:02 ` Tom Gilbert
2002-01-14 18:58 ` Andrew Pimlott
[not found] <fa.r42lgsv.1b5e3p9@ifi.uio.no>
2002-01-14 12:30 ` Giacomo Catenazzi
2002-01-14 14:25 Michael Lazarou (ETL)
2002-01-14 14:47 ` Giacomo Catenazzi
2002-01-14 18:36 Stephen Shirley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020113205839.A4434@thyrsus.com \
--to=esr@thyrsus.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox