LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-28-2006, 12:07 AM   #1
Z038
Member
 
Registered: Jan 2006
Location: Dallas
Distribution: Slackware
Posts: 912

Rep: Reputation: 174Reputation: 174
Condensed how-to on Kernel compiling?


I need to turn on Highmem support as I've added another gigabyte of RAM to my system, and Slack isn't currently using it. I'm only using the first gigabyte.

I see there is a pinned thread on Kernel compiling for 2.6.0, but I really want to compile my existing 2.4.31, as it is working just fine and I don't see any reason to go to 2.6 right now. Besides, all I want is highmem support.

I'm sure I could figure out what I need from that 2.6.0 compile sticky thread, but I find the prospect of reading 30 pages of responses quite daunting. I'm sure there are older threads that cover 2.4 if I look for them.

So, castigate me if you will for not looking around first, but what I really want to know is whether or not there is a condensed how-to for recompiling my 2.4 kernel to turn on Highmem support that will not require me to read 30 pages of a forum thread.

Yeah, I'm that lazy. Sorry.
 
Old 03-28-2006, 12:37 AM   #2
b0nd
Senior Member
 
Registered: Jan 2005
Distribution: Slackware, BackTrack, Windows XP
Posts: 1,020

Rep: Reputation: 45
hello,
here is the tut you are lookin for
http://www.linuxquestions.org/questi...ad.php?t=73436

keep one thing in mind while compiling the kernel....don't remove the entries/files of old kernel. Have different directory for the new one. So that in case you don't boot up with the compiled one....you will still have option of going back to the old one.

regards
 
Old 03-28-2006, 12:47 AM   #3
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
You only need to read the first page, other pages are people problems compiling the kernel. Or you can read http://xushi.co.uk/guides/kernel.php which is a very good guide for 2.6 kernel. So don't be lazy because you will need to compile 2.6 kernel someday.
 
Old 03-30-2006, 09:49 PM   #4
Z038
Member
 
Registered: Jan 2006
Location: Dallas
Distribution: Slackware
Posts: 912

Original Poster
Rep: Reputation: 174Reputation: 174
Very well, I will do it. I am afraid, but I will do it. Once I've done it a time or two, I may think it is crazy to be afraid. I hope. We'll see.

Unfortunately, the guide linked to doesn't say how to set highmem. Searching...
 
Old 03-30-2006, 10:22 PM   #5
Z038
Member
 
Registered: Jan 2006
Location: Dallas
Distribution: Slackware
Posts: 912

Original Poster
Rep: Reputation: 174Reputation: 174
OK, I gave up for today, as I've concluded that this is way over my head at the moment. I didn't get too far. I downloaded the slackware 2.6.15.3 source from here.

I tried to follow the instructions in the post that ruudra supplied at that was written by DrOzz at http://www.linuxquestions.org/questi...ad.php?t=73436

I found a .config file in the /usr/src/linux directory after I untarred the tgz file where I could set the highmem support for my 2GB of RAM. I changed it and saved it. Then, when I got to the point of issuing "make config" as documented in DrOzz's instructions, it started asking me an endless series of esoteric questions that I cannot hope to know the proper answers to.

How do I know how I should respond to all those questions? I want a 2.6.15.3 kernel that is set up like my nicely working 2.4.31 kernel and with added highmem support, but I do not understand all the questions that "make config" asks me.

I'm gonna go smoke a pipe. FMOTT in a Jirsa dublin this time.
 
Old 03-30-2006, 10:43 PM   #6
rje_NC
Member
 
Registered: Nov 2002
Location: Greensboro, NC
Posts: 182

Rep: Reputation: 30
I would suggest when moving to the 2.6 kernel from the 2.4 series in Slackware 10.2, the best way to go is to first install the 2.6.13 kernel from /testing. This is available on the 3rd CD (I think) or from any Slackware mirror. There are very good instructions on how to install the kernel in the directory. The new kernel will coexist with the 2.4.31 kernel so you have a fallback position if you have difficulties. I would install everything in the /linux-2.6.13 folder.

After you are running 2.6.13, you can then download and install a newer version to /usr/src. I would then copy the .config file from the 2.6.13 source tree you downloaded in the previous paragraph to the new source tree. This way you have nearly all of the setting Patrick used in creating the 2.6.13 testing kernel. This way you can focus on the changes you want to make rather than trying to get it all right at once. I usually modify the 2.4 entry in lilo to refer to the new kernel I am compiling, and leave the 2.6 13 as a safety net in case I mess up the new kernel.

I have used this approach to install 2.6.15.6 and 2.6.16.1 kernels on several old Dell and Compaq laptops with excellent results. It is much easier to focus on the changes you need to make for a particular system, and delete out the items you know you don't need. After a couple of tries, it gets really easy with the 2.6 series kernel.

With the .config file from the 1.6.13, most of the hard work will be done for you. It is usually then a matter of make menuconfig, make, make modules_install, and make install (assuming lilo is formatted correctly) to get it done.

Good luck...

Bob

Last edited by rje_NC; 03-30-2006 at 10:44 PM.
 
Old 03-30-2006, 10:58 PM   #7
KimVette
Senior Member
 
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
Quote:
Originally Posted by Z038
How do I know how I should respond to all those questions? I want a 2.6.15.3 kernel that is set up like my nicely working 2.4.31 kernel and with added highmem support, but I do not understand all the questions that "make config" asks me.
You are best served by spending the time to read the documentation; all anyone can do is merely reiterate what the HowTos say here.

How to proceed:

1. Read The Fine Manual (in this case, HowTo articles folks already kindly pointed you at)
2. In the HowTo articles, discover "menuconfig" and is virtues over "config"
3. Install ncurses, run "make menuconfig" instead of "make config"
4. Follow the menus, enabling for hardware you have installed or plan to install
5. Save changes
6. run "make bzImage" or "zImage" or whichever image type you wish to compile
7. Proceed as directed by the HowTo articles

{Edit: You want to use menuconfig. You REALLY do. If you select the wrong option, you can EASILY go back and change it. With config, you need to either become intimate with the config file and pico or vi (which you're not ready for yet) or run through the entire config script again.}

There is no getting around to having to READ the documentation at SOME point, and you need to know what hardware you have installed. Unfortunately in most cases it's not enough to know you have "Bill & Ted's Excellent Video Card" but you will have to know the nuts and bolts of it; you'll have to know that it runs the Foo2100 chipset and the "Bill & Ted's Bogus Soundcard" uses the Bar3215 chipset, not the marketing name of the parts. Yes, it is work and requires reading but if you want to succeed, the ONLY way to get around all of this is to build a monolithic kernel which includes support for pretty much all chipsets you can imagine, making the kernel larger and require more memory (and in some cases eat CPU time when it should be otherwise idle)

Last edited by KimVette; 03-30-2006 at 11:01 PM.
 
Old 03-31-2006, 01:15 AM   #8
b0nd
Senior Member
 
Registered: Jan 2005
Distribution: Slackware, BackTrack, Windows XP
Posts: 1,020

Rep: Reputation: 45
Hi Z038,
i agree with rje_NC and KimVette.
Better have 2.6.x first in order to compile it. Upgrading from 2.4.x will be a bit tough job. Anyways...the "config" file for upgrading from 2.4.x --> 2.6.x was not which you used. Its found in the second cd of distro (talking about 10.0 of slackware). For 2.4.x --> 2.4.x that will work, but in this case you have to use this one.

Second issue: use either #make menuconfig or #make xconfig. I prefer using xconfig.
Learning compilation is a bit long process. Make changes whatever you understand. If satisfied with the working of kernel....come back to compiling it after few days or may be weeks....
This way keep on polishing your kernel time to time.

regards
 
Old 03-31-2006, 02:40 AM   #9
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
You should have done this way:
Run installpkg linux-2.6.15.3.tgz
Then go to it's source directory, should be /usr/src/linux-2.6.15.3:
Open /usr/src/linux-2.6.15.3
Run make xconfig (use or have kde installed, have necessary qt libs) / gconfig (use or have gnome installed, have necessary gtk libs).
Enable highmem support.
Save config file.
Run make bzImage (this compiles kernel).
Run make modules (this compiles required modules).
Run make modules_install (this installs modules, which you have recently compiled, into /lib/modules/linux-2.6.15.3)
Open arch/i386/boot.
Rename bzImage into linux-2.6.15.3 (not required, but more convenient way to know kernel name rather than only bzImage).
Copy linux-2.6.15.3 and system.map into /boot.
Edit /etc/lilo.conf and add this new kernel (similar entry like for 2.4 kernel, only change kernel path(name)). But don't delete entry for 2.4 kernel. You can boot it if your new 2.6.13.5 kernel booting fails.
Run lilo (it needs to memorize your new kernel). It will also show if you made any errors while editting lilo.conf If you have any errors, reedit lilo.conf.
Reboot the computer and tell us if you succeeded.

Last edited by Alien_Hominid; 03-31-2006 at 01:12 PM.
 
Old 04-01-2006, 01:39 AM   #10
Z038
Member
 
Registered: Jan 2006
Location: Dallas
Distribution: Slackware
Posts: 912

Original Poster
Rep: Reputation: 174Reputation: 174
Ok, thank you all for your help so far. I will read some more. Meanwhile, I decided to try Alien_Hominid's instructions for compiling the kernel. I enabled highmem 4GB via the xconfig options, and I also enabled the Athlon64 support, since my system uses the Athlon 64 processor. It seemed as though that didn't have any affect, and everything got built as i386. At least, it went to that directory (.../arch/i386/...) I may do this again when I figure out how to get an ia64 kernel.

Now I'm to the point of copying the renamed bzImage (now called linux-2.6.15.3) and System.map to /boot, but there is already a System.map file in /boot. It's a symbolic link for System.map-ide-2.4.31. I want to make sure I can boot the 2.4.31 version too, so should I copy the new System.map to /boot as System.map-ide-2.6.15.3 and then change the System.map symbolic link to point to it?

BTW, I don't use lilo, I use the grub loader, and it's on a separate partition from Slackware. I used the mkinitrd command previously after installing Slackware with the 2.4.31 kernel so I could load an initial ramdisk with reiserfs support from the grub loader. If I copy the 2.6.15.3 version of System.map to /boot and run mkinitrd, it will presumably overlay the config file (symbolic link for config-ide-2.4.31 and I don't really know what that is), and will replace the contents of directory initrd-tree/ and replace the 2.4.31 version of initrd.gz with a new one. There is also a vmlinuz symbolic link in /boot that points to vmlinuz-ide-2.4.31. I think that is my 2.4.31 compiled kernel.

Since grub is on a different partition (hda1) from slackware (hda5) I had to copy initrd.gz and vmlinuz-ide-2.4.31 to hda1 where grub lives. So grub is not really using the ones in /boot for these two files.

This is what I'm thinking.
- Make a complete backup of /boot and all subdirectories.
- Copy my System.map file to /boot as System.map-ide-2.6.15.3 and create System.map as a symbolic link.
- Copy my linux-2.6.15.3 file (formerly bzImage) to /boot
- Run mkinitrd, which will replace contents of initrd-tree/ directory, but I think this is OK because I have a backup and because I think it is only used to create the initrd.gz file. It will also replace the current initrd.gz file, but this is OK because I have a backup, and because the one that grub loads is on hda1, not in /boot on hda5.
- I have no idea what happens to the config and the vmlinuz files in /boot. Anyone know?
- Copy the new initrd.gz file to hda1 as initrd-ide-2.6.15.3.gz, and copy linux-2.6.15.3 to hda1 also.
- Update grub.conf to add an entry to load the initrd /initrd-ide-2.6.15.3.gz and kernel linux-2.6.15.3.
- Boot and achieve instant happiness, bliss, and Nirvana.

Any helpful comments?
 
Old 04-01-2006, 02:03 AM   #11
b0nd
Senior Member
 
Registered: Jan 2005
Distribution: Slackware, BackTrack, Windows XP
Posts: 1,020

Rep: Reputation: 45
hi,
you can do one thing.....make a directry inside /boot. Let it be "CompiledKernel"
now copy your new System.map and bzImage in this directory and leave the original ones at there place only.
Now while making entry of it in lilo.conf/grub.conf, just specify the exact path of this new kernel.

Here is my lilo.conf

Quote:
# Testing Linux bootable partition config begins
image = /boot/vmlinuz
root = /dev/hda7
label = SlackTesting
read-only

# Linux 2.4.267 of Testing Linux.
image = /boot/2.4.267/vmlinuz
root = /dev/hda7
label = 23Jan06
read-only
# Linux bootable partition config ends
See the bold and underlined part.

My grub.conf (when i used to had it)

Quote:
#grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,8)
# kernel /boot/vmlinuz-version ro root=/dev/hda9
# initrd /boot/initrd-version.img
#boot=/dev/hda
default=1
timeout=10
splashimage=(hd0,8)/boot/grub/splash.xpm.gz
title Red Hat Linux (2.4.20-8)
root (hd0,8)
kernel /boot/vmlinuz-2.4.20-8 ro root=LABEL=/
initrd /boot/initrd-2.4.20-8.img
title New kernel
root (hd0,8)
kernel /boot/bond/vmlinuz-2.4.20sk ro root=/dev/hda9
initrd /boot/bond/initrd-2.4.20sk.img

title Slackware 10.1 - The Best
root (hd0,6)
kernel /boot/vmlinuz-ide-2.4.29 ro root=/dev/hda7
title Windows XP - Bill Gates Ka Paap
rootnoverify (hd0,0)
chainloader +1
regards
 
Old 04-01-2006, 02:54 PM   #12
Z038
Member
 
Registered: Jan 2006
Location: Dallas
Distribution: Slackware
Posts: 912

Original Poster
Rep: Reputation: 174Reputation: 174
OK, I deleted the symbolic links in /boot and copied the new kernel and called it vmlinuz-ide.2.6.15.3 (to be consistent with the name of the 2.4.31 kernel) and the new System.map file there that I named System.map-ide-2.6.15.3. I didn't bother setting up new symbolic links for vmlinuz or System.map, as they don't appear to be needed for anything.

Then I ran the mkinitrd to create a new initial ram disk, renamed the resulting initrd.gz file to initrd-ide-2.6.15.3.gz and copied it and the vmlinuz kernel for 2.6.15.3 to the /dev/hda1 partition where grub is installed, updated my grub configuration to have options for both kernels and initrds, and booted.

Success. Mostly, anyway. I tested booting the 2.4.31 kernel first to make sure it would still boot, and it did. I booted the 2.6.15.3 kernel, and it came right on up, but I've got some differences in config settings I need to work out. For example, I've got ACPI turned on now, whereas I did not in 2.4.31. Most problematic is that I've lost my mouse completely. So even though I can boot 2.6.15.3, run command line stuf, and run startx to bring up KDE, I have no mouse. I'm back on 2.4.31 now while I sort out the config settings.

I was able to get HIGHMEM turned on for 2.6.15.3 - Linux sees all my RAM.

Code:
Apr  1 18:38:38 ixian1 kernel: Linux version 2.6.15.3 (root@ixian1) (gcc version
 3.3.6) #1 Sat Apr 1 04:44:28 UTC 2006
Apr  1 18:38:38 ixian1 kernel: BIOS-provided physical RAM map:
Apr  1 18:38:38 ixian1 kernel: 1151MB HIGHMEM available.
Apr  1 18:38:38 ixian1 kernel: 896MB LOWMEM available.
Apr  1 18:38:38 ixian1 kernel: DMI 2.3 present.
Apr  1 18:38:38 ixian1 kernel: ACPI: PM-Timer IO Port: 0x408
Apr  1 18:38:38 ixian1 kernel: Kernel command line: ro root=/dev/hda5
Apr  1 18:38:38 ixian1 kernel: Initializing CPU#0
Apr  1 18:38:38 ixian1 kernel: Using pmtmr for high-res timesource
Apr  1 18:38:38 ixian1 kernel: Memory: 2074932k/2097088k available (2060k kernel
 code, 20880k reserved, 681k data, 180k init, 1179584k highmem)
I'm going to keep plugging away until I get my config settings right, and then I'll recompile again.

Thanks for all the help. This has been illuminating and educational.
 
  


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
Errors Compiling Kernel 2.6 on Slackware 10.2 - Old kernel headers required? Dave S. Slackware 8 03-04-2006 01:15 AM
openoffice font condensed stimpsonjcat Debian 9 12-19-2005 09:05 AM
Where Is Kernel Directory In Rh9(kernel 2.4.20-8), For Compiling HSP56 MR(pctel) Mode rudy3107 Linux - Software 1 07-25-2004 05:17 AM
condensed printing rbrooks Linux - Newbie 0 03-20-2003 12:22 PM
Kernel compiling and module compiling tarballed Linux - General 1 12-22-2002 06:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:07 AM.

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
Open Source Consulting | Domain Registration