home *** CD-ROM | disk | FTP | other *** search
Text File | 2000-03-11 | 71.3 KB | 1,511 lines |
- Chapter 4
- Booting and Boot Managers:
- LILO, loadlin, etc.
-
- This chapter describes various methods of booting a Linux system. To
- have a better understanding of what is involved, we will first illustrate some
- technical details of booting a PC.
-
- 4.1 Booting a PC
- After turning on your computer, the first thing that happens is that the BIOS
- (Basic Input Output System) takes control, initializes the screen and key-
- board, and tests the main memory. Until this task is completed, no external
- devices or external storage media are known to the system.
- Once the basic system has finished its internal setup, it starts to verify the
- hardware around it. Date, time, and information about some of the most
- important external devices are read from the CMOS settings (usually referred
- to as the CMOS setup). After reading the CMOS, the BIOS should recognize
- the first hard disk (including details such as its geometry). It can then start to
- load the operating system (OS) from there.
- To load the OS, the system loads a 512-byte data segment from the first
- hard disk into main memory and executes the code stored at the beginning
- of this segment. The instructions contained there determine the rest of the
- boot process. This is the reason why the first 512 bytes of the hard disk are
- often called the Master Boot Record (MBR) (MBR).
- Even though the whole process is rather complicated and this description is
- over-simplified, it should be clear that up to this point (loading of the MBR),
- the boot sequence is independent of the installed operating system, is identical
- on all PC's, and all the PC has to access peripheral hardware is those routines
- (drivers) stored in the BIOS.
-
- Master Boot Record
- The layout of the MBR has been certified by an independent convention. The
- first 446 bytes are reserved for program code.1 The next 64 bytes offer space
- for a partition table for up to four partitions.2 The last two bytes have to
- 1 The code itself ¡ and its capabilities ¡ depend on the system that created the MBR.
- 2 Without this partition table, no filesystem can exist-you cannot use the hard disk.
-
- 103
-
-
-
- 4. Booting and Boot Managers
-
- contain a special "magic number" (AA55). Any MBR which replaces this
- number by a different number is rejected.
-
- Boot Sectors
- Boot sectors are the first sectors on a hard disk partition.3 They offer
- 512 bytes of space and are designed to contain code which is able to launch
- an operating system on this partition. Boot sectors of formatted DOS, Win-
- dows, and OS/2 partitions do exactly that. In contrast, Linux boot partitions
- are empty at the very start. A Linux partition cannot be started directly,
- although it may contain a kernel and a valid root filesystem.
- A valid boot sector follows the conventions and enters the "magic number"
- of the MBR into the last two bytes.
-
- Booting DOS or Windows 95
- The MBR contains information that determines which partition of a hard disk
- is "active", i. e., which partition should be searched for the operating system
- to be booted.4 The executable code in the MBR (first stage of the boot loader)
- tests whether the marked partition contains a valid boot sector.
- If this is the case, the second stage of the boot loader can be started from
- there. DOS system programs can now be loaded and you will see the usual
- DOS prompt.
- In DOS, only primary partitions can be marked active. Therefore, you cannot
- use logical partitions inside an extended partition as bootable DOS partitions.
-
- 4.2 Different Boot Concepts
- The simplest boot concept affects only one machine with one operating sys-
- tem installed. A widely deployed PC configuration is DOS or Windows 95 as
- the only system installed. The boot sequence for this case has already been
- outlined.
- A similar concept can be used for Linux,5 if Linux is the only operating
- system being used. In this case, one could theoretically skip the installation
- of LILO. The big disadvantage of doing this is that you can't pass additional
- parameters to the system kernel at boot time.
- As soon as there is more than one operating system installed, there are a
- number of new boot possibilities.
-
- Booting another OS from a floppy disk The first OS can be booted from
- the hard disk. Other operating systems can be booted by using boot disks.
- * Requirements: the floppy drive must be bootable.
- * Advantage: you can skip the potentially tricky boot loader installation.
- 3 except for the extended partition which serves as a "container" for other partitions
- 4 This implies that DOS has to be installed on the first hard drive.
- 5 You would have to write the Linux kernel directly onto a "raw" partition and launch this from
- the MBR. This is rather uncommon, however.
-
- 104
-
-
-
- 4.3. An Overview of LILO
-
- * Disadvantage: you have to ensure that you are not running out of
- working boot disks.
- * It might be an advantage or disadvantage that your Linux is not capable
- of booting without a boot disk, depending on what it is to be used for.
- * The boot process will take slightly longer.
- Boot chaining of additional systems The same OS is always booted and
- others can optionally be started from within the first OS.
- * Requirements: adequate programs for chain booting of operating sys-
- tems must be available.
- * An example is the loading of Linux from DOS using loadlin or starting
- a NetWare server from DOS with server.exe.
- Installing a boot manager Theoretically, this allows you to use an arbitrary
- number of operating systems on a single machine. The choice of systems
- is done at boot time. Changing operating systems requires a reboot.
- * Requirements: the boot manager must work smoothly with all installed
- operating systems.
- * Examples of co-existing boot managers (at least under certain circum-
- stances) are OS/26 and the DOS boot loader boot.sys.
- The following section describes the installation and configuration of a boot
- manager, using the Linux boot manager LILO. A complete description of
- LILO's features can be found in [Alm94].7 This is followed by a description
- of loadlin.
-
- 4.3 An Overview of LILO
-
- LILO-here we go...
- The Linux boot loader is usually installed in the MBR (details below, page 107
- and Section 4.5 page 114). When started, LILO already has access to both
- real mode hard disks, and due to its installation, is able to find all the data
- it needs from the raw hard drives8 without needing any information on par-
- titioning. Because of this, operating systems can be booted from the first as
- well as from the second hard drive. The entries in the partition table that the
- standard DOS MBR uses to mark the active partition are ignored when using
- LILO in the MBR.
- An important difference to the standard DOS boot sequence is that you can
- select any of the installed systems at boot time when using LILO. After
- loading the MBR into memory, LILO is started and you are asked to select
- one of the installed operating systems (see on the following page).
-
- 6 more in Section 4.7.3 page 119
- 7 This file can be printed by entering
- earth:/usr/doc/packages/lilo # lpr user.dvi
- or viewed with
- earth:/usr/doc/packages/lilo # xdvi user.dvi
-
- 8 A raw device is a device that is accessed directly without using a filesystem.
-
- 105
-
-
-
- 4. Booting and Boot Managers
-
- What is LILO?
-
- LILO is a versatile boot manager. It can launch an operating system in the
- following ways:
-
- * by loading the boot sector of a partition and starting an operating system
- from this partition. This is what other boot managers also do.
- * by loading the Linux kernel and starting Linux. This cannot be done by
- most other boot managers.
-
- Furthermore, LILO provides an important option of being able to pass a
- command line to the kernel. For security reasons, this can be protected totally,
- or partially, with a password.
-
- How Do You Boot with LILO?
-
- When LILO is launched, it displays the text LILO and a greeting message
- (which you yourself entered during installation). Thereafter, a command
- prompt appears:
- boot:
- Here, you select your operating system by entering its name, which is then
- booted. The name of the operating system has previously been set by you
- during installation. At this point, you can pass a parameter line to the Linux
- kernel. You can also get a list of all the operating system names available by
-
- pressing TAB
- .
-
- The Components of LILO
-
- The LILO machinery consists of the following components:9
-
- * the beginning, or first step, of the LILO code in a boot sector which
- activates the system boot
- * the heart of the LILO code, localized in /boot/boot.b
- * a map file, normally /boot/map, where LILO enters the location of
- Linux kernels and other data during its installation
- * optional: a message file whose contents are displayed as a welcome mes-
- sage before the LILO boot selection. Its usual location is:
- /boot/message (or similar)
- * the different Linux kernel and boot sectors that LILO should offer
-
- Any write access (even through file movements) on any of these files
- corrupts the map file, thus requiring you to reinstall LILO (Section 4.5
- page 114). This is only relevant when you change to another kernel.
-
- 9 By the way, the boot sectors installed by LILO contain a typical virus boot sequence. DOS
- virus scanners typically claim to have found the AIRCOP boot sector virus in files such as
- /boot/any_b.b or /boot/any_d.b. Also, you should disable any BIOS protection of
- the MBR.
-
- 106
-
-
-
- 4.3. An Overview of LILO
-
- Where LILO Can Be Installed
- This is referring to the above-mentioned first step of LILO. Before going into
- detail, we would like to point out a very important general restriction:
-
- All LILO components must be located on the first 1024 cylinders of the
- hard drive.
-
- This is because these are the only cylinders available when the BIOS starts
- the system. With older BIOSes and IDE drives one can also be restricted to
- either of the first two hard drives (/dev/hda and /dev/hdb). If there are
- any (E)IDE hard drives installed, your SCSI devices will be not able to boot
- either. This is rather annoying as the 1024 cylinders limit is reached much
- more quickly with SCSI devices (8 GB) than with IDE devices (504 MB to
- 2 GB). Note that this is a limitation of the PC BIOS, not of Linux or LILO.
- Many newer BIOSes allow access to additional devices, for example, in con-
- nection with EIDE hard drive controllers for up to 4 EIDE devices. Many
- modern SCSI host adapters even allow SCSI devices to be "pushed to the
- front" in order to make them bootable. If you want to make use of this feature
- with LILO, have a look at the disk options on 112.
- For the sake of simplicity we will combine all this under the heading "1024
- cylinder limit". It should all be considered before a first-time installation
- (Section 2.6.1 page 47) - afterwards it is too late, and may cause a lot of
- extra work. For more information, see section 4.8.2.
- The following locations are possible to store the LILO boot sector.
-
- * on a floppy disk. This is the most secure, but also the slowest alternative
- for booting with LILO (see Section 4.6 page 116). Choose this alternative
- if you do not want to change boot sectors.
- * in the boot sector of a primary Linux partition on the first hard drive.
- This leaves the MBR untouched. Before it can be booted, the partition
- has to be marked active, with fdisk. If Linux is fully installed on logical
- drives or partitions on the second hard drive, there is only the boot sector
- of the extended drive of the first drive left (if there is one). Linux fdisk
- can also activate such a partition.
- If you want to boot multiple systems from hard disk, this is quite long-
- winded. Every time you want to boot you have to activate the corre-
- sponding boot sector beforehand. The next two variants are much less
- cumbersome.
- * in the Master Boot Record. This variation offers the highest flexibility.
- Moreover, this is the only alternative possible if all of the Linux partitions
- reside on the second hard drive and there is no extended partition on
- the first drive. Every setting of the MBR must be edited with extreme
- care since errors may have severe consequences. The safety aspects are
- described in Section 4.5 page 114.
- * If you have used another boot manager until now and you want to
- continue using it. Depending on its flexibility and power, there are several
- variations. A common case: you have a primary Linux partition on the
-
- 107
-
-
-
- 4. Booting and Boot Managers
-
- second hard drive where you boot Linux. Your boot manager is able to
- boot this partition via a boot sector. Then you can activate your Linux
- partition by installing LILO into this boot sector and telling your boot
- manager that it is active.
-
- Be careful if you try to make a logical Linux partition bootable by in-
- stalling LILO onto it. Success is not guaranteed at this point in time, even
- if your other boot manager is able to launch logical partitions.
-
- Try it if you like. The safest way is to try it with a tiny Linux installation
- to see if it will work. Perhaps you will be lucky. The recommended way
- is still to create a primary and bootable Linux partition.
-
- 4.4 Configuring LILO
- LILO is a flexible boot manager that offers many ways of adapting a configu-
- ration to one's needs. The most important options and meanings are described
- below. If you want to go into more detail, look at [Alm94].
- Configuration of LILO is done in /etc/lilo.conf. If you are installing
- LILO for the first time, we recommend you use YaST to configure LILO.
- You can fine-tune, by editing /etc/lilo.conf, at a later stage.
-
- /etc/lilo.conf should only be readable for `root', as it might con-
- tain passwords (see Section 4.4.2 page 111; this is the default setting with
- SuSE Linux. If in doubt, just check, by invoking the following command
- as root:)
- earth: # chmod 0600 /etc/lilo.conf
-
- It is recommended you keep any existing old (and working) lilo.conf
- backed up in a safe place. Your settings only take effect when you reinstall
- LILO after changing /etc/lilo.conf (see Section 4.5 page 114).
-
- 4.4.1 Structure of lilo.conf
- /etc/lilo.conf starts with a global section followed by one or
- more system sections for each operating system LILO should start. A
- new section is started by a line beginning with either image or other.
- The order of entries in /etc/lilo.conf only matters in as much as the
- first one in the list is booted by default if no user interaction is taken -this
- can be set to delay= and timeout=.
- A sample configuration for a machine with both DOS and Linux is shown in
- File contents 4.4.1 on the next page. There are two Linux kernels (an older
- and a newer one) on /dev/hdb3, as well as MS-DOS (or Windows 95/98)
- on /dev/hda1.
- Anything between a `#' and the end of line is regarded as a comment. Spaces
- and comments are ignored by LILO and can be used to improve readability.
- Now we go through the most important lines step by step:
-
- * Global section (Parameter part)
-
- 108
-
-
-
- 4.4. Configuring LILO
-
-
-
-
-
-
-
-
- # LILO Configuration file
- # Start LILO global Section
- boot=/dev/hda # LILO Installation target
- backup=/boot/MBR.hda.970428 # Backup file for the old MBR
- # Apr 28 1997
- #compact # faster, but won't work on all systems.
- #linear # Generate linear sector addresses
- # instead of sector/head/cylinder addresses.
- message=/boot/greetings # LILO's Greeting
- prompt
- password = q99iwr4 # Example LILO password
- timeout=100 # wait at prompt for 10 s before default
- # is booted
- vga = normal # normal text mode (80x25 characters)
- # End LILO global section
-
- # Linux bootable partition config begins
- image = /vmlinuz # Setting
- root = /dev/hdb3 # Root partition for kernel
- read-only
- label = Linux
- # Linux bootable partition config ends
-
- # Second Linux bootable partition config
- image = /vmlinuz.old
- root = /dev/hdb3
- read-only
- label = Linux.old
- # 2nd Linux bootable partition config ends
-
- # DOS bootable partition config begins
- other = /dev/hda1
- label = DOS
- loader = /boot/chain.b
- table = /dev/hda
- # DOS bootable partition config ends
-
- File contents 4.4.1: Sample configuration in /etc/lilo.conf
-
-
-
-
-
-
-
- 109
-
-
-
- 4. Booting and Boot Managers
-
- ¡ boot=<bootdevice>
- The device on whose first sector LILO should be installed.
- <bootdevice> may be: a floppy disk drive (/dev/fd0), a partition
- (e. g., /dev/hdb3), or a whole disk (e. g., /dev/hda). The last
- means installing LILO in the MBR. Default: if this option is missing,
- LILO is installed on the current root partition.
- ¡ prompt
- Forces the LILO prompt to be displayed. The default is: no prompt
- (compare with delay further down). This is recommended if LILO
- needs to manage more than one system. In addition, timeout should
- be set to guarantee an automatic reboot if nothing is entered at the
- prompt.
- ¡ timeout=<tenth-seconds>
- Sets a timeout for the prompted option, thus enabling an automatic
- reboot if no entry occurs in the given time. <tenth-seconds> is the
-
- remaining time in 0.1 s. increments. Pressing Shift starts the
- timeout over. Default: infinite, e. g., no automatic reboot.
- * Linux section
- ¡ image=<kernelimage>
- Here the name of the kernel image to be booted, including its directory
- location, should be entered. With your new system, this is most proba-
- bly /boot/vmlinuz, or /vmlinuz for older SuSE Linux systems.
- ¡ label=<name>
- This name has to be unique in /etc/lilo.conf. Otherwise, you
- can freely choose a name for the system (e. g., Linux). Maximum
- length is 15 characters. You should use only letters, numbers and
- underscore for names-no blanks or special characters.10 The default
- is the filename of the kernel image (e. g., /boot/vmlinuz).
- By entering this name at the LILO prompt, you select which system to
- boot. It is recommended that, if there are many systems installed, you
- keep track of them in a special message file (message=).
- ¡ root=<rootdevice>
- This is to give the kernel the name of the root partition (e. g., /dev/
- hda2) of your Linux system. This is recommended for security rea-
- sons. If this option is omitted, the kernel takes its own root partition.11
- * Other systems
- ¡ other=<partition>
- other tells LILO to start the partitions of other systems such as DOS
- (e. g., /dev/hda1).
- ¡ loader=<Boot loader>
- To load a boot sector that belongs to another operating system, LILO
- constructs a pseudo MBR in its map file. At boot time, LILO first
- 10 For more on the specific rules for which characters to use, see [Alm94], 3.2.1.
- 11 This can be seen using the command rdev <kernelimage>.
-
- 110
-
-
-
- 4.4. Configuring LILO
-
- starts this pseudo MBR, which in turn starts the other boot sector. This
- option specifies the file where the code for the pseudo MBR is to be
- found.
- Default: /boot/chain.b (usually, this is correct).
- Sometimes another OS that needs to be booted from the first hard
- drive (e. g. DOS) is supposed to boot from another hard drive using
- LILO. There are additional options that cause the hard drives to swap
- according to their device numbers:
- map-drive=<Number> and to=<Number>. See: File con-
- tents 4.4.2 ( on the current page).
- The loader os2_d.b serves to load OS/2 from the second hard drive.
- 12 New in LILO-Version 20: "switching" devices has to be set explic-
- itly now (see File contents 4.4.2 )
-
- # Booting DOS from the second hard drive
- # DOS bootable partition config begins
- other = /dev/hdb1
- label = DOS
- loader = /boot/chain.b
- map-drive = 0x80 # first hd: BIOS number 0x80
- to = 0x81 # second hd: BIOS number 0x81
- map-drive = 0x81
- to = 0x80
- table = /dev/hdb
- # DOS bootable partition config ends
-
- File contents 4.4.2: /etc/lilo.conf Extract: Booting DOS from 2nd
- hard drive
-
- ¡ table=<ptable>
- <ptable> sets the source device for the partition table written into the
- pseudo MBR (normally /dev/hda or /dev/sda).
- ¡ label=<name>
- Name (your own choice) for the system. Recommended, because the
- default-the raw device name-is less informative.
-
- 4.4.2 Other LILO configuration options
-
- The previous section covered the entries required in /etc/lilo.conf.
- Other useful options are discussed below.
- Those options that are marked as image options belong to the appropriate sec-
- tion of the operating system. The others are intended for the global parameter
- section of /etc/lilo.conf.
-
- * backup=<backup>
-
- 12 any_b.b (Booting from B:) and any_d.b (Booting from second hard drive) are obsolete
- from LILO-Version 20.
-
- 111
-
-
-
- 4. Booting and Boot Managers
-
- The file where LILO backs up the boot sector. The default is
- /boot/boot.xxxx, where xxxx is the internal device number of the
- installation partition.13
- We do not recommend you using a cryptic name (see our example above).
- You will not be able to use the implemented uninstall feature of LILO;
- but we think it is better to this carefully by hand, anyway. (see Section 4.5
- page 115)
-
- If the backup file exists, LILO does not create a new one. Make sure you
- use a name not already in use.
-
- * compact
- This option is recommended if you want to install LILO onto a floppy
- disk. If enabled, LILO tries to read more sectors at a time, resulting
- in a faster boot process. This does not work on every machine. We do
- not recommend that you set this as the normal way is safer and it only
- provides a difference of one or two seconds.
- * disk=<device file>
- bios=<BIOS device number>
- cylinders=<amount>
- heads=<amount>
- sectors=<amount> Here you can tell LILO precisely which BIOS
- device number and geometry it should use. This is scarcely ever needed.
- There is one major exception: IDE-SCSI system: If you own a BIOS that
- is capable of switching the boot devices SCSI prior to IDE and you want
- to use this feature, you need to tell LILO the switched order from the
- perspective of the BIOS. This is achieved by an extra entry in the global
- section of lilo.conf. An example for a system with one SCSI and one
- IDE disk may be seen in File contents 4.4.3.
-
- # Enable LILO to correctly access /dev/sda and /dev/hda
- # at boot time if their boot order is interchanged in
- # the BIOS:
- disk = /dev/sda # The SCSI disk is regarded as ...
- bios = 0x80 # ... first BIOS disk;
- disk = /dev/hda # the IDE disk is regarded as ...
- bios = 0x81 # ... second BIOS disk.
-
- File contents 4.4.3: lilo.conf Extract: Boot order: SCSI prior to IDE
-
- * linear This option causes all references to sectors to be written as
- logical instead of physical addresses. This option might be useful if LILO
- does not recognize the geometry of the hard disk correctly. Still, it does
- not make the 1024 cylinders limit obsolete. In practice, this is scarcely
- ever needed.
-
- 13 To be found in the kernel sources in /usr/src/linux/init/main.c, function parse_
- root_dev().
-
- 112
-
-
-
- 4.4. Configuring LILO
-
- The linear option does not remove the 1024 cylinders boundary! More-
- over it only works below an extended ("65535 heads limit") boundary,
- which with modern hard drive architecture is even more rigorous than with
- old hard drives: 512 MB / 1 GB / approx. 2 GB for 16 / 32 / 63 sectors per
- head.
-
- * message=<message-file>
- Points to a text file that should be shown on screen at system boot up.
- It should not contain more than 24 lines and can present an overview of
- the LILO boot selection to augment the information available by pressing
-
- TAB
- . Recommended.
-
- If this option is set, the message file is then part of the LILO boot ma-
- chinery and, after every change to this file, LILO has to be reinstalled
- (Section 4.5 on the next page).
-
- * password=<password>
- May be located either in a global or system-specific section. Provides
- secure access to LILO services, or booting the corresponding system,
- by means of a password. If you take this seriously, you should remove
- the password from lilo.conf after you have used it for the first time.
- As `root', you can set a new password for LILO any time you like
- (you just need to reinstall it afterwards) It is recommended to also set the
- option restricted, otherwise it could be possible to launch a shell,
- see manpage for lilo.conf (man lilo.conf)!
- * read-only
- This option tells the kernel to initially mount the root partition read-only,
- which is normal when starting Linux systems. If this is omitted, the kernel
- uses its internal settings.14
- * delay=<tenth-seconds>
- If the prompt is not explicitly set, you can order a prompt by press-
-
- ing ( Shift
- , Ctrl
- , Alt
- ). The delay= option sets the time to
- elapse before LILO boots the first system in its list. The default is 0, that
- is, no waiting.
- The delay option has no effect if a prompt is specifically requested by
- prompt.
- * vga=<mode>
- Selects VGA mode at startup. Valid modes are normal (80x25), ext
- (80x50) or ask (ask at boot-time).
- * append="<parameter>" Image option for Linux kernel. Enables
- kernel parameters and hardware components to be specified, in the same
- way that this is possible at the LILO prompt. The kernel first gets the
- append line, then the prompt. append="mcd=0x300,10".
-
- 14 This can be seen using the command rdev-R <kernelimage>. Installation kernels and freshly
- compiled ones have read-only set by default. Thus you do not normally need this option.
-
- 113
-
-
-
- 4. Booting and Boot Managers
-
- 4.5 Installing and Uninstalling LILO
- During a new Linux installation, or at a later time, YaST will lead you through
- the steps of how to install LILO interactively.
- In this section, we assume that some action is required that goes beyond what
- YaST can accomplish, and we take a closer look at how LILO works during
- the installing and uninstalling process.
-
- The installation of a boot manager is tricky! Ensure in advance that you
- are 100% able to boot Linux and other mounted systems. You must have
- fdisk installed on a crash recovery disk, otherwise you might find yourself
- in the awkward situation of not being able to access your hard disk at all!
-
- Installation After Changing the Configuration
- If any of the LILO components have changed, or you have modified your
- configuration in /etc/lilo.conf, you will have to reinstall LILO. This
- is easily done by launching the "Map Installer" like this:
- earth: # /sbin/lilo
- What happens now is that LILO writes a backup of the target boot sector,
- writes its first step into it and creates a new map file (see also Section 21
- page 106). LILO now announces each installed system-for an example see
- Output 4.5.1.
-
- Added Linux*
- Added Linux.old
- Added DOS
- Screen output 4.5.1: Output after launching LILO
-
- When the installation is complete, the machine can be rebooted:
- earth: # shutdown -r now
- During reboot, the BIOS first performs its system test and directly afterwards
- you will see LILO and its command prompt, where you can enter parameters
-
- and select a boot image from the recently installed configurations. TAB
- shows you a list of all systems installed.
-
- Installation After Recompiling a Kernel
- If you want to include a freshly created kernel into your LILO boot setup,
- the Linux kernel Makefile offers an all-in-one solution. All the commands
- to configure and create the kernel are put together in the file /usr/src/
- linux/Makefile; here the INSTALL PATH=/boot is specified (see
- Section 13.5 page 321). This Makefile has a target called bzlilo
- which, after a kernel compilation, automatically copies the currently in-
- stalled kernel /boot/vmlinuz (this used to be /vmlinuz) to /boot/
- vmlinuz.old, the new kernel to /boot/vmlinuz, and then re-installs
- LILO. This can be done by entering the command:
- earth:/usr/src/linux # make bzlilo
-
- 114
-
-
-
- 4.5. Installing and Uninstalling LILO
-
- instead of make zImage. This is only useful if you have edited /etc/lilo.
- conf in advance, and if your current kernel really is located in/boot/
- vmlinuz. The new, as well as the old, kernel should now be listed. See File
- contents 4.4.1 page 109 for an example of the resulting /etc/lilo.conf.
- At the LILO prompt, you can launch either of the two kernels. This makes
- your boot more secure, because you can still boot your old kernel even if the
- new one fails.
- For more on creating a new kernel, see Chapter 13 page 317.
-
- Uninstalling LILO
-
- Uninstalling a boot manager is tricky! Please ensure in advance that you
- are 100% able to boot Linux and other systems with their respective boot
- disks. You should have fdisk installed on every boot disk, otherwise you
- might find yourself in the unfortunate situation of not being able to access
- your hard disk at all!
-
- Perhaps one day it will be necessary for you to uninstall LILO :-( This is
- accomplished by writing back the target boot sector where LILO has been
- installed. This is not a problem in Linux if there is a valid backup (see
- Section 4.4.2 page 111, Option backup).
-
- A boot sector backup is no longer valid if the partition in question has got
- a new filesystem (for DOS users: has been formatted). The partition table
- of an MBR backup becomes invalid if the hard disk in question has been
- repartitioned in the meantime. Obsolete "backups" are time-bombs. It is
- best to delete them as soon as possible. Unpacking old and invalid backups
- into system sectors is a direct route to data loss!
-
- It is very simple to get back a DOS, Windows 95/98 or OS/2 MBR. Just enter
- the MS-DOS command (available since 5.0)
- C:\> FDISK /MBR
- or on OS/2
- C:\> FDISK /NEWMBR
- These commands only write the first 446 bytes (the boot code) into the MBR
- and leave partitions untouched.15
- For other restorations, first make a backup of the LILO sector in question-
- just to be on the safe side. Now you should check (at least twice :-) )
- whether your old backup file is the correct one and if it is exactly 512 bytes
- in size! Finally, write it back, but do not confuse if= and of=!
-
- * If LILO resides in partition yyyy (e. g., hda1, hda2,. . . ):
- earth: # dd if=/dev/yyyy of=New-File bs=512 count=1
- earth: # dd if=Backup-Date of=/dev/yyyy
-
- 15 Assuming that the MBR (Section 4.1 page 103) has valid code. If not, it is considered invalid
- and the partition table is moved to "null".
-
- 115
-
-
-
- 4. Booting and Boot Managers
-
- * If LILO resides in the MBR of zzz (e. g., hda, sda):
- earth: # dd if=/dev/zzz of=New-File bs=512 count=1
- earth: # dd if=Backup-Date of=/dev/zzz bs=446 count=1
-
- The last command is "cautious" and does not overwrite the partition table.
- Again, do not forget: with fdisk you should mark the desired starting
- partition as bootable. By the way, note how easy and fast a boot sector backup
- is done. We recommend you do this frequently!
-
- 4.6 Creating a Linux Boot Disk
- A Linux boot disk consists (somewhat simplified) of one or more Linux ker-
- nels, possibly managed by LILO. It serves to start up your system even if it
- is not possible to boot directly from hard disk (possible reasons: overwritten
- MBR, misconfigured boot manager, errors while installing, etc.).
- A boot disk such as this loads only the kernel. Everything else, including
- working system programs and init start scripts) must be provided by the
- installation on the hard drive. The connection between the boot disk and the
- system on the hard drive is established by the fact that in the kernel the root
- partition in question is set as the root device.
- Do not confuse this with the SuSE boot disk which is used for installation
- and emergencies. If you need to create a new SuSE boot disk, you copy
- the appropriate image from the directory disks on the SuSE CD-ROM to a
- floppy disk (see Section 16.5 page 389 ).
-
- Boot Disk Without LILO
- If your kernel does not need any hardware parameters, the easiest way to
- create a boot disk is to just write the actual kernel onto a raw disk and to
- adjust the root device (if this has not been done before).
- earth: # dd if=Your_Kernel of=/dev/fd0 bs=18k
- earth: # rdev /dev/fd0 Your_Root_Partition
- earth: # rdev -R /dev/fd0 1
-
- The last command makes sure that the kernel initially mounts root as read-
- only (the startup scripts expect this).
-
- Boot Disk with LILO
- You can create a much more capable boot disk with a greeting, prompt, ker-
- nel parameters and other LILO goodies, by transferring the complete LILO
- booting start machinery onto the disk (see Section 21 page 106). For this, the
- disk needs a filesystem; the Minix filesystem is best suited for this.
- To do this, proceed as follows:
- * Create a Minix filesystem on a new and empty floppy disk and mount the
- disk to, for example, /mnt, with the commands:
- earth: # /sbin/mkfs.minix -c /dev/fd0 1440
- earth: # /bin/mount /dev/fd0 /mnt
-
- 116
-
-
-
- 4.7. Sample Configurations
-
- * Now copy your kernel files and the LILO file /boot/boot.b to /mnt,
- for example, onto the floppy disk.
- * Optional: create a message file /mnt/message.
- * Create lilo.conf on /mnt. You need to adapt this to your needs
- (give the correct name of the kernel, etc.). See File contents 4.6.1 for
- an example.
-
- # LILO Configuration file bootdisk
- # Start LILO global Section
- boot=/dev/fd0 # Installation: Floppy
- install=/mnt/boot.b # Of course LILO and
- map=/mnt/map # map file onto floppy!
- message=/mnt/message # optional
- prompt
- timeout=100 # Wait at prompt: 10 s
- vga = normal #
- # End LILO global section
- ## Linux bootable partition config begins
- image = /mnt/First_Kernel # default
- root = /dev/Your_Root_Device # Here is your root partition!
- label = linux
- # Linux bootable partition config ends
- ## System sections for more kernel here:
- File contents 4.6.1: lilo.conf for a bootdisk
-
- * Install LILO with this lilo.conf:
- earth: # /sbin/lilo -C /mnt/lilo.conf
-
- * Unmount the floppy-that's it!
- earth: # /bin/umount /mnt
-
- * Do not forget to check your boot disk at the next system start to check
- whether it works or not :-)
-
- 4.7 Sample Configurations
- If Linux is the only operating system on your machine, there is nothing to do,
- since everything needed has already been done by YaST.
- Now we will give you some example configurations. Please have a look at
- /usr/doc/howto/mini/Linux+*.gz, here you will see some config-
- uration files for LILO.
-
- 4.7.1 DOS/Windows 95/98 and Linux
-
- Requirements: There must be at least a primary partition for each of
- DOS/Windows 95/98 and Linux which is below the 1024 cylinders limit
- (Section 22 page 107).
-
- 117
-
-
-
- 4. Booting and Boot Managers
-
- For this case, we have already discussed a configuration (File contents 4.4.1
- page 109) - only the settings for root=, image= and other= have to be
- adapted. LILO is installed in the MBR. You should omit the Linux.old if
- you do not have an old kernel installed.
- Save your /etc/lilo.conf and be sure you have a Linux boot disk.
- Windows 95/98 feels especially inclined to eliminate "foreign" MBRs. If
- you can still boot Linux using your boot disk, this problem is quickly solved
- with the command
- earth: # /sbin/lilo
- which will complete your LILO installation.
-
- 4.7.2 Windows NT and Linux on One Hard Disk
- 1. If Windows NT and Linux need to co-exist on the same hard disk, you
- should use the NT boot manager for booting. This can either start the
- kernel images or the boot sectors themselves. Execution of the following
- steps prepares everything for a peaceful coexistence of Linux and Win-
- dows NT:
- * Install NT.
- * Partition the NT disks (using FAT so that Linux can write on it).
- * Install Linux as usual (in our example, the root partition is on /dev/
- sda3). Mount either the DOS partition or an error free DOS floppy
- disk (for example, on /dos).
- * Install LILO, but install it in Linux' root partition (/dev/sda3),
- not in the MBR (/dev/sda). You may still configure a selection
- of Linux kernels for LILO. See File contents 4.7.1 for an example
- lilo.conf.
-
- # LILO Configuration file
- # Start LILO global Section
- boot=/dev/sda3 # Target of installation
- backup=/boot/boot.sda3.970428 # Backup previous boot sector;
- # 28. Apr 1997
- prompt
- timeout=100 # Wait at prompt: 10 s
- vga = normal # force sane video state
- # End LILO global section
- # Linux bootable partition config begins
- image = /vmlinuz # default image to boot
- root = /dev/sda? # Here the root partition!
- label = Linux
- # Linux bootable partition config ends
- File contents 4.7.1: lilo.conf for booting a Linux root partition
-
- * Copy the LILO boot sector to a location where NT can find it; e. g.:
-
- earth: # /bin/dd if=/dev/sda3 bs=512 count=1 of=/dos/bootsek.lin
-
- This step as well as the following has to be performed after every
- kernel update.
-
- 118
-
-
-
- 4.7. Sample Configurations
-
- * Boot NT. Copy bootsek.lin from data disk to main directory of
- NT's system drive (if it is not already there).
- * In boot.ini (first setting attributes), supplement at the end:
-
- c:\bootsek.lin="Linux"
-
-
- * After the next boot (if everything went smoothly), there should be an
- entry in NT's boot manager.
- 2. Another possibility: install LILO in the MBR and claim that it's DOS to
- Windows NT (as in our previous example).
-
- NT 3.5* does not recognize Linux' partition types 82 and 83. Make sure
- that no NT program tries to "repair" your partition table. This would result
- in loss of data! Always have valid backups of the LILO boot sector at
- hand.
-
- 4.7.3 OS/2 and Linux
-
- 1. Use the OS/2 boot manager for booting. It can launch unlimited primary
- and logical partitions provided they are below the 1024 cylinders limit.
- The user is responsible for the partitions. This boot manager is configured
- by OS/2's fdisk.
- Preparation on the Linux side: consists merely of making a partition
- bootable (usually this is the root partition) with LILO. You can use the
- same lilo.conf as in the Windows NT example, but there is one thing
- that you have to consider in advance. . .
- Preparation on the OS/2 side: OS/2 not only uses the conventional and
- obvious entries for existing partitions in MBRs on hard disks, but also
- uses "waste" space in these sectors for additional information.16 If these
- are inconsistent, OS/2's fdisk considers these partitions faulty and re-
- fuses to provide boot manager services. The fdisk commands of other
- systems do not know how to handle these extra partitions. . . Conflicts are
- inevitable.
- Therefore: before installing Linux, load OS/2 (the installation system
- is sufficient) and create the Linux partitions with OS/2's fdisk, at least
- the logical drives. This initially creates additional OS/2 partitions, which
- might get in the way. Solution: immediately after creating the partitions,
- load the Linux installation system (or the rescue disk from the SuSE Linux
- CD) and change the partition types to 83 (Linux native) using fdisk. Now
- these partitions will be ignored by OS/2.
- 2. 2nd option: Install LILO as the main boot manager on a primary partition
- on the first hard drive.17 This special case is also considered in our next
- example, where DOS is additionally involved.
-
- 16 A new Support Data Base article is about to be written: keyword "OS/2".
- 17 It is not a good idea to install in the MBR, as repartitioning with another fdisk could erase the
- MBR and thus remove LILO.
-
- 119
-
-
-
- 4. Booting and Boot Managers
-
- 4.7.4 DOS, OS/2 and Linux
- 1. If you have used the OS/2 boot manager for DOS and OS/2 and want to
- continue using it, simply add Linux to its start menu as described in the
- previous example.
- 2. If you have LILO installed as the main boot manager on a primary par-
- tition of the first hard disk, then the following, intentionally complicated
- example for lilo.conf (File contents 4.7.2) assumes that the DOS and
- Linux boot partitions are primary and on the first hard drive, whereas
- OS/2 resides on the second hard drive-all of them below the 1024 cylin-
- ders limit. OS/2 is on the second drive. This is why a special loader
- (/boot/os2_b.b instead of /boot/chain.b) is used. The MBR
- code might be either from DOS or OS/2 (it doesn't matter which). The
- LILO boot partition (/dev/sda4) must be marked as active, with any
- fdisk.
-
- # LILO Configuration file
- # Start LILO global Section
- boot = /dev/sda4 # LILO in Linux root partition
- backup = /boot/boot.sda4.970428
- message = /boot/message # Greeting message
- prompt
- delay = 100
- vga = normal
- ## Linux bootable partition config begins
- image = /vmlinuz
- label = linux
- root = /dev/sda4
- # Linux bootable partition config ends
- ## OS/2 bootable partition config begins
- other = /dev/sdb5
- table = /dev/sdb
- label = os2
- loader = /boot/os2_b.b
- # OS/2 bootable partition config ends
- ## DOS bootable partition config begins
- other = /dev/sda1
- table = /dev/sda
- label = dos
- # DOS bootable partition config ends
-
- File contents 4.7.2: LILO with DOS, OS/2 and Linux on two hard disks
-
-
-
-
-
-
-
- 120
-
-
-
- 4.8. LILO Problems
-
- 4.8 LILO Problems
-
- Some Guidelines
- Some simple guidelines at the beginning will avoid most LILO problems in
- advance (this is taken from the LILO documentation [Alm94]):
- * Do not panic! If anything does not work, try to find the error and/or the
- cause first; check the diagnosis before you start fixing the problem.
- * Always have an up-to-date and tested boot disk at hand.
- * SuSE Linux contains a full Linux system on its boot disk and installation
- CD (for the rescue system, see Section 16.5 page 389), to allow you to
- reach all your Linux partitions. Tools are included for repairing almost
- any problems that can occur.
- * Read the complete LILO documentation, especially if the system does
- not do what you want it to do.
- * Check /etc/lilo.conf before using the map installer (/sbin/
- lilo).
- * Be careful if you are using a large hard drive, or multiple ones. You need
- to be aware of the 1024 cylinders limit.
- * Try with and without the linear option (normally it should be better
- without!).
-
- 4.8.1 Diagnosis of Errors: LILO Start Messages
- This is mainly section 5.2.1 from [Alm94].
- When LILO loads itself, it displays the word `LILO'. Each letter is printed
- before or after performing some specific action. If LILO fails at some point,
- the letters printed so far can be used to identify the problem.
- nothing No part of LILO has been loaded. Either LILO is not installed at
- all or the partition on which it's boot sector is located isn't active.
- `L' error ... The first stage boot loader has been loaded and started, but it
- can't load the second stage boot loader (/boot/boot.b). The two-digit
- error codes indicate the type of problem. This condition usually indicates
- a media failure or a geometry mismatch.
- `LI' The second stage has been invoked but could not be started. This can
- either be caused by a geometry mismatch or by moving /boot/boot.b
- without reinstalling LILO.
- `LIL' The second stage of boot loader has been started, but it can't load the
- descriptor table from the map file. This is typically due to a physical error
- of the boot device or a faulty disk geometry.
- `LIL?' The second stage boot loader has been loaded at an incorrect ad-
- dress. This is typically caused by a subtle geometry mismatch or by mov-
- ing /boot/boot.b without reinstalling LILO.
- `LIL-' The descriptor table (in the map file) is corrupt. This can either be
- caused by a geometry mismatch or by moving /boot/boot.b without
- reinstalling LILO.
- `LILO' All parts of LILO have been successfully loaded.
-
- 121
-
-
-
- 4. Booting and Boot Managers
-
- The most common causes for geometry errors are not physical defects or
- invalid partition tables but errors in LILO installation, including:
-
- * disregarding the 1024 cylinders limit (see next section)
- * an unsuccessful attempt at starting LILO from a logical partition
-
- 4.8.2 The 1024-Cylinder Limit
-
- As emphasized before (e.g. page 107), the entire LILO machinery (e. g., any
- data that is needed for booting) must be able to process BIOS calls (which
- means it must reside below the 1024 cylinders limit on the hard drive). The
- sections of the hard drive that can be used (these are called allowed sections)
- have already been discussed.
- This restriction affects only the boot-up machinery. It is not required that
- LILO be installed on the Linux root partition. It is even possible (but quite
- dangerous, too) to put the boot machinery onto partitions of other operating
- systems to which Linux has read and write access.
-
- Never install the LILO boot sector onto an unknown partition because you
- will severely damage the filesystem!
-
- * The best method is to create a primary partition (within the allowed sec-
- tion) and to install all LILO files (including the LILO boot sector) into
- this partition. This will be, in most cases, the Linux root partition.
- You can also add it to /boot with YaST. The only condition is that there
- has to be enough space for
- ¡ boot.b, map, message, and
- ¡ the Linux kernels that LILO should boot.
- A few megabytes is enough. It does not matter where you put the rest
- of your partitions. There are no more restrictions. As soon as the kernel
- runs, you have unrestricted access to all installed drives.
-
- But what to do if there is no space for such a partition? If you neither want
- to repartition your hard drive, upgrade to SCSI, nor want to purchase a new
- BIOS version, there are still two (makeshift) possibilities:
-
- * Use a boot disk instead of LILO on the hard drive, or, if you are also
- running MS-DOS, you can use loadlin as well.
- * Install the LILO boot machinery onto a Linux partition which is in the
- permitted section and where Linux has write access (e. g., a FAT/VFAT
- drive). We cannot put the LILO boot sector there as well! So there are
- only two places to put it. Either at the start of an extended partition on
- the first drive-as long as it is beneath the 1024 cylinders limit-or on the
- MBR.
- Suppose that the partition in question is mounted on /mnt, that LILO
- is installed in the MBR (/dev/hda), and that you also boot DOS from
- /dev/hda1. Then you should proceed as follows:
-
- 122
-
-
-
- 4.8. LILO Problems
-
- ¡ Create a new directory (e. g., /mnt/LINUX) and copy the LILO files
- mentioned above to it: boot.b, map, message, as well as the chain
- loader of other operating systems (normally chain.b) and finally the
- Linux kernels that LILO should boot.
- ¡ Create a /mnt/LINUX/lilo.conf where all paths point to /mnt/
- LINUX (see File contents 4.8.1).
-
- # LILO Configuration file
- # Start LILO global Section
- boot=/dev/hda # Installation target
- backup=/mnt/LINUX/hda.xxxx # backup of old MBR
- install=/mnt/LINUX/boot.b # Of course LILO and
- map=/mnt/LINUX/map # map file are in /mnt/LINUX!
- message=/mnt/LINUX/message # optional
- prompt
- timeout=100 # Wait at prompt: 10 s
- vga = normal #
- # End LILO global section
- ## Linux bootable partition config begins
- image = /mnt/LINUX/First_Kernel # default
- root = /dev/Your_Root_Device # Root partition!
- label = linux
- # Linux bootable partition config ends
- ## System section for other kernels:
- ## End Linux
- # DOS bootable partition config begins
- other = /dev/hda1 # MSDOS system drive
- label = dos
- loader = /mnt/LINUX/chain.b
- table = /dev/hda
- # DOS bootable partition config ends
-
- File contents 4.8.1: lilo.conf for other partitions
-
- ¡ Install LILO with this lilo.conf:
- earth: # /sbin/lilo -C /mnt/LINUX/lilo.conf
- After that, LILO should work. Boot MS-DOS and protect the LILO
- files as well as possible against write access (just to remind you: any
- write access disables LILO). To accomplish this, you should assign to
- all files in X:\LINUX (where the `X' is the DOS drive mounted to
- /mnt) the DOS attributes system and hide.
-
- In conclusion, we point you toward two HOWTOs in /usr/doc/howto/
- en/mini/-LILO.gz and Large-Disk.gz.
-
- 4.8.3 Special Boot Problems with Kernels from 2.0 Onwards
-
- 123
-
-
-
- 4. Booting and Boot Managers
-
- Problems
- Problems booting with LILO might occur after part of the kernel has been
- loaded. (e. g., a SuSE installation kernel):-(
- You can select a kernel at the LILO prompt and this kernel is loaded (some
- dots are output onto the screen) but starting the kernel fails. Before reaching
- "uncompressing Linux" the system crashes with different behaviors.
- Possible error messages:
- * System reboots
- * System just hangs
- * "crc-error"
- * "no free space"
- * "Error 0x00"
- * "Error 0x01"
- * "incomplete literal tree"
- Thereafter, access on the floppy is attempted but the system hangs.
-
- Cause
- The cause lies in a combination of a big kernel, LILO and faulty hardware.
- This affects roughly 1% of all machines.
- We assume that this is due to a faulty BIOS that has problems with fast
- memory access.
- This problem does not occur, if:
- * the machine is booted via loadlin
- * the kernel has been copied to a floppy
- dd if=/vmlinuz of=/dev/fd0
-
- and booted from there
- * a smaller kernel is used, which has been created with
- make zImage
-
- (e. g., an older 1.2.13 kernel) is booted via LILO
- The following BIOS settings do not cause any problems either:
- * Disable Internal Cache
- * DRAM Precharge Wait State value: 1 and
- * DRAM Wait Burst Timing value: 0x3333
-
- Solution
- First of all, you should be able to install a system. So, if you can neither boot
- via loadlin nor via setup you should use an old kernel 1.2.13 boot disk for
- installation. If you do not have such a disk at hand, you should change the
- BIOS settings accordingly.
- After a successful installation, the question is how you want to boot in the
- future. First, you should use the same media as during installation. loadlin
-
- 124
-
-
-
- 4.9. Starting via loadlin
-
- from DOS should not cause any problems. With a boot disk, you should enter
- the following parameters:
- load ramdisk=0 root=/dev/???
- where ??? is your root partition (e. g., /dev/hda1). Thereafter, you should
- build your own kernel, since this can be booted using LILO.
-
- 4.9 Starting via loadlin
- Now we want to offer an alternative to boot SuSE Linux, loadlin. The pro-
- gram loadlin is a DOS program that is capable of booting a Linux kernel
- from a DOS directory. Thus loadlin perfectly integrates itself into an existing
- DOS/Windows 9x environment. As no entry in the MBR is needed, Win-
- dows only notices one or more partitions with unknown ID's. The risk of
- unwanted side effects due to a Linux installation is thus minimized.
- The procedure described below works on both Windows 95 and Windows 98.
- The files themselves have been written in Windows 95; for this reason we wiil
- just talk about Windows 95.
- In principle, there are two ways of activating loadlin. One is to switch be-
- tween various systems via a boot menu, or to start Linux via loadlin from
- another running system.
- Both methods have advantages and disadvantages:
- * A boot menu saves you the trouble of having to start another operating
- system first, before you can start Linux.
- * You can add other configurations to your boot menu to create a universal
- starting mechanism.
- * You need to modify start files, however, to build a boot menu; which you
- will have to do by trial and error.
- * Changing to Linux from the DOS prompt is very simple.
- * A Linux start can be very nicely integrated into a Windows 95 session.
- Double clicking an icon will start Linux (Windows 95 contains DOS 7.0).
-
- You should use a boot menu if you are using DOS or Windows 3.x. If
- using Windows 95, you can start most easily from the running system.
- Start menus in Windows 95 are a very complex matter. We are only able
- to give you some hints about them.
-
- 4.9.1 Necessary Steps for all loadlin Users
- This is what you need to do, whether you decide to use a boot menu, or to
- start from a running system (in DOS, Windows 3.x, or Windows 95):
- 1. You may have already installed loadlin (this was done in Section 2.5.4
- page 46). If not, do so now using setup.
- 2. Change to c:\loadlin in MS-DOS. There you will find a file called
- linux.par. Create a file named startlin.bat (you can give it
- another name). Now insert the line described in File contents 4.9.1 on the
- following page:
-
- 125
-
-
-
- 4. Booting and Boot Managers
-
- c:\loadlin\loadlin @c:\loadlin\linux.par
-
- File contents 4.9.1: Example of a batch file for starting Linux
-
- c:\loadlin\vmlinuz # first value must be
- # the filename of the Linux kernel
-
- root=/dev/xxx # the device which gets mounted as root FS
-
- ro # mount root read-only
-
- File contents 4.9.2: Example of the file linux.par with customized values
-
-
- Next, edit the file linux.par (File contents 4.9.2).
- Instead of xxx, enter your root partition's device name (you wrote
- down this name in Section 2.10.2 page 66). startlin.bat starts
- Linux. The file linux.par is used by startlin.bat as well as by
- config.sys, and contains essential parameters. Later on, when you are
- more familiar with Linux, you can add or replace parameters here. If you
- have built a kernel of your own, just copy it to c:\loadlin\vmlinuz
- and from then on this kernel will be booted.
-
- 4.9.2 Setting up Boot Menus
-
- Here's how to configure a boot menu in DOS or Windows 3.x:
-
- 1. First, define a boot menu section in your c:\config.sys file. Open
- c:\config.sys in an editor and enter something similar to the File
- contents 4.9.3.
-
- [Menu]
- menuitem=Win, starting Windows,...
- menuitem=DOS, starting DOS, MS-DOS...
- menuitem=Linux, starting Linux...
- menucolor=15,1
- menudefault=Win,5
-
- File contents 4.9.3: Example of first part of Linux boot menu in
- c:\config.sys
-
- Under the label [Menu], define an entry in the boot menu for each OS
- you want to boot. Also, define the menu's color and after how many
- seconds each OS will be automatically started.
- 2. Below these entries, enter the labels [Common], [Win], [DOS], and
- [Linux]. Commands entered in [Common] are always executed. All other
- entries are OS specific. See the example in File contents 4.9.4 on the fac-
- ing page. As a guide, you can use the lines in your own config.sys.
- An example may be found in: File contents 4.9.4 on the next page.
- Now save the file with your changes.
-
- 126
-
-
-
- 4.9. Starting via loadlin
-
- [Common]
- device=c:\dos\himem.sys /testmem:off
- device=c:\dos\emm386.exe noems I=E000-F4FF
- dos=high,umb
- files=30
- buffers=10
- shell=c:\dos\command.com
-
- [Win]
- devicehigh=c:\dos\dblspace.sys /move
- devicehigh=c:\cd\slcd.sys /D:SONY_000 /B:340 /M:P /V /C
-
- [DOS]
- devicehigh=c:\dos\dblspace.sys /move
- devicehigh=c:\cd\slcd.sys /D:SONY_000 /B:340 /M:P /V /C
-
- [Linux]
- shell=c:\loadlin\loadlin.exe @c:\loadlin\linux.par
-
- [Common]
- rem Remains blank
-
- File contents 4.9.4: Example of second part of Linux boot menu in
- c:\config.sys
-
- 3. Next, edit c:\autoexec.bat. Here you must put the same labels and
- assign entries to labels, except the notation differs slightly. See the ex-
- ample in File contents 4.9.5 on the following page. Notice that the Linux
- case is not mentioned here because Linux is booted using loadlin directly
- from the c:\config.sys file. The variable %config% contains the
- selected label (:Win or :DOS). Customize the code to fit your machine.
- 4. If you now boot your machine, the boot menu appears and you have five
- seconds to choose an operating system. Then Windows starts automat-
- ically (menudefault=Win,5). If you select `Linux', Linux starts and
- awaits your login.
-
- 4.9.3 Starting Linux from Within Windows
- To create a start icon for Linux, to boot Linux from within a running Win-
- dows 95 session:
- 1. Open Windows Explorer. Change to c:\loadlin. With the right
- mouse button, click on the file startlin.bat and select `Create
- Shortcut'.
- 2. Drag the shortcut onto the desktop.
- 3. Click on `Shortcut to startlin.bat' with the right mouse but-
- ton and select `Properties'. Go to tab `Program', click on the
- button `Advanced' and click `MS-DOS mode' on. Confirm with
- `OK'.
- 4. Click the `Change icon' button and select a nice icon; give the short-
- cut a suitable name; Voila!
-
- 127
-
-
-
- 4. Booting and Boot Managers
-
- @echo off
-
- rem Entries for all Configurations
- switches= /f
- set comspec=c:\dos\command.com
- prompt $p$g
- loadhigh c:\dos\keyb gr,,c:\dos\keyboard.sys
- loadhigh c:\dos\doskey
- set temp=c:\temp
- loadhigh c:\dos\mscdex.exe /D:SONY_000 /E /V /L:H
- c:\logimaus\mouse.exe
-
- goto %config%
-
- :Win
- c:\dos\smartdrv.exe a- b- c+ 2048 1024
- path c:.;d:.;c:\windows;c:\dos;c:\util;
- win :
- c:\dos\smartdrv /C
- goto ende
-
- :DOS
- path c:.;d:.;c:\dos;c:\util;
- goto ende
-
- :ende
- echo * Goodbye *
-
- File contents 4.9.5: Example of autoexec.bat supporting Linux boot
- menu
-
- 5. Double clicking this new shortcut should bring up a dialog box telling
- you that Windows 95 is about to switch to DOS mode. If this dialog box
- bothers you, you can turn it off in the properties menu.
-
- 4.9.4 The Windows Boot Menu
- This is how you install a boot menu for Windows 95:
-
- 1. You must edit the file c:\msdos.sys. First, make the file visible by
- entering: C:> attrib -R -S -H c:\msdos.sys
- This is a text file where you have to enter some lines to deactivate the
- Windows 95 start menu. The [Options] label should resemble File con-
- tents 4.9.6 on the next page.
- The parameter Logo=0 is optional and avoids switching to graphics
- mode before Windows 95 is started. Booting is much faster and you avoid
- lots of trouble if you plan to use the DOS emulator in Linux later on.
- The parameter BootGUI=0 is for booting Windows 95 directly into DOS
- mode. To start Windows from this you have to enter:
- C:> win but this is already done by our example c:\autoexec.bat
- if you have selected Win95 from our menu.
-
- 128
-
-
-
- 4.9. Starting via loadlin
-
- [Options]
- BootGUI=0
- BootDelay=0
- BootMenu=0
- Logo=0
-
- File contents 4.9.6: msdos.sys to start Linux using a Windows 95 boot
- menu
-
- 2. Next, define your boot menu in c:\config.sys. See File con-
- tents 4.9.7) for an example.
-
- [Menu]
- menuitem=Win95, start Windows 95...
- menuitem=DOS, start MS-DOS...
- menuitem=Linux, start Linux...
- menudefault=Win95,5
-
- File contents 4.9.7: Example config.sys (part one) for starting Linux
- using a boot menu with Windows 95
-
- Under the Label [Menu], define entries for the boot menu, its color and
- the delay in starting up automatically.
- 3. Further down in config.sys, enter labels [Win95], [DOS],
- [Linux], and [Common]. [Common] is for entries that apply every
- time (this will very rarely be the case in Windows 95). All other labels
- are for the corresponding operating system. Use those lines that are al-
- ready written in your config.sys. The example in File contents 4.9.8,
- should only be regarded as a hint.
-
- [Win95]
- dos=high,umb
- device=c:\windows\himem.sys /testmem:off
-
- [DOS] device=c:\plugplay\drivers\dos\dwcfgmg.sys
- dos=high,umb
- device=c:\windows\himem.sys /testmem:off
- device=c:\windows\emm386.exe noems I=B000-B7FF
- devicehigh=c:\cdrom\torisan.sys /D:TSYCD3 /P:SM
-
- [Linux]
- shell=c:\loadlin\loadlin.exe @c:\loadlin\linux.par
-
- [Common]
- accdate=C+ D+ H+
- switches= /F buffers=20
-
- File contents 4.9.8: Example config.sys (part two) for starting Linux
- using a boot menu with Windows 95
-
- Now save this file.
-
- 129
-
-
-
- 4. Booting and Boot Managers
-
- 4. Next, edit c:\autoexec.bat. Here, the same labels are entered, but
- the notation is slightly different. The label which has been selected is
- written to the variable %config%. Notice that the Linux case is not in-
- cluded here, because Linux is booted using loadlin directly from the
- config.sys file. Your entry should look something like File con-
- tents 4.9.9.
-
- @echo off
- loadhigh keyb gr,,c:\windows\command\keyboard.sys
- goto %config%
-
- :Win95
- win
- goto ende
-
- :DOS
- path c:.;d:.;c:\windows\command;c:\util;
- loadhigh c:\windows\command\mscdex.exe /D:TSYCD3 /L:x
- loadhigh c:\windows\command\doskey
- c:\windows\command\mouse.exe
- goto ende
-
- :ende
- echo * And now? *
-
- File contents 4.9.9: Example autoexec.bat for starting Linux in Win-
- dows 95
-
- When you have finished editing the file, don't forget to save it.
- 5. If you now boot your machine, the Windows 95 boot menu should appear,
- giving you two seconds to select an entry. If you choose Command line,
- your own boot menu will be displayed. Now you have five seconds to
- select an operating system. After this delay, Windows 95 starts automati-
- cally. If you select `Linux', Linux starts and awaits your login.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 130
-
-
-
-