Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Aug 1999 10:03:51 -0600
From:      Warner Losh <imp@village.org>
To:        "Matthew N. Dodd" <winter@jurai.net>
Cc:        Peter Wemm <peter@netplex.com.au>, Cameron Grant <gandalf@vilnya.demon.co.uk>, multimedia@FreeBSD.ORG, current@FreeBSD.ORG
Subject:   Re: it's time... 
Message-ID:  <199908111603.KAA17583@harmony.village.org>
In-Reply-To: Your message of "Wed, 11 Aug 1999 11:34:56 EDT." <Pine.BSF.4.10.9908111129380.14648-100000@sasami.jurai.net> 
References:  <Pine.BSF.4.10.9908111129380.14648-100000@sasami.jurai.net>  

next in thread | previous in thread | raw e-mail | index | archive | help
In message <Pine.BSF.4.10.9908111129380.14648-100000@sasami.jurai.net> "Matthew N. Dodd" writes:
: On Tue, 10 Aug 1999, Warner Losh wrote:
: > I'd be very careful of line wrapping probe messages.  I have scripts
: > that rely on them being on one line to get a list of irqs, etc.
: 
: I would consider information from the kernel probe/attach to be useful
: only for humans.

Then we disagree.  There are several scripts floating around that use
them for purposes where there isn't a kernel interface...  It would be
ideal if there were interfaces for all this info, but there isn't
always.

: An interface to query the resource manager directly is likely to be a
: better solution to your problem.

Well, only kinda.  That was one example.  The other example is finding
out what the ide driver thought the disk geometry of a disk was...

: Besides, if your perl skills aren't able to cope with getting all 'fooX:'
: lines, and stripping out the 'fooX:' bits before parsing then you have
: other problems.

Hah!  You presume too much.  None of these scripts are written in
perl, so the size of my perl schl*** isn't at issue here :-) You also
assume that the wrapping would be of the form fooX:.  FreeBSD's boot
messages aren't consistant about this right now, witness the
difference between isa and pci devices:

sio1 at port 0x2f8-0x2ff irq 3 on isa0
sio1: type 16550A

vs

ahc0: <Adaptec 2940 Ultra SCSI adapter> irq 10 at device 16.0 on pci0
ahc0: aic7880 Wide Channel A, SCSI Id=7, 16/255 SCBs

The "proper" way to do this would be

sio1 at isa0 port 0x2f8-0x2ff irq 3: type 16550A
ahc0 at pci0 irq 10 device 16.0: <Adaptec 2940 Ultra SCSI adapter>
ahc0: aic7880 Wide Channel A, SCSI Id=7, 16/255 SCBs

if you must introduce wrapping.  Each phrase should either fit on the
current line or be bumped to the next line.  However, what is a line?

Also, I use "proper" in quotes because others will reasonably differ
with the exact details...

: Correct, but the nature of the kernel probe/attach messages is to convey
: information in a readable, consistent, useful manner.

Agreed.  However, what's magical about 80 columns?  My editors go out
to 180 sometimes.  The console can easily be placed into a mode where
it is > 80.  This is especially true for the serial console where it
might be connected to a 132 column printer.

: If we didn't want pretty line wrapping we'd all be using linux and have
: stupid stuff like copyright messages as well.  :)

Don't even get me started on linux' boot messages. :-)

I happen to like the stark elegance of the OpenBSD/NetBSD boot
messages.  Here's the entire dmesg from the boot of my rPC44 MIPS
machine when booted under OpenBSD.

Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-1999 OpenBSD. All rights reserved.
http://www.OpenBSD.org

OpenBSD 2.4-current (IMP-PCCARD) #37: Mon Feb  1 13:28:06 MST 1999
    imp@local-service.village.org:/home/imp/src/sys/arch/arc/compile/IMP-PCCARD
real mem = 32235520
avail mem = 27754496
using 419 buffers containing 1716224 bytes of memory
mainbus0 (root)
cpu0 at mainbus0: MIPS R4400 CPU Rev. 4.0 with MIPS R4010 FPC Rev. 0.0
    L1 Cache I size 16kb(16 line), D size 16kb(16 line), direct mapped.
    L2 cache doesn't snoop uncached cpu accesses.
isabr0 at mainbus0
isa0 at isabr0 isa_io_base 0xb0000000 isa_mem_base 0xa0000000
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16450, no fifo
com1 at isa0 port 0x2f8-0x2ff irq 3: ns16450, no fifo
wdc0 at isa0 port 0x1f0-0x1f7 irq 14
wd0 at wdc0 drive 0: <SAMSUNG WN321620A (2.16 GB)>
wd0: 2060MB, 4186 cyl, 16 head, 63 sec, 512 bytes/sec, 4219488 sec total
wd0: using 16-sector 16-bit pio transfers, lba addressing (109KB cache)
clock0 at isa0 port 0x70-0x6d5 irq 0: mc146818 or compatible
pcprobe: reset error 1
pc0 at isa0 port 0x60-0x6c5 irq 1: color
joy0 at isa0 port 0x201: joystick not connected
ed0 at isa0 port 0x300-0x31f irq 5: address 00:00:1b:1e:52:a7, type NE2000 (16-bit)
boot device: wd0.
root on wd0a
rootdev=0x400 rrootdev=0x1200 rawdev=0x1202

Where OpenBSD has

com0 at isa0 port 0x3f8-0x3ff irq 4: ns16450, no fifo
com1 at isa0 port 0x2f8-0x2ff irq 3: ns16450, no fifo

FreeBSD we has

sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
sio0: type 16550A
sio1 at port 0x2f8-0x2ff irq 3 on isa0
sio1: type 16550A
sio2: configured irq 5 not in bitmap of probed irqs 0
sio3: configured irq 9 not in bitmap of probed irqs 0

which is much more verbose.  The entire boot process (including rc
output) fits on the 48x132 mode that my rPC/44 comes up in.  With the
same config on FreeBSD, the kernel messages it wouldn't even fit, let
alone the rc output.

: At some point all of the boot messages should be wrapped by 'if
: (bootverbose) { ... }' anyway.

No!  At some point they should use a facility similar to solaris/sysv
where they don't display, but do make it into the dmesg buffer...

Warner


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199908111603.KAA17583>