LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-03-2003, 02:51 AM   #1
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Kernel images and System.map


I've been poking around with recompiling my kernel, and ran into something that confuses me.

What is the importance of the System.map file and is there a way to specify using a different one (for instance, instead of /boot/System.map use /boot/System.map-2.4.18-15)?

I'm using Red Hat 8.0 with GRUB as the boot loader. The contents of the boot directory contain the kernel images for two Red Hat-install-provided kernel images:
vmlinuz-2.4.18-14smp
vmlinuz-2.4.18-14

It also contains two System.map files:
System.map-2.4.18-14smp
System.map-2.4.18-14

And finally, two similarly named initrd files:
initrd-2.4.18-14smp
initrd-2.4.18-14

There is a symbolic link pointing to the smp versions of the files:
vmlinuz -> vmlinuz-2.4.18-14smp
System.map -> System.map-2.4.18-14smp

So far, I'm ok. The confusion comes when I look at the grub.conf file. Each option contains only four lines:
title <menu option title>
root (hd0,0)
kernel <appropriate image; not using symlink> ro root=LABEL=/ hdd=ide-scsi
initrd <appropriate image>

If I choose to boot the non-smp kernel, how does the kernel know to use the non-smp System.map file? The two System.map files I mentioned before are different, confirmed with a simple diff command. Is it possible the initial RAM disk provides the appropriate symlink?

The reason I ask is I'd like to recompile the kernel. The only thing I can't figure out is the vmlinuz-to-System.map connection. It's trivial to add these lines to the grub.conf:
title Custom Kernel: 2.4.18-15
root (hd0,0)
kernel /vmlinuz-2.4.18-15

At least, I think that's all I'd need, but I don't know what option, if any, to give the kernel for the appropriate SYstem.map file.

Am I making this too complicated?
 
Old 02-03-2003, 04:22 AM   #2
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
Well basically the System.map file is a symbol tabel which is used by the klogd. Your kernel will still boot without it(or the wrong one) but it will generate a lot of warning messages.
Normally if you have just one kernel then just having the file /boot/System.map is enough. Everytime you compile the kernel a new System.map file is generated which should also be copied to the /boot directory.
The problem is however when you have multiple kernels to choose from. Then just one System.map file is not enough. Now according to the klogd manpages the System.map file will be searched for in the following locations.

/boot/System.map
/System.map
/usr/src/linux/System.map

What is however not documeted in the man pages is that it will also search for a filename appended with the version. So after compiling your kernel you should copy the System.map file to the boot directory and append it with the version name. Something like "System.map-2.4.20"
 
Old 02-03-2003, 11:17 AM   #3
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Original Poster
Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Bingo!

Alright, that's what I was looking for. I had no idea the kernel version would be appended to the file name. Thank you very much. Now I can get on with my kernel experimentation.

As a side note, since the version is appended, what was the purpose behind the symlinks to the smp vmlinuz and System.map files? Just a convenience for users? It's not a big deal... just curious.
 
Old 02-03-2003, 11:26 AM   #4
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
Well they have two kernels there with the same version, one with smp support and one without. So they will also need two System.map files. I guess the symlink to the System.map-2.4.18-14smp file is there if it can't find it's symbols in the System.map-2.4.18-14 file because it's the wrong version then it can always still look in the System.map file.

Anyways I searched around a bit and this document seems to describe the whole thing pretty well:
http://www.dirac.org/linux/systemmap.html
 
Old 02-03-2003, 11:58 AM   #5
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Original Poster
Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Ah... more reading material

Cool, I'll take a look at it in a minute or two.

Once you pointed out they had the same version, I had to shake my head, because I'd overlooked that... Of course there would have to be something to differentiate them.

I'll take a look at the doc, and if you're lucky, I'll have other questions... kidding... just kidding!

Thanks for the info... I'm in your debt.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Compilling a new kernel, System.map and modules mimithebrain Linux - General 2 10-22-2005 06:07 PM
Compile kernel: System.map? iaMMai Linux - Newbie 9 05-19-2005 09:05 AM
Kernel System.map Scorched Linux - Newbie 4 03-02-2004 06:48 PM
Custom Kernel and System.map tmoorman Linux - Software 6 10-23-2003 05:12 PM
Custom kernel and System.map tmoorman Mandriva 1 10-22-2003 09:11 PM


All times are GMT -5. The time now is 02:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration