Re: Finding System.map (was:Re: Kernel Profiling???? Please explain...)

Hans Lermen (lermen@elserv.ffm.fgan.de)
Sun, 3 Nov 1996 21:42:45 +0100 (MET)


On Sun, 3 Nov 1996, Robert Wuest wrote:
> Two questions:
>
> 1. Is there a standard way to get the exact uname info
> from an unbooted kernel image so I know what VEXT is
> before rebooting ( to install System.map-xxxx)? I can
> find the string in my /usr/src/linux/vmlinux file.

Yes. The full kernel version string is accessable via the setup-header
of the (b)zImage. The below entry for /etc/magic shows you how to find it:

0x202 string HdrS Linux/i386 Kernel
>0x206 short 0x0105 setupV1 zImage
>0x206 short 0x0200 setupV2
>>0x211 byte 0 zImage
>>0x211 byte 1 bzImage
>(0x20e.s+0x200) string >\0 "%6.6s"

If you have this entry in /etc/magic, 'file /vmlinuz' should display
what you need.

>
> 2. Is there a way to know what boot image was booted
> in a running system? I could just run the kernel image
> through md5sum to get an extension.

Yes:

cat /proc/cmdline

The variable BOOT_IMAGE= is set by the loader.
When using LILO it tells you the 'label', so you can scan /etc/lilo.conf
for the image that belongs to this label.
When using LOADLIN it tells you the base name of the image file.

Hans
<lermen@fgan.de>