The Loadlin+Win95 mini-HOWTO

Authored by: Chris Fischer, protek@brigadoon.com

v1.4.6, 13 March 1999


This document describes how to use Loadlin with Windows 95 to boot to Linux.

1. Introduction

2. IMPORTANT: Preliminary Information and Setup

3. Getting started:

4. *** Use this section ONLY if you are using a DOS 6.x boot disk.***

5. Final Steps

6. Alternate Methods for Auto-Booting Linux, Especially for Users With a FAT32 File System.

7. Frequently Asked Questions:

8. Credits


1. Introduction

This document describes how to easily use a combination of Windows 95's Boot Menu and Loadlin.exe to autoboot Linux using the F4 Function Key. This procedure should work with Windows 95 versions 4.00.950, 4.00.950a, and 4.00.95b with FAT16, and all versions of Linux that support Loadlin. If you prefer to use the LILO boot manager, please consult the Linux+Win95 Mini-HOWTO.

There are also two alternate methods for dual booting between Linux and Windows 95 using Loadlin for users using FAT32 with Windows 95 version 4.00.950b.

1.1 Copyright

The Loadlin+Win95 mini-HOWTO is copyright (C) 1997- 1998 by Protek Computer Solutions. This document may be reproduced and distributed in whole or in part, in any medium physical or electronic, as long as this copyright notice is retained on all copies. Commercial redistribution is allowed and encouraged; however, the author would like to be notified of any such distributions.

1.2 New Versions Of This Document and Windows 98

This mini-HOWTO is posted first at The Linux+Windows 95 Reference Page, so check there to make sure you have the most recent revision of this mini-HOWTO. You will also find a link there for dual booting with Windows 98. The next revision of this mini-HOWTO will be a major revision and will include information on dual booting with Windows 98.

1.3 Feedback

Questions, comments, and suggestions are welcome. I am always looking for ways to improve and expand this mini-HOWTO. I rely heavily on feedback to make improvements, and will do my best to be prompt with a helpful response. I can be reached at protek@brigadoon.com.

1.4 Disclaimer

Every attempt has been made to ensure that the information presented in this mini-HOWTO is safe and accurate. However, this information is given without any warranty, either expressed or implied, as to its suitability for a particular use. It is generally considered a GoodThing(TM) to make backups of your system files before changing system configurations and/or files. I suggest you take this precaution "just in case".


2. IMPORTANT: Preliminary Information and Setup

2.1 WARNING! for Windows95 OSR2 (version 4.00.950b) users:

Do NOT attempt dual booting with Windows 95 without first consulting the Windows 95 OSR2 FAQ. The FAQ also contains a great deal of information regarding FAT32. In a nutshell, if you have OSR2 and are using a FAT16 file system, you can still dual boot using the F4 Function Key.

NOTE: If you have Windows 95 OSR2, and are using a FAT32 file system, then the dual booting methods in this mini-HOWTO using the F4 Function Key will not work and should not be attempted.

However, there are a couple of alternate methods you can use to automate booting Linux at startup, which are discussed in Section 6.

2.2 Things that are assumed:

2.3 Items you need before you start:

NOTE: If your hard drive already contains the autoexec.dos, config.dos, io.dos, msdos.dos, and command.dos files, then you will not need the floppy. You can check by typing: dir and dir /ah at the root of Drive C. Also, if you installed the upgrade version of Windows 95, then it is likely that you have them.


3. Getting started:

3.1 Determine what version of Windows 95 you have.

Boot your computer to Windows 95 and right click on the My computer icon. Now left click on Properties. On the General Tab, look under the "System:" line. There you will see the version number.

3.2 Determine if you are using the FAT32 file system.

NOTE: If you have Windows 95 version 4.00.950b, make certain you are not using the FAT32 file system. Double click the My Computer icon, then right click the Drive C icon. Left click on Properties. On the General tab, the "Type:" line will indicate whether or not you have a FAT32 file system. If you are using the FAT32 file system, then go directly to Section 6 . Otherwise, continue with Section 3.3.

3.3 Make sure filename extensions are visible in Windows Explorer.

NOTE: If your hard drive already contains the *.dos files mentioned in the NOTE: of Section 2.3, then skip to the next NOTE:. Otherwise, continue with Section 3.4.

3.4 Rename your system files.

3.5 Important Warning.

NOTE: If you do not have Windows 95 OSR2 (version 4.00.950b), please skip to Section 3.6.

NOTE: If you are using a DOS 6.x boot disk skip to Section 4, otherwise continue with the next step.

3.6 Edit your system files.



 Loadlin DriveLetter:\LinuxKernelFile root=/dev/LinuxBootPartition ro

Here is my Autoexec.dos file as an example:



 Loadlin f:\vmlinuz root=/dev/hdc2 ro

NOTE: The kernel, as well as the Loadlin.exe, file may be anywhere on your hard drive as long as you reference the correct path. For example, if your kernel file was located in the directory e:\linux\kernels and Loadlin.exe was located in the directory c:\utils, you would use:



 c:\utils\loadlin e:\linux\kernels\vmlinuz root=/dev/hdc2 ro


4. *** Use this section ONLY if you are using a DOS 6.x boot disk.***

4.1 Edit and Rename your DOS 6.x system files.



 shell=loadlin.exe LinuxKernelFile root=/dev/LinuxBootPartition ro

Here is my Config.dos file as an example:



 shell=f:\loadlin.exe f:\vmlinuz root=/dev/hdc2 ro

NOTE: The Loadlin and kernel file may be anywhere on your hard drive as long as you reference the correct path. For example, if your Loadlin file was in the directory f:\utils and the kernel file was located in the directory e:\linux\kernels you would use:



 shell=f:\utils\loadlin.exe e:\linux\kernels\vmlinuz root=/dev/hdc2 ro


5. Final Steps

5.1 Almost Finished



 [Options] 
 BootMulti=1

5.2 You are finished!

Now all you have to do is reboot (Don't forget to remove the floppy disk). When you see "Starting Windows 95...", press the F4 Function Key and Linux should boot right up.

5.3 How it works.

Windows 95 has a built in Boot Menu. By default you do not see it at startup (although you can change that if you wish), but you can get to it by pressing the F8 Function Key when you see "Starting Windows 95...". On the menu you will see several options. The last option is "Previous version of MS-DOS". Instead of pressing F8 and then selecting "Previous version of MS-DOS", you can use the F4 shortcut by pressing F4 when "Starting Windows 95..." appears on the screen. When Windows 95 boots to the previous version of MS-DOS, it uses the files that end in the .dos file extension. This is why it is important to have a 0K Config.dos file if you are initiating Linux from the Autoexec.dos file. If Windows 95 does not find the files with a .dos extension while trying to boot the previous operating system, it will load the Windows 95 startup files. Therefore, if you do not have a Config.dos file, Windows 95 will load all the drivers in your Config.sys file. While this will not prevent Linux from loading, it will take longer. Having a 0K Config.dos file prevents Windows 95 from reading your Config.sys file while booting to the previous version of MS-DOS.


6. Alternate Methods for Auto-Booting Linux, Especially for Users With a FAT32 File System.

This section will work for all versions of Windows 95 to date, regardless of whether you have a FAT32 file system. There are two methods I will discuss in this section. First, I'll start with the simplest.

6.1 Method 1.

This method uses the Autoexec.bat file to call (or execute) another batch file named Linux.bat, during boot up.



 @echo off 
 cls 
 echo. 
 echo. 
 echo. 
 echo. 
 choice /t:y,5 "Do you wish to boot Linux? " 
 if errorlevel 2 goto End 
 c:\loadlin c:\vmlinuz root=/dev/hdc2 ro 
 :End

This batch file script clears the screen, adds four blank lines, displays the text in quotes + [Y,N], then waits 5 seconds for you to press a key. If you do not press a key within 5 seconds, it defaults to Y and runs Linux. If you select Y or N, the batch file determines what option you selected, then executes the selected option. For example, if you select 'N' then the batch file terminates and continues to process your Autoexec.bat file, which loads Windows 95. If you select Y, then of course Linux will load.

If you do not want four blank lines before the text, modify the number of lines with echo. If you do not want the screen to clear, then remove the line with cls. The /t switch tells the choice command to wait 5 seconds and, if no key is pressed, to default to Y. Change the y to an n if you want Windows 95 to boot after the 5 second timeout: choice /t:n,5. Also, you can change the amount of time to wait from 0 to 99 seconds. For more information on the choice command, change to the c:\windows\command directory and type: choice /? at the command prompt.

NOTE: You will have to modify the line that boots Linux to match your configuration. Please see Section 3.6 for examples of how to configure Loadlin to boot to Linux.



        call c:\linux

If Linux.bat is in another directory you will have to reference the correct path. For example if Linux.bat is in a directory called C:\batch, you would add:



        call c:\batch\linux

to the first line of your Autoexec.bat file. Save and exit the file. Now all you need to do is reboot. You should be prompted on whether you want to boot Linux.

6.2 Method 2.

This method is a bit more involved, but offers the greatest flexibility. What this method does it create your own custom boot menu, though it does not replace the Windows 95 boot menu. You will need a Config.sys and an Autoexec.bat file.



 [menu] 
 menuitem=Linux, Boot to Linux  (This defines a Menu Block and gives it a description).
 menuitem=Win95, Boot to Windows 95 
 menucolor=15,1  (This gives a blue background with bright white text) 
 menudefault=Linux, 15  (This sets the default menuitem and waits up to 15 seconds for input).

 [linux]
 shell=f:\loadlin.exe f:\vmlinuz root=/dev/hdc2 ro (Please see Section 4 for examples and syntax).

 [win95] 
 (Include the normal contents of your config.sys file here. If you did
 not have a config.sys file before now, then leave this section blank).



 goto %config%

 :win95 
 (Include the normal contents of your autoexec.bat file here. If you did
 not have an autoexec.bat file before now, then leave this section blank).


7. Frequently Asked Questions:

7.1 Where can I find more information on using Loadlin?

ftp://ftp.eskimo.com/u/p/praxis/manual.txt

http://metalab.unc.edu/LDP/HOWTO/BootPrompt-HOWTO-2.html#ss2.2

7.2 I am not sure what partition Linux is installed on. How do I find out?

7.3 Where do I find the kernel image file and how do I copy it to my MS-DOS partition?

7.4 Does it matter if I install Linux or Windows 95 first?

7.5 I currently have LILO installed, but I want to use Loadlin instead. How do I remove LILO?



        fdisk /mbr

7.6 What if I already dual boot between Windows 95 and Windows 3.x, and I want to boot to Linux using this method?

7.7 Is it possible to initiate Linux from the Windows 95 desktop?

7.8 Where can I get a plain text version of this document?


8. Credits

A special thanks to Norm Jacobowitz and Fred Harris for helping me sort out the Windows 95 OSR2 issues and for helping me improve this mini-HOWTO.