dmesg explained
By José Nazario and Natarajan Krishnaswami
Abstract
Often someone will write to a Linux help list asking for help with a particular device they want to get working under Linux, and a standard reply is "check the output of the dmesg command". This leaves a lot of new users befuddled, and this document is here to hopefully help them navigate this powerful debugging tool. Two sets of kernel boot messages are presented and annotated, from an i386 system and a Linux-Pmac system.
Introduction
The Linux kernel is the central interface between the user and the hardware. As such, it has to incorporate support for hardware if you are to use it. Often, though, cryptic device names are used by the system, making it difficult at first inspection to determine if some particular hardware is supported. The command 'dmesg', which is used to print kernel messages, is very useful in determining if a piece of hardware has been found, and if so, what the system is referring to it as.
This artcle, including the title and format of the dmesg comments, were directly inspired and copied from the OpenBSD Explained article by the same name. I felt one on Linux would be useful for people.
The manpage for dmesg is quite simple:
DMESG(8) DMESG(8) NAME dmesg - print or control the kernel ring buffer SYNOPSIS dmesg [ -c ] [ -n level ] [ -s bufsize ] DESCRIPTION dmesg is used to examine or control the kernel ring buffer.Upon boot, the dmesg output is from the kernel booting, showing the devices it has found and if it has been able to configure them at all (aside from userland configuration). This log is also available in the file /var/log/dmesg.
Kernel output on an i386 system
Shown below is a dmesg from an x86 system immediately after boot. The output is indented by several space, and comments and descriptions are left justified.
- Linux version 2.2.14-5.0 (root@porky.devel.redhat.com) (gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)) #1 Tue Mar 7 20:53:41 EST 2000
First up is the kernel version (2.2.14) and build (5), along with who built it, with what compile it was built, and when it wass built. This can be some inportant information, as some kernel versions and the GCC project don't interact correctly.
- Detected 300683434 Hz processor.
- Console: colour VGA+ 80x25
- Calibrating delay loop... 599.65 BogoMIPS
- Memory: 63008k/65536k available (1084k kernel code, 412k reserved, 968k data, 64k init, 0k bigmem)
- Dentry hash table entries: 262144 (order 9, 2048k)
- Buffer cache hash table entries: 65536 (order 6, 256k)
- Page cache hash table entries: 16384 (order 4, 64k)
- VFS: Diskquotas version dquot_6.4.0 initialized
- CPU: AMD AMD-K6(tm) 3D processor stepping 00
- Checking 386/387 coupling... OK, FPU using exception 16 error reporting.
Checking 'hlt' instruction... OK.- POSIX conformance testing by UNIFIX
PCI: PCI BIOS revision 2.10 entry at 0xfb490- PCI: Using configuration type 1
PCI: Probing PCI hardware
PCI: 00:38 [1106/0586]: Work around ISA DMA hangs (00)
Activating ISA DMA hang workarounds.
Linux NET4.0 for Linux 2.2- Based upon Swansea University Computer Society NET3.039
NET4: Unix domain sockets 1.0 for Linux NET4.0.
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP- TCP: Hash tables configured (ehash 65536 bhash 65536)
Initializing RT netlink socket
Starting kswapd v 1.5
Detected PS/2 Mouse Port.- Serial driver version 4.27 with MANY_PORTS MULTIPORT SHARE_IRQ enabled
ttyS00 at 0x03f8 (irq = 4) is a 16550A
ttyS01 at 0x02f8 (irq = 3) is a 16550A- pty: 256 Unix98 ptys configured
apm: BIOS version 1.2 Flags 0x07 (Driver version 1.9)- Real Time Clock Driver v1.09
RAM disk driver initialized: 16 RAM disks of 4096K size- VP_IDE: IDE controller on PCI bus 00 dev 39
VP_IDE: not 100% native mode: will probe irqs later
ide0: BM-DMA at 0xe000-0xe007, BIOS settings: hda:DMA, hdb:DMA
ide1: BM-DMA at 0xe008-0xe00f, BIOS settings: hdc:DMA, hdd:DMA- hda: Maxtor 51369U3, ATA DISK drive
- hdb: IDE/ATAPI CD-ROM 32X, ATAPI CDROM drive
- ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
hda: Maxtor 51369U3, 12949MB w/2048kB Cache, CHS=6577/64/63
hdb: ATAPI 16X CD-ROM drive, 128kB Cache- Uniform CDROM driver Revision: 2.56
Floppy drive(s): fd0 is 1.44M
FDC 0 is a post-1991 82077- md driver 0.90.0 MAX_MD_DEVS=256, MAX_REAL=12
raid5: measuring checksumming speed
raid5: MMX detected, trying high-speed MMX checksum routines
pII_mmx : 761.238 MB/sec
p5_mmx : 726.567 MB/sec
8regs : 447.675 MB/sec
32regs : 308.610 MB/sec
using fastest function: pII_mmx (761.238 MB/sec)- scsi : 0 hosts.
scsi : detected total.- md.c: sizeof(mdp_super_t) = 4096
Partition check:
hda: hda1 hda2 < hda5 hda6 >- autodetecting RAID arrays
autorun ...
... autorun DONE.- VFS: Mounted root (ext2 filesystem) readonly.
- Freeing unused kernel memory: 64k freed
Adding Swap: 66488k swap-space (priority -1)
ne2k-pci.c:vpre-1.00e 5/27/99 D. Becker/P. Gortmaker http://cesdis.gsfc.nasa.gov/linux/drivers/ne2k-pci.html
ne2k-pci.c: PCI NE2000 clone 'RealTek RTL-8029' at I/O 0xe800, IRQ 11.
eth0: RealTek RTL-8029 found at 0xe800, IRQ 11, 00:80:AD:41:22:10.- VFS: Disk change detected on device fd(2,0)
Kernel output on a Linux-Pmac system
And, for comparison's sake, this is the output of Linux 2.2 on a PowerPC system. Again, the dmesg output is indented and the description and comments are left justified. For this system I was using BootX, which loads the kernel into memory from within the MacOS, then completes bootstrapping it after ditching the MacOS. Options can be passed to the kernel, as you would with LILO on an Intel based PC, from within the app.
- device tree used 17860 bytes
- Total memory = 72MB; using 512kB for hash table (at c0280000)
- Linux version 2.2.6-15apmac (root@video.linuxppc.org) (gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)) #1 Mon May 31 03:54:09 EDT 1999
- PCI bus 0 controlled by bandit at f2000000
PCI bus 1 controlled by chaos at f0000000- System has 32 possible interrupts
via_calibrate_decr: decrementer_count = 100001 (600010 ticks)
Console: colour dummy device 80x25
Calibrating delay loop... 239.21 BogoMIPS- Memory: 69900k available (1532k kernel code, 2184k data, 112k init) [c0000000,c4800000]
- VFS: Diskquotas version dquot_6.4.0 initialized
POSIX conformance testing by UNIFIX
PCI: Probing PCI hardware- USB: Universal USB Driver v$Revision: 1.2 $
USB-OHCI: USB Open Host Controller Interface Driver
USB-HUBD: UUSBD Hub Driver v$Revision: 1.2 $
USB-HIDD: USB Human Interface Devices Driver v$Revision: 1.2 $
USB-HIDBP: USB HID Boot Protocol Driver v$Revision: 1.2 $
- adb devices: [2]: 2 2 [3]: 3 1
- Linux NET4.0 for Linux 2.2
Based upon Swansea University Computer Society NET3.039
NET4: Unix domain sockets 1.0 for Linux NET4.0.
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP- Starting kswapd v 1.5
MacOS display is /bandit/IMS,tt128mb8- Console: switching to colour frame buffer device 80x30
fb0: IMS TT (TVP) frame buffer; 8MB vram; chip version 2
Monitor sense value = 0x73f, using video mode 6 and color mode 0.
fb1: control display adapter- ADB mouse at 3, handler set to 4
ADB keyboard at 2, handler set to 5
PowerMac Z8530 serial driver version 1.01
tty00 at 0xc900e020 (irq = 15) is a Z8530 ESCC, port = modem
tty01 at 0xc9011000 (irq = 16) is a Z8530 ESCC, port = printer- pty: 256 Unix98 ptys configured
Macintosh ADB mouse driver installed.
DMA sound driver installed, using 4 buffers of 32k.
RAM disk driver initialized: 16 RAM disks of 4096K size
loop: registered device at major 7
fd0: SWIM3 floppy controller- md driver 0.90.0 MAX_MD_DEVS=256, MAX_REAL=12
USB-HUBM: Starting kusbdd (pid 2)
USBD: No USB hosts found
linear personality registered
raid0 personality registered
raid1 personality registered
raid5: measuring checksumming speed- 8regs : 140.970 MB/sec
32regs : 122.301 MB/sec
using fastest function: 8regs (140.970 MB/sec)
scsi0 : MESH
scsi1 : 53C94
scsi : 2 hosts.
- mesh: target 0 synchronous at 10.0 MB/s
Vendor: IBM Model: DPES-31080 Rev: S31S
Type: Direct-Access ANSI SCSI revision: 01 CCS
Detected scsi disk sda at scsi0, channel 0, id 0, lun 0
Vendor: QUANTUM Model: CTS80S Rev: 4.05
Type: Direct-Access ANSI SCSI revision: 02
Detected scsi disk sdb at scsi0, channel 0, id 1, lun 0
mesh: target 3 synchronous at 5.0 MB/s
Vendor: MATSHITA Model: CD-ROM CR-8005A Rev: 4.0i
Type: CD-ROM ANSI SCSI revision: 02
Detected scsi CD-ROM sr0 at scsi0, channel 0, id 3, lun 0
mesh: target 4 synchronous at 10.0 MB/s
Vendor: SEAGATE Model: ST31200N Rev: 8648
Type: Direct-Access ANSI SCSI revision: 02
Detected scsi disk sdc at scsi0, channel 0, id 4, lun 0
Vendor: QUANTUM Model: FIREBALL_TM2110S Rev: 300X
Type: Direct-Access ANSI SCSI revision: 02
Detected scsi disk sdd at scsi1, channel 0, id 2, lun 0
scsi : detected 1 SCSI cdrom 4 SCSI disks total.
Uniform CDROM driver Revision: 2.54
SCSI device sda: hdwr sector= 512 bytes. Sectors= 2118144 [1034 MB] [1.0 GB]
SCSI device sdb: hdwr sector= 512 bytes. Sectors= 166200 [81 MB] [0.1 GB]
SCSI device sdc: hdwr sector= 512 bytes. Sectors= 2061108 [1006 MB] [1.0 GB]
SCSI device sdd: hdwr sector= 512 bytes. Sectors= 4124736 [2014 MB] [2.0 GB]- PPP: version 2.3.3 (demand dialling)
TCP compression code copyright 1989 Regents of the University of California
PPP line discipline registered.- eth0: MACE at 00:05:02:10:e6:6d, chip revision 9.64
- Partition check:
sda: sda1 sda2 sda3 sda4 sda5 sda6
sdb: sdb1
sdc: sdc1 sdc2 sdc3 sdc4
sdd: sdd1 sdd2 sdd3 sdd4
- md.c: sizeof(mdp_super_t) = 4104
autodetecting RAID arrays
autorun ...
... autorun DONE.
VFS: Mounted root (ext2 filesystem) readonly.
Freeing unused kernel memory: 112k init 32k prep
Adding Swap: 131428k swap-space (priority -1)Concluding remarks
Like I noted above at the end of the i386 dmesg output, the kernel, once finished, then moves on to /sbin/init unless an argument poiting it elsewhere has been passed to the kernel at boot time. An example would be telling the kernel "init=/bin/sh", such that it would execute a shell upon boot, rather than /sbin/init (and what follows). Note that the kernel only mounts the root filesystem read-only, so if all you do is boot the kernel you have to mount your disks read-write in order to affect changes on them (ie editing /etc/passwd to rescue root's password).
While this isn't the most thorough of jobs, I hope that this little tour has been enjoyable for everyone, and educational.
- md.c: sizeof(mdp_super_t) = 4104
- Partition check:
- eth0: MACE at 00:05:02:10:e6:6d, chip revision 9.64
- PPP: version 2.3.3 (demand dialling)
- mesh: target 0 synchronous at 10.0 MB/s
- 8regs : 140.970 MB/sec
- md driver 0.90.0 MAX_MD_DEVS=256, MAX_REAL=12
- pty: 256 Unix98 ptys configured
- ADB mouse at 3, handler set to 4
- Console: switching to colour frame buffer device 80x30
- Starting kswapd v 1.5
- Linux NET4.0 for Linux 2.2
- adb devices: [2]: 2 2 [3]: 3 1
- USB: Universal USB Driver v$Revision: 1.2 $
- VFS: Diskquotas version dquot_6.4.0 initialized
- Memory: 69900k available (1532k kernel code, 2184k data, 112k init) [c0000000,c4800000]
- System has 32 possible interrupts
- PCI bus 0 controlled by bandit at f2000000
- Linux version 2.2.6-15apmac (root@video.linuxppc.org) (gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)) #1 Mon May 31 03:54:09 EDT 1999
- Total memory = 72MB; using 512kB for hash table (at c0280000)
- device tree used 17860 bytes
- VFS: Disk change detected on device fd(2,0)
- Freeing unused kernel memory: 64k freed
- VFS: Mounted root (ext2 filesystem) readonly.
- autodetecting RAID arrays
- md.c: sizeof(mdp_super_t) = 4096
- scsi : 0 hosts.
- md driver 0.90.0 MAX_MD_DEVS=256, MAX_REAL=12
- Uniform CDROM driver Revision: 2.56
- ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
- hdb: IDE/ATAPI CD-ROM 32X, ATAPI CDROM drive
- hda: Maxtor 51369U3, ATA DISK drive
- VP_IDE: IDE controller on PCI bus 00 dev 39
- Real Time Clock Driver v1.09
- pty: 256 Unix98 ptys configured
- Serial driver version 4.27 with MANY_PORTS MULTIPORT SHARE_IRQ enabled
- TCP: Hash tables configured (ehash 65536 bhash 65536)
- Based upon Swansea University Computer Society NET3.039
- PCI: Using configuration type 1
- POSIX conformance testing by UNIFIX
- Checking 386/387 coupling... OK, FPU using exception 16 error reporting.
- CPU: AMD AMD-K6(tm) 3D processor stepping 00
- VFS: Diskquotas version dquot_6.4.0 initialized
- Page cache hash table entries: 16384 (order 4, 64k)
- Buffer cache hash table entries: 65536 (order 6, 256k)
- Dentry hash table entries: 262144 (order 9, 2048k)
- Memory: 63008k/65536k available (1084k kernel code, 412k reserved, 968k data, 64k init, 0k bigmem)
- Calibrating delay loop... 599.65 BogoMIPS
- Console: colour VGA+ 80x25
- Detected 300683434 Hz processor.