home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / doc / HOWTO / mini / Loadlin+Win95 < prev    next >
Text File  |  1997-10-08  |  20KB  |  532 lines

  1.  
  2.                            LOADLIN+WIN95 MINI-HOWTO
  3.                                        
  4. Authored by: Chris Fischer <protek@brigadoon.com>
  5. v1.3.4, Revised: September 15, 1997
  6.  
  7.    
  8.      _________________________________________________________________
  9.    
  10.   1. Introduction:
  11.   
  12.    
  13.    
  14.    This document describes how to easily use a combination of Windows
  15.    95's Boot Menu and Loadlin.exe to autoboot Linux using the F4 Function
  16.    Key. This procedure should work with Windows 95 versions 4.00.950 and
  17.    4.00.950a, and all versions of Linux that support Loadlin. If you
  18.    prefer to use the LILO boot manager, please consult the Linux+Win95
  19.    Mini-HOWTO.
  20.    
  21.    This mini-HOWTO is posted first at The Linux+Windows 95 Reference
  22.    Page, so check there to make sure you have the most recent revision
  23.    of this mini-HOWTO.
  24.    
  25.    _** A Special Note for Windows 95 OSR2 (version 4.00.950b) users: **_
  26.    
  27.    Do _NOT_ attempt dual booting with Windows 95 without first consulting
  28.    the Windows 95 OSR2 FAQ. The FAQ also contains a great deal of
  29.    information regarding FAT32. In a nutshell, if you have OSR2 and are
  30.    using a FAT16 file system, you can still dual boot using the F4
  31.    Function Key.
  32.    
  33.    _NOTE: If you have Windows 95 OSR2, and are using a FAT32 file system,
  34.    then the dual booting methods in this mini-HOWTO __will not work and
  35.    should not be attempted_.
  36.    
  37.    However, there are a couple of alternate methods you can use to
  38.    automate booting Linux at startup, which are discussed in Section 9.
  39.    
  40.   2. Things that are assumed:
  41.   
  42.           A. You have successfully installed Windows 95.
  43.           B. Windows 95 is installed on Drive C.
  44.           C. You have successfully installed Linux.
  45.           D. You know what partition Linux is installed on.
  46.           E. LILO is NOT installed on your hard drive.
  47.           F. If you are using Windows 95 OSR2 (version 4.00.950b), you
  48.           have carefully read the Windows95 OSR2 FAQ.
  49.           
  50.   3. Items you need before you start:
  51.   
  52.           A. A bootable floppy disk with DOS 5.0 or DOS 6.x system files
  53.           (io.sys, msdos.sys, command.com) and a config.sys file. If you
  54.           are using a DOS 5.0 boot disk, you will also need an
  55.           autoexec.bat file. If you are using Windows 95 OSR2 (version
  56.           4.00.950b), you will also need to create a file called
  57.           Winboot.sys with a text editor and place it in the root
  58.           directory of Drive C. Winboot.sys can be an empty file, just so
  59.           long as you have the file.
  60.           
  61.    
  62.    
  63.    _NOTE:_ If your hard drive already contains the autoexec.dos,
  64.    config.dos, io.dos, msdos.dos, and command.dos files, then you will
  65.    not need the floppy. You can check by typing: _dir __and__ dir /ah_ at
  66.    the root of Drive C. Also, if you installed the Upgrade version of
  67.    Windows 95, then it is likely that you have them.
  68.    
  69.           B. The Loadlin.exe program file.
  70.           C. Your kernel image file, usually zImage or vmlinuz. (See the
  71.           FAQ for INFO).
  72.           D. A simple text editor, such as Notepad.
  73.           
  74.   4. Getting Started:
  75.   
  76.           A. Determine what version of Windows95 you have. Boot your
  77.           computer to Windows 95 and right click on the My Computer icon.
  78.           Now left click on Properties. On the General tab, look under
  79.           the "System:" line. There you will see the version number.
  80.           
  81.    
  82.    
  83.    _NOTE:_ If you have Windows 95 version 4.00.950b, _make certain you
  84.    are __not__ using the FAT32 file system_. Double click the My Computer
  85.    icon, then right click the Drive C icon. Left click on Properties. On
  86.    the General tab, the "Type:" line will indicate whether or not you
  87.    have a FAT32 file system. _If you are using the FAT32 file system,
  88.    then go directly to _Section 9.Otherwise, continue with letter B.
  89.    
  90.           B. Run the Windows Explorer file manager program.
  91.           
  92.    
  93.           C. On the Menu Bar, click on View, then click on Options. On
  94.           the View Tab, make sure that the "Show all files" radio button
  95.           is marked. Also, make sure that the line with "Hide MS-DOS file
  96.           extensions for file types that are registered" is unchecked.
  97.           Click on the OK button.
  98.           
  99.    
  100.    
  101.    _NOTE:_ If your hard drive already contains the *.dos files mentioned
  102.    in the "NOTE:" of section 3A, then skip to the "NOTE:" between letters
  103.    F and G. Otherwise, continue with letter D.
  104.    
  105.           D. Insert the DOS 5.0 or DOS 6.x bootable floppy into Drive A.
  106.           Click on the Drive A icon so you can see the contents on the
  107.           floppy disk.
  108.           
  109.           E. Rename each file to a .dos file extension. You can do this
  110.           by single clicking on a file, pressing the F2 function key, and
  111.           typing in the new name. Do not worry if you need the bootable
  112.           floppy to work properly, just rename the files back after you
  113.           are finished with this procedure.
  114.           
  115.           F. _EXTREMELY IMPORTANT:_ Make sure you rename the files on the
  116.           floppy _BEFORE_ you copy them to Drive C. Otherwise you will
  117.           overwrite your Windows 95 system files. _You have been warned_.
  118.           Now, copy all files to the root directory of Drive C. One
  119.           method is to click on the Drive A icon, press CTRL+A, press
  120.           CTRL+C, click on the Drive C icon, and press CTRL+V.
  121.           
  122.    
  123.    
  124.    _NOTE:_ If you _do not_ have Windows 95 OSR2 (version 4.00.950b),
  125.    please skip Section G.
  126.    
  127.           G. If (and only if) you have Windows95 version 4.00.950b, make
  128.           sure you have a file named Winboot.sys in the root directory of
  129.           Drive C, as stated in Section 3 above._Failure to have
  130.           Winboot.sys in the root directory of Drive C will result in a
  131.           system lockup should you attempt to boot to an earlier version
  132.           of DOS._
  133.           
  134.    
  135.    
  136.    _NOTE:_ If you are using a DOS 6.x boot disk skip to section 5,
  137.    otherwise continue with letter H.
  138.    
  139.           H. Open Notepad. On the Menu Bar, click on Open. Change "Files
  140.           of type" to "All files (*.*)". Change "Look in:" from Desktop
  141.           to Drive C. Now open Config.dos by double clicking on the
  142.           filename. Delete all the contents. This will create a 0K
  143.           file...I will explain later. Save the file.
  144.           
  145.    
  146.           I. Use Notepad to open and edit Autoexec.dos and type in the
  147.           Loadlin command. The Loadlin command must be in the following
  148.           syntax:
  149.           
  150. Loadlin DriveLetter:\LinuxKernelFile root=/dev/LinuxBootPartition ro
  151.  
  152.           Here is my Autoexec.dos file as an example:
  153.           
  154. Loadlin f:\vmlinuz root=/dev/hdc2 ro
  155.  
  156.    
  157.    
  158.    _NOTE:_ The kernel, as well as the Loadlin.exe, file may be anywhere
  159.    on your hard drive as long as you reference the correct path. For
  160.    example, if your kernel file was located in the directory
  161.    e:\linux\kernels and Loadlin.exe was located in the directory
  162.    c:\utils, you would use:
  163.    
  164. c:\utils\loadlin e:\linux\kernels\vmlinuz root=/dev/hdc2 ro
  165.  
  166.           Save the file.
  167.           
  168.    
  169.    
  170.    _Please skip section 5 and go to _section 6_._
  171.      _________________________________________________________________
  172.    
  173.   5. *** Use this section ONLY if you are using a DOS 6.x boot disk. ***
  174.   
  175.           A. Open Notepad. On the Menu Bar, click on Open. Change "Files
  176.           of type" to "All files (*.*)". Change "Look in:" from Desktop
  177.           to Drive C. Now open Config.dos by double clicking on the
  178.           filename. Delete all the contents. Now, you will need to enter
  179.           the shell command with the following syntax:
  180.           
  181. shell=loadlin.exe LinuxKernelFile root=/dev/LinuxBootPartition ro
  182.  
  183.           Here is my Config.dos file as an example:
  184.           
  185. shell=f:\loadlin.exe f:\vmlinuz root=/dev/hdc2 ro
  186.  
  187.    
  188.    
  189.    _NOTE:_ The loadlin and kernel file may be anywhere on your hard drive
  190.    as long as you reference the correct path. For example, if your
  191.    loadlin file was in the directory f:\utils and the kernel file was
  192.    located in the directory e:\linux\kernels you would use:
  193.    
  194. shell=f:\utils\loadlin.exe e:\linux\kernels\vmlinuz root=/dev/hdc2 ro
  195.  
  196.           B. Save the file.
  197.           
  198.    
  199.      _________________________________________________________________
  200.    
  201.   6. Almost Finished...
  202.   
  203.           A. One last file to edit and then you are finished. Use Notepad
  204.           to open and edit Msdos.sys. Go to the [Options] section. Look
  205.           for a line that has BootMulti=. If you do not find one then add
  206.           it and set the value to 1. It should look something like:
  207.           
  208. [Options]
  209. BootMulti=1
  210.  
  211.           B. There may be other items listed. Just leave them. Now save
  212.           the file.
  213.           
  214.   7. You are Finished!
  215.   
  216.    
  217.    
  218.    Now all you have to do is reboot (Don't forget to remove the floppy
  219.    disk). When you see "Starting Windows 95...", press the F4 Function
  220.    Key and Linux should boot right up.
  221.    
  222.   8. How It Works:
  223.   
  224.    
  225.    
  226.    Windows 95 has a built in Boot Menu. By default you do not see it at
  227.    startup (although you can change that if you wish), but you can get to
  228.    it by pressing the F8 Function Key when you see "Starting Windows
  229.    95...". On the menu you will see several options. The last option is
  230.    "Previous version of MS-DOS". Instead of pressing F8 and then
  231.    selecting "Previous version of MS-DOS", you can use the F4 shortcut by
  232.    pressing F4 when "Starting Windows 95..." appears on the screen. When
  233.    Windows 95 boots to the previous version of MS-DOS, it uses the files
  234.    that end in the .dos file extension. This is why it is important to
  235.    have a 0K Config.dos file if you are initiating Linux from the
  236.    Autoexec.dos file. If Windows 95 does not find the files with a .dos
  237.    extension while trying to boot the previous operating system, it will
  238.    load the Windows 95 startup files. Therefore, if you do not have a
  239.    Config.dos file, Windows 95 will load all the drivers in your
  240.    Config.sys file. While this will not prevent Linux from loading, it
  241.    will take longer. Having a 0K Config.dos file prevents Windows 95 from
  242.    reading your Config.sys file while booting to the previous version of
  243.    MS-DOS.
  244.    
  245.   9. Alternate Methods for Auto-Booting Linux, Especially for Users With a
  246.   FAT32 File System:
  247.   
  248.    
  249.    
  250.    This section will work for all versions of Windows 95 to date,
  251.    regardless of whether you have a FAT32 file system. There are two
  252.    methods I will discuss in this section. First, I'll start with the
  253.    simplest.
  254.    
  255.     Method 1
  256.     
  257.    
  258.    
  259.    This method uses the Autoexec.bat file to call (or execute) another
  260.    batch file named Linux.bat, during boot up.
  261.    
  262.           A. Creat a Linux.bat file using a simple text editor such as
  263.           EDIT or Notepad. The contents should be similar to the
  264.           following:
  265.           
  266. @echo off
  267. cls
  268. echo.
  269. echo.
  270. echo.
  271. echo.
  272. choice /t:y,5 "Do you wish to boot Linux? "
  273. if errorlevel 2 goto End
  274. c:\loadlin c:\vmlinuz root=/dev/hdc2 ro
  275. :End
  276.  
  277.           This batch file script clears the screen, adds four blank
  278.           lines, displays the text in quotes + [Y,N], then waits 5
  279.           seconds for you to press a key. If you do not press a key
  280.           within 5 seconds, it defaults to Y and runs Linux. If you
  281.           select Y or N, the batch file determines what option you
  282.           selected, then executes the selected option. For example, if
  283.           you select 'N' then the batch file terminates and continues to
  284.           process your Autoexec.bat file, which loads Windows 95. If you
  285.           select Y, then of course Linux will load.
  286.           
  287.           If you do not want four blank lines before the text, modify the
  288.           number of lines with _echo_. If you do not want the screen to
  289.           clear, then remove the line with _cls_. The _/t_ switch tells
  290.           the choice command to wait 5 seconds and, if no key is pressed,
  291.           to default to Y. Change the _y_ to an _n_ if you want Windows
  292.           95 to boot after the 5 second timeout: _choice /t:n,5_. Also,
  293.           you can change the amount of time to wait from 0 to 99 seconds.
  294.           For more information on the _choice_ command, change to the
  295.           c:\windows\command directory and type: _choice /?_ at the
  296.           command prompt.
  297.           
  298.    
  299.    
  300.    _NOTE:_ You will have to modify the line that boots Linux to match
  301.    your configuration. Please see Section 4.I for examples of how to
  302.    configure Loadlin to boot to Linux.
  303.    
  304.           B. Next, create an Autoexec.bat file (if you don't already have
  305.           one) with a simple text editor. Then, on the _first_ line, add
  306.           the following:
  307.           
  308. call c:\linux
  309.  
  310.           If Linux.bat is in another directory you will have to reference
  311.           the correct path. For example if Linux.bat is in a directory
  312.           called C:\batch, you would add:
  313.           
  314. call c:\batch\linux
  315.  
  316.           to the first line of your Autoexec.bat file. Save and exit the
  317.           file. Now all you need to do is reboot. You should be prompted
  318.           on whether you want to boot Linux.
  319.           
  320.     Method 2
  321.     
  322.    
  323.    
  324.    This method is a bit more involved, but offers the greatest
  325.    flexibility. What this method does it create your own custom boot
  326.    menu, though it does not replace the Windows 95 boot menu. You will
  327.    need a Config.sys and an Autoexec.bat file.
  328.    
  329.           A. First you will need to define a Startup Menu in Config.sys
  330.           (my comments to you are in parenthesis):
  331.           
  332. [menu]
  333. menuitem=Linux, Boot to Linux  (This defines a Menu Block and gives it a descri
  334. ption).
  335. menuitem=Win95, Boot to Windows 95
  336. menucolor=15,1  (This gives a blue background with bright white text)
  337. menudefault=Linux, 15  (This sets the default menuitem and waits up to 15 secon
  338. ds for input).
  339. [linux]
  340. shell=f:\loadlin.exe f:\vmlinuz root=/dev/hdc2 ro (Please see Section 5 for exa
  341. mples and syntax).
  342. [win95]
  343. (Include the normal contents of your config.sys file here. If you did not have
  344.  a config.sys file before now, then leave this section blank).
  345.  
  346.           Save and exit your Config.sys file. If you want, you can use
  347.           this Config.sys template to get started.
  348.           
  349.    
  350.           B. Next, edit your Autoexec.bat file (my comments to you are in
  351.           parenthesis):
  352.           
  353. goto %config%
  354. :linux
  355. (Leave this area blank. It's just here because it was defined in Config.sys).
  356. :win95
  357. (Include the normal contents of your autoexec.bat file here. If you did not hav
  358. e
  359.  an autoexec.bat file before now, then leave this section blank).
  360.  
  361.           Save and exit your Autoexec.bat file. If you want, you can use
  362.           this Autoexec.bat template to get started. That should do it.
  363.           The next time you reboot, you should get a Start Up menu with
  364.           the option to boot to Linux or Windows 95.
  365.           
  366.    
  367.      _________________________________________________________________
  368.    
  369.   Frequently Asked Questions:
  370.   
  371.     A. Q: Where can I find more information on using Loadlin?
  372.     
  373.      
  374.      
  375.      _A:_ The Slackware 96 CD contains a file named loadlin.tgz in the
  376.      \slackware\A5 directory. Unarchive the file and look in the \docs
  377.      directory for a file named manual.txt. I do not know about earlier
  378.      versions of Slackware.
  379.      
  380.      The RedHat 4.2 CD contains a file named loadlin16.tgz in the
  381.      \dosutils directory. Unarchive the file and look in the \docs
  382.      directory for a file named manual.txt. RedHat 4.1 does not seem to
  383.      have this archive. The manual.txt is also available for download at:
  384.      
  385.      
  386.      
  387.      ftp://ftp.eskimo.com/u/p/praxis/manual.txt.
  388.      
  389.      
  390.      
  391.      Additional info. is available at:
  392.      
  393.      
  394.      
  395.      http://sunsite.unc.edu/LDP/HOWTO/BootPrompt-HOWTO-2.html#ss2.2
  396.      
  397.     B. Q: I am not sure what partition Linux is installed on. How do I find
  398.     out?
  399.     
  400.      
  401.      
  402.      _A:_ At a Linux shell prompt, run the fdisk utility and press "p".
  403.      From there you should be able to tell. If you need additional help
  404.      using fdisk, please consult the man pages.
  405.      
  406.     C. Q: Where do I find the kernel image file and how do I copy it to my
  407.     MS-DOS partition?
  408.     
  409.      
  410.      
  411.      _A:_ To find your linux kernel file type:
  412.      
  413. find / -name vmlinuz
  414.  
  415.      
  416.      
  417.      at a Linux shell prompt. This will search all Linux partitions for
  418.      the vmlinuz file. If you have multiple vmlinuz files, then make sure
  419.      you use the correct one. If you are not sure, then the safest bet
  420.      would be to use the most recent one.
  421.      
  422.      To copy your linux kernel file to your DOS partition, you need to
  423.      make your DOS partition visible to Linux, then mount the partition
  424.      if it is not already. Generally, this should have been set up when
  425.      you installed Linux. All you need to do next is change to the
  426.      directory the vmlinuz file is in and copy it over to DOS using the
  427.      cp command.
  428.      
  429.      However, if Linux was not set up to recognize your DOS partition,
  430.      then copy vmlinuz to a floppy. Take any DOS formatted floppy (with
  431.      enough disk space to hold your kernel image file) and insert it into
  432.      your floppy drive. Type:
  433.      
  434. mount /dev/fd0 /tmp
  435.  
  436.      
  437.      
  438.      at a Linux shell prompt. Then change to the directory your kernel
  439.      image file is in and type:
  440.      
  441. cp vmlinuz /tmp
  442.  
  443.      
  444.      
  445.      This will copy vmlinuz to your floppy disk and it will be readable
  446.      by DOS. Shutdown Linux, boot to DOS, then copy vmlinuz to whichever
  447.      directory you choose. If you recompile your kernel, do not forget to
  448.      copy the new kernel image file to your DOS partition. This will
  449.      overwrite your old file, so it might be a good idea to rename the
  450.      old file first just in case the new one does not work properly.
  451.      
  452.     D. Q: Does it matter if I install Linux or Windows 95 first?
  453.     
  454.      
  455.      
  456.      _A:_ Technically no. However, it would be _much_ simpler to install
  457.      Win95 first. That way it is easier to setup Linux to recognize your
  458.      DOS partition(s) as you can usually do this during the Linux
  459.      installation..
  460.      
  461.     E. Q: What if I already dual boot between Windows 95 and Windows 3.x, and I
  462.     want to boot to Linux using this method?
  463.     
  464.      
  465.      
  466.      _A:_ Frankly, if you want to do this I would recommend using LILO.
  467.      However, if you really do not want to use LILO, you will have to
  468.      boot to Win 3.x first, then issue the Loadlin command. (Make sure
  469.      Windows 3.x is NOT running, but that you are in DOS 5.0 or 6.x).
  470.      
  471.     F. Q: Is it possible to initiate Linux from the Windows 95 desktop?
  472.     
  473.      
  474.      
  475.      _A:_ Yes. First create a batch file called linux.bat. For example,
  476.      edit the file to contain a Loadlin command such as:
  477.      
  478. loadlin f:\vmlinuz root=/dev/hdc2 ro
  479.  
  480.      
  481.      
  482.      Now save the file in the \windows\desktop directory. Next, right
  483.      click on the Linux.bat icon, then left click on Properties. Now
  484.      click on the Program tab, then click on the Advanced button. Click
  485.      on the box next to MS-DOS mode and make sure the box next to "Warn
  486.      before entering MS-DOS mode is checked". Click OK, then click on OK
  487.      again. Now when you double click on the Linux icon, a warning box
  488.      will appear before going into MS-DOS mode. If you click on Yes, then
  489.      Windows enters MS-DOS mode and executes the Linux.bat file.
  490.      
  491.    
  492.    
  493.    _NOTE:_ You must be in MS-DOS mode in order to use Loadlin. Please see
  494.    the manual.txt file mentioned in question A of this FAQ for more
  495.    information.
  496.    
  497.     G. Q: Where do I get a plain text version of this document?
  498.     
  499.      
  500.      
  501.      _A:_You can get a plain text version of this document at:
  502.      
  503.      
  504.      
  505.      ftp://ftp.eskimo.com/u/p/praxis/loadlin.txt
  506.      
  507.    
  508.      _________________________________________________________________
  509.    
  510. Credits:
  511.  
  512.    
  513.    
  514.    _A special thanks to Fred Harris and Norm Jacobowitz for helping me
  515.    sort out the Windows 95 OSR2 issues and for helping me improve this
  516.    mini-HOWTO._
  517.      _________________________________________________________________
  518.    
  519.    
  520.    
  521.    Questions, comments, and suggestions are welcome.
  522.    
  523.    _Contact information:_
  524.    Chris Fischer
  525.    Protek Computer Solutions
  526.    protek@brigadoon.com or praxis@eskimo.com
  527.      _________________________________________________________________
  528.    
  529.    
  530.    
  531.    Copyright ⌐ 1997 Protek Computer Solutions.
  532.