|
The page gives the journey of installing and running Linux operating system on my PC. The daily pep talk received by the Profs in the collage motivated me to set up a linux machine at my room. The first task was to assemble a machine. So I started to look around for the details like which Processor, which CPU, which RAM and so on. The configuration that was finally settled at keeping in mind the budget and availability of components is as under. CPU Intel Pentium 4 (2.4 Mhz HT). Motherboard ASUS P4P800 (FSB 800Mhz, Dual DDR 400MHz RAM Bus, 8 x AGP, onboard sound, Intel extreme 2 video graphics and 100MBPs LAN ) RAM 512 Mb 400MHz DDR. Hard Disk Seagate Barracuda II 7200rpm 20GB. Monitor Samsung 17 " SynkMaster 763DFX (The IISC Lab Spoiled me) UPS APC Modem Dlink 56K Internal Misc. Samsung Combo Drive, Opti Mouse, Sony FDD, Creative Speakers, pinnacle TV tuner and iball cabinet with a 300 W SMPS. The System is a dual boot machine with windows XP (Prof) and Red Hat Linux 9 The Windows OS was loaded first in a 10 GB NTFS partition. and then the Linux OS was loaded in a 5GB partition. The balance of 5 GB is a shared volume in FAT 32 format. The boot loader is GRUB which gives a choice of loading into windows . Linux and Linux (smp). All the parameters of the hardware were not detected automatically and the drivers for sound and modem caused some sleepless nights. Sound. The Analog Devices sound card is not auto detected and Linux reports that no sound card exists. After help from Abhijit and Gaurav the correct drivers were found at http://www.alsa-project.org. The alsa driver, Library and the utility packages were dounloaded and installed. To install the packages the sequence has to be driver-library-utilities. Log in as root and follow the sequence mkdir /usr/local/alsa cd /usr/local/alsa ./configure --with-cards=intel8x0 ./make ./make install Note the alsa mixer mutes all channels as default to have sound run alsamixer in the terminal and un mute the sound channels. to avoid doing this every time alsactl store add this line in /etc/rc.local alsactl restore Modem The modem driver were found from Linux drivers for Conexant Chips - HSF driver downloads for RedHat Linux i686 kernels and loaded int the kernel. NTFS The Linux kernel 2.4.20-8 does not have support for NTFS drive volumes so the support has to be downloaded and patched to the kernel. The NTFS partition is still read only. Tweaks. The command hdparam tells us alot about the hard disk configration on a Linux system. As a default Linus uses a 16 bit transfer mode to get a better through put we can motivate Linux to change over to 32 bit mode to do this add the folloing to /etc/rc.local hdparam -c 1 /dev/hda to check the improvement hdparam -t /dev/hda To playback mp3 songs on the Linux xmms the support for the same has to be downloaded from X MultiMedia System. Setting Up Dialup Internet Connection Linux has a dialer called wvdial using this and pppd we can connect to the Internet. The basic steps are as under. a. Ensure the modem is connected before switching on the PC. b. The modem driver is loaded. c. Run the command wvdialconf /etc/wvdial.conf This will detect the modem and make a file called wedial.conf in the /etc directory. Open the /etc/wvdial file and edit the last three lines give your username password and the ISP telephone number in it, uncomment all the three lines. To connect to BSNL add a line Stupid Mode = 1 This tells the wvdial to start ppp immidiatly after carrier is detected by the modem
wvdial
Grey Areas The only grey areas still in the Linux setup is a. The changing of channels in the Pinnacle TV tuner card. The utility scantv is no longer a part of xwatv program thus the problem. xawdecode_snantv also does not seem to work.
Compiling a Linux Kernel The availability of a new linux 2.6.0test11 kernel source motivated me to setup this new kernel on my machine. The task involved in doing this are as under. a.)
We must get a look at the /etc/fstab file. This is
the
"filesystem table" that the system init uses to mount your filesystems.
There is something very important here that needs to be checked.
b.) Preparing the Source Tree c.)
The first command we issue, is make mrproper which cleans
the build tree, just in case there is some cruft in the directory. This
clobbers any configuration, dependency info and object files. (It
doesn't touch the Makefile though). d.) Configuring the Kernel Source From what we already know about the machine and its purpose, and the information we've gathered, we must now configure the kernel sources. This is where the architecture type is established (i386), and where we choose the features and drivers needed for our kernel. There are different utilities provided for configuring the kernel, but we will focus on menuconfig which is a menu driven utility that can be used from the command console. It requires that the ncurses library be installed. Something that should be, by default in most distributions. If you are running XFree86 on your machine, you can also use xconfig but in my opinion, it is more confusing and slower to navigate than menuconfig, and it requires that the tk package series be installed. First, a word about make oldconfig. If you've already compiled a 2.4 kernel previously, and have a .config file, you can copy it to the top level kernel source directory and use make oldconfig to fly through the existing configuration. If something new is encountered, oldconfig stops and prompts you to say Y, N or M (for "module"). After doing that, the source is configured and the build should be ready to start, but you really should run menuconfig and check it over, and optionally make changes. Don't use oldconfig unless you've got a valid .config file. After you've made decisions on anything you've been prompted for (usually no for bizarre hardware, but you have to be careful not to skip over something important if your .config is old and they've significantly changed things), you are returned to the command prompt. Now, from the top level kernel source directory, type make menuconfig. It will generate a bunch of output as the menuconfig utility is compiling, then your screen should change to the settings menu. Essentially, what you must do is, enter each submenu and select the things you need, and deselect the things you don't need. It starts out with a default configuration. This is not usable as is, for the hardware chosen most likely will not match yours. This is where you must don your thinking cap, and consider the information you've gathered, and read the Help entries on items you do not understand. They are usually pretty informative, sometimes offering answers like "if unsure, say N". You navigate with the arrow keys and/or tab key, and use the space bar to select or deselect a highlighted choice in a menu. If the item has angle brackets, indicating that it's possible to compile as a module, pressing the space bar toggles through the three settings of yes, module and no. Items in square brackets, are either included directly in the kernel only, or are included as part of something else you have built as a module in some cases. It is a yes or no choice. To read the Help on a selected item, use the tab or arrow keys to activate Help down at the bottom of the menu. Once finished exit back to the main menu. Now, exit menuconfig and select Yes when prompted to save changes. Kernel configuration is complete and we can proceed with the build! You might first want to go back into menuconfig and double check your choices once more. You don't need to save changes when you exit next time, if you haven't made any. e.) Building the Kernel Now, we are ready to build our kernel image. What we are going to do is, build a bzImage which is a "big z" compressed (essentially gzipped) kernel image. In the old days, if we kept our kernel image small we could have used "make zImage" which fits into memory a bit differently. Those days, of kernel images smaller than 500 kilobytes, are long gone though. Use bzImage. You will see plenty of compiler output fly by. This will take a few minutes (maybe several if you have a slow machine).
f.) Building
Modules Now we must compile all the drivers we have
selected as modules (M), using the make modules command.
Again, a bunch of compiler output. When it's done we are now finished compiling
the Linux kernel! It is now ready to be installed.
g.) Installing the
kernel
First of all, the only truly safe way to install our new kernel, so we
don't damage any aspects of our previous configuration, is manually.
This will involve running the make
modules_install command
to install the module tree under /lib/modules, and copying the kernel
image to the /boot directory. That's where it goes on redhat based, and
most other systems anyway. However, on some systems it's possible that
the kernel image goes in the / directory. We must also copy the
System.map file (kernel
symbol table) to the boot directory, and edit
the boot loader's configuration file. Before installing the
modules, go to /lib/modules and verify that a
directory of the same name as our kernel version doesn't exist. It
likely won't if you're building a new kernel. In this case, the modules
directory is going to be named 2.6.0.test11
This is determined by the Version, Patchlevel, Sublevel, and
Extraversion variables in the top level Makefile: This must be done
before you start the build , but you
can add text to the Extraversion that will be included in the kernel's
version string. The modules directory will then be named
accordingly. OK, beginning with make
modules_install, we now need to have root
priviledges to proceed any further. This is done by issuing the su
(substitute user) command, and providing the root password when
prompted. Note that the prompt will change from a $ to a #, when using
the bash shell.
The screen will scroll as make is going through the directories. When
it finishes, the last line shows it preparing
the module dependencies.
Our modules are now installed in /lib/modules/2.6.0.test11
The finished kernel image, is located in the arch/i386/boot directory,
within the kernel build tree. It is a file named bzImage. To install
it, I'll simply copy it to /boot, as vmlinuz-2.6.0.test11 I like
to stick with that convention, though it's arbitrary. You could, I
suppose, name the kernel image anything you want as long as you edit
the boot loader's config accordingly.
After copying the kernel image, we need to ensure that the permissions
are same. Change them with the chmod command, to 644 if required. The System.map
file, is located in the top level kernel
source directory. We will copy it to /boot as System.map-2.6.0.test11
and
then move the symbolic link to point to the new System.map file. The -f
switch in ln -sf means "force". It essentially overwrites the symbolic
link. Double check your typing, whenever you use "force" in any
command, as it won't warn or prompt in any way, if you're making a
mistake. Before doing this, verify that the current /boot/System.map is
indeed a symbolic link and not the file. Rename it, if so. h.) Making the image file. The GRUB loader requires a location to load the file containg the setup this is specified in this file. To make this file use the mkinitdr command. This command takes two parameters and makes the initrd image at the specified location.
mkinitrd /boot/initrd-2.6.0.test11.img
/lib/modules/2.6.0.test11 i.) Editing the Boot
Loader Configuration
There are two mainstream boot loaders for x86 in Linux. GRUB
("Grand Unified Boot Loader") and LILO
(Linux Loader). There is a configured /boot/grub/grub.conf file, as
well an
/etc/lilo.conf file.
GRUB isn't terribly difficult to configure, but it is more than a
little weird
until you understand it. The comments (lines with # in front of them)
inform us of the first bit of weirdness. If /boot is a partition, which
it is on this machine, the paths to the kernel (and initrd) in
grub.conf are relative to /boot. That's simply because there is no
concept of a "Linux root filesystem" yet. The "root" is, at that point,
the root of the partition where the kernel image is located. With that
in mind, it's no longer weird. Not
seen in the screen shot also add the last line initrd
/initrd-2.6.0.test11.img
j.) Reboot and
testing
Now you
are now ready, to reboot your machine to your shiny new kernel. You
have taken steps to ensure that you've compiled in the correct drivers
needed to boot the system. You have taken steps to preserve your old
kernel in case the new one has a problem. To test the effectiveness of the new 2.6.0.test11 kerenel a cpu intensive program was run and the variation checked against the 2.4.20 kernel. The results are in the teo data files data24.txt and data26.txt.
|