Moving In...

Booting Linux

  1. Create a boot disk

    [root@bluenote /root]# dd if=/vmlinuz of=/dev/fd0
    

  2. Install LILO (Linux Linker LOader)

    [root@bluenote /root]# /sbin/lilo -C /etc/lilo.conf
    
    A sample /etc/lilo.conf file:
    compact
    boot=/dev/hda
    map=/boot/map
    install=/boot/boot.b
    prompt
    timeout=100
    other=/dev/hda1
    	label=dos
    	table=/dev/hda
    image=/vmlinuz
    	label=develop
    	root=/dev/sda3
    	password=goaway
    	restricted
    	read-only
    image=/vmlinuz
    	label=linux
    	root=/dev/hda2
    	read-only
    

  3. Preserving your master boot record before installing LILO - from the LILO documentation.

    The first 446 (0x1BE) bytes of the MBR are used by the loader program. They are followed by the partition table, with a length of 64 (0x40) bytes. The last two bytes contain a magic number that is sometimes used to verify that a given sector really is a boot sector.

    Installation:

    1. boot Linux.
    2. make a backup copy of your MBR on a floppy disk, e.g.
      dd if=/dev/hda of=/fd/MBR bs=512 count=1 
      
    3. install LILO with the boot sector on the Linux partition.
    4. install BOOTACTV as the MBR, e.g.
      dd if=bootactv.bin of=/dev/hda bs=446 count=1 
      
    5. reboot.

    Deinstallation:

    1. boot Linux.
    2. restore the old MBR, e.g.
      dd if=/MBR of=/dev/hda bs=446 count=1
      or FDISK /MBR under MS-DOS. 
      

  4. rdev - query/set image root device, swap device, RAM disk size, or video mode


Rebuild the Linux Kernel

  1. Distribution kernels contain many extra drivers (to facilitate working with the most systems) you may not need. Recompiling the kernel removes these drivers and shrinks the binary kernel image size.

    [root@bluenote /root]# ls -l /vmlinuz*
    -rw-r--r--   1 root     root       428938 Mar 11 19:00 vmlinuz
    -rw-r--r--   1 root     root       479309 Mar  9 19:48 vmlinuz_distribution
    

  2. dmesg - print or control the kernel ring buffer. This command displays kernel messages so you won't have to write them down furiously as the system boots!

    Using dmesg I can determine the amount of free memory after the kernel loads.
    [root@bluenote /root]# dmesg | grep Memory
    Memory: 31288k/32768k available (764k kernel code, 384k reserved, 332k data)
    

  3. The /proc filesystem contains many interesting human readable files that contain information about your Linux system.

    What devices are supported by this Linux kernel.
    60 18:10/home/code/sluugls/1996/apr> cat /proc/devices 
    Character devices:
     1 mem
     2 pty
     3 ttyp
     4 tty
     5 cua
     6 lp
     7 vcs
    14 sound
    21 sg
    
    Block devices:
     2 fd
     3 ide0
     8 sd
    11 sr
    
    What types of filesystems are supported by this Linux kernel.
    61 18:11/home/code/sluugls/1996/apr> cat /proc/filesystems 
            ext2
    	minix
    	msdos
    nodev   proc
    nodev   nfs
    nodev   smbfs
    	iso9660
    
    How many interrupts have been recorded by interrupt.
    62 18:12/home/code/sluugls/1996/apr> cat /proc/interrupts
      0:   221246   timer
      1:     1936   keyboard
      2:        0 + cascade
      4:     5327 + serial
      5:        2   SoundBlaster
     11:     5622 + aic7xxx
     12:       23   3c509
     13:        0   math error
     14:      494 + ide0
    
    What I/O addresses are being used.
    66 18:14/home/code/sluugls/1996/apr> cat /proc/ioports 
    0000-001f : dma1
    0020-003f : pic1
    0040-005f : timer
    0060-006f : kbd
    0070-007f : rtc
    0080-009f : dma page reg
    00a0-00bf : pic2
    00c0-00df : dma2
    00f0-00ff : npu
    01f0-01f7 : ide0
    0220-022f : SB
    0278-027f : lp
    02f8-02ff : serial(auto)
    0300-030f : 3c509
    0378-037f : lp
    03c0-03df : vga+
    03f0-03f5 : floppy
    03f6-03f6 : ide0
    03f7-03f7 : floppy DIR
    03f8-03ff : serial(auto)
    fc00-fcbe : aic7xxx
    
    A map of the system memory. This file is not taking up any disk space. DO NOT DELETE IT. Copying this file will consume disk space.
    67 18:14/home/code/sluugls/1996/apr> l /proc/kcore 
    -r--------   1 root     root     33558528 Apr 17 18:15 /proc/kcore
    


The Devices

/dev contains the files necessary for the kernel to interface with the physical computer hardware. If files are missing /dev/MAKEDEV can create them for you.

From the MAKEDEV man page:

MAKEDEV is a script that will create the devices in /dev used to interface with drivers in the kernel.

Note that programs giving the error ``ENOENT: No such file or directory'' normally means that the device file is missing, whereas ``ENODEV: No such device'' normally means the kernel does not have the driver configured or loaded.

The following command verbosely creates devices.
[root@bluenote /dev]# /dev/MAKEDEV -v update
Some interesting devices are:
/dev/null               # returns end of file
/dev/zero               # returns \0 characters
/dev/full               # simulates a full disk

Last Modified: 17 April 1996

St. Louis Unix Users Group - Linux SIG