\documentclass[letterpaper]{article}
\nonstopmode
\bkai
\usepackage{linuxdoc-sgml}
\usepackage{qwertz}
\usepackage{url}
\usepackage[latin1]{inputenc}
\usepackage{t1enc}
\usepackage[english]{babel}
\usepackage{epsfig}
\usepackage{null}
\def\addbibtoc{
\addcontentsline{toc}{section}{\numberline{\mbox{}}\relax\bibname}
}%end-preamble
\setcounter{page}{1}
\title{Linux + NT OS Loader mini-HOWTO ÖÐÒë°æ}
\author{×÷Õß: Bernd Reichert {\ttfamily \onlynameurl{reichert@dial.eunet.ch}}\\ 
ÒëÕß: \onlynameurl{C.W.Huang} {\ttfamily \onlynameurl{cwhuang@phys.ntu.edu.tw}}}
\date{v1.11, 2 September 1997
·­ÒëÈÕÆÚ: 11-12 November 1997}
\abstract{±¾ÎÄ¼þÃèÊöÁËÊ¹ÓÃ Windows NT boot loader À´Æô¶¯ Linux µÄ·½·¨£®}


\begin{document}
\maketitle
\tableofcontents

\section{ÕªÒª}

±¾ÎÄ¼þÃèÊöÁËÊ¹ÓÃ Windows NT boot loader À´Æô¶¯ Linux µÄ·½·¨£®
±¾¹ý³ÌÒÑÔÚ Windows NT 4.0 Workstation °æ¼° Linux 2.0 ÉÏ²âÊÔ¹ý£®




\section{NT OS Loader ÊÇÈçºÎÔË×÷µÄ?}

NT OS loader Ï£ÍûÀ´×ÔÆäËü×÷ÒµÏµÍ³µÄÆô¶¯´ÅÇø±ä³ÉÒ»µµ°¸À´È¡ÓÃ£®
Ëü¶ÁÈëÕâµµ°¸²¢Æô¶¯Ñ¡ÔñµÄ×÷ÒµÏµÍ³£¬Ò²¾ÍÊÇËµ£¬»òÊÇ²»Í¬Ä£Ê½ÔË×÷µÄ Windows NT »òÊÇÈÎºÎÆäËüµÄ×÷ÒµÏµÍ³£®




\section{ÈçºÎ°²×° Windows NT ¼° Linux ÔÚÍ¬Ò»ÏµÍ³ÉÏµÄÌáÊ¾}


\subsection{°²×° Windows NT}

ÏÈÊÔÖø°²×° Windows NT£®Èç¹ûÄãÏëÊ¹ÓÃ NTFS ×÷ÎªÄã Windows NT ·Ö¸îÇøµÄµµ°¸ÏµÍ³£¬¼Ç×¡£¬Ä¿Ç°°æ±¾µÄ Linux ÎÞ·¨È¡ÓÃ NTFS µÄ·Ö¸îÇø£®
Ò»¸ö¿ÉÒÔ¶Á NTFS ·Ö¸îÇøµÄ Alpha °æÇý¶¯³ÌÊ½¿ÉÔÚ {\ttfamily \onlynameurl{http://www.informatik.hu-berlin.de/\~{}loewis/ntfs}} ÕÒµ½£®
Äã¿É½¨Á¢ÁíÍâÒ»¸ö FAT ·Ö¸îÇø×÷Îª×ÊÁÏ½»»»ÓÃ£¬»òÊÇÄã¿ÉÒÔÊ¹ÓÃ DOS ¸ñÊ½»¯µÄÈíµúÆ¬£®




\subsection{·Ö¸î´Åµú}

ÁíÍâÒ»¸ö mini-howto ½¨Òé²»ÒªÊ¹ÓÃ NT µÄ"´ÅµúÏµÍ³¹ÜÀíÔ±"À´½¨Á¢ Linux µÄÖÃ»»ÒÔ¼°¸ùÄ¿Â¼·Ö¸îÇø£®
Ëü»áÁôÏÂÒ»Ð©¿Õ¼ä£®ÎÒÒ²½¨ÒéÊ¹ÓÃ Linux µÄ fdisk.




\subsection{°²×° Linux}

ÏÖÔÚ´Ó´ÅÆ¬ÉÏÆô¶¯ Linux£¬½¨Á¢ÖÃ»»¼°¸ùÄ¿Â¼·Ö¸îÇø£®Fdisk »á½« NTFS ·Ö¸îÇøÈÏÎªÊÇ HPFS ·Ö¸îÇø£¬ÕâÊÇÕý³£µÄ£®
ÔÙ´Î´Ó´ÅÆ¬Æô¶¯ Linux ²¢°´ÄãµÄÏ²ºÃ°²×° Linux£®



ÔÚ°²×°¹ý³ÌÖÐ½¨ÒéÄã¹ÒÉÏËüÕÒµ½µÄ HPFS ·Ö¸îÇøÊ±: ºöÂÔËü£®




\subsection{Lilo}

µ±Äã×öµ½°²×° Lilo µÄ²¿·ÝÊ±£¬Ö¸¶¨ÄãµÄ Linux ¸ùÄ¿Â¼·Ö¸îÇø×÷ÎªÄãµÄÆô¶¯×°ÖÃÒòÎªÄã´ÅµúµÄÖ÷Æô¶¯¼ÇÂ¼(MBR)ÏÖÔÚÊÇ Windows NT ËùÓÐ£®
Õâ±íÊ¾ÔÚÄã {\ttfamily /etc/lilo.conf} µÄ root ÏîÄ¿¼° boot ÏîÄ¿»áÓÐÏàÍ¬µÄÖµ£®
Èç¹ûÄãÓÐÒ»¸ö IDE Ó²µúÇÒÄãµÄ Linux ·Ö¸îÇøÊÇÔÚµÚ¶þ¿é·Ö¸îÇøÉÏ£¬Äã {\ttfamily /etc/lilo.conf} µÄ boot ÏîÄ¿¿´ÆðÀ´»áÏñ:

\begin{tscreen}
\begin{verbatim}
boot=/dev/hda2
\end{verbatim}
\end{tscreen}


Èç¹ûÄãÓÐÁ½¸ö´Åµú»ú¶øÇÒÄãµÄ Linux Î»ì¶µÚ¶þ¿Å´ÅµúµÄµÚÒ»¸ö·Ö¸îÇøÉÏ£¬Äã {\ttfamily /etc/lilo.conf} µÄ boot ÏîÄ¿¿´ÆðÀ´»áÏñ:

\begin{tscreen}
\begin{verbatim}
boot=/dev/hdb1
\end{verbatim}
\end{tscreen}


ÒÔ·ûºÏÄãÏµÍ³µÄºËÐÄÖ´ÐÐ lilo£®Èç¹ûÄã²»È·¶¨µÄ»°´Ó´ÅÆ¬ÉÏÆô¶¯ÒÔ¼ì²éºËÐÄ£®



Èç¹ûÄãÏÖÔÚÎÞ·¨Æô¶¯ Windows NT£¬ÄãÓÐÂé·³ÁË£®ÎÒÏ£ÍûÄãÒÑ¾­½¨Á¢ÁË×î½üµÄÐÞ¸´´ÅÆ¬£®




\section{Bootpart}

ÓÐÒ»¸öÓÉ G. Vollant ËùÐ´µÄ NT ³ÌÊ½½Ð bootpasr ¿ÉÒÔÎªÄã×öµ½ÏÂÊöµÄÁ½µã£®
Bootpart ¿ÉÔÚ´ËÈ¡µÃ: {\ttfamily \onlynameurl{http://ourworld.compuserve.com/homepages/gvollant/bootpart.htm}}.



Èç¹ûÄãÏëÖªµÀÊÂÇéÊÇÈçºÎÔË×÷µÄ£¬Ê¹ÓÃµÚÎå¼°µÚÁù½ÚÃèÊöµÄ²½Öè£®




\section{Linux ²¿·ÝµÄ¹¤×÷}

Äã±ØÐë´Ó´ÅÆ¬ÉÏÆô¶¯ Linux Ö±µ½ NT ²¿·Ý¸ÄºÃÎªÖ¹£®



ÏÖÔÚÄã±ØÐë´ÓÄãµÄ Linux ¸ùÄ¿Â¼·Ö¸îÇøÖÐÈ¡³öÆô¶¯´ÅÇø£®
Èç¹û {\ttfamily /dev/hda2} ÊÇÄãµÄ Linux ·Ö¸îÇø£¬Õâ¸ö {\ttfamily dd} Ö¸ÁîÊÇ:

\begin{tscreen}
\begin{verbatim}
# dd if=/dev/hda2 of=/bootsect.lnx bs=512 count=1
\end{verbatim}
\end{tscreen}


Èç¹ûÄãµÄ bootsect.lnx ³¬¹ýÁË 512 ¸öÎ»Ôª×éÄÇ÷á¾ÍÓÐÐ©ÊÂ²»¶Ô¾¢£®



ÏÖÔÚ½«µµ°¸ bootsect.lnx ¿½±´µ½Ò»Æ¬ DOS ¸ñÊ½»¯¹ýµÄ´ÅÆ¬ÖÐ£¬Èç¹ûÕâÊÇÄã½«µµ°¸´«µ½ NTFS ·Ö¸îÇøÄÚµÄ·½·¨µÄ»°£®



Äã¿ÉÒÔÕâÑùÀ´¿½±´

\begin{tscreen}
\begin{verbatim}
# mcopy /bootsect.lnx a:
\end{verbatim}
\end{tscreen}


»òÕßÓÃ

\begin{tscreen}
\begin{verbatim}
# mount -t msdos /dev/fd0 /mnt
# copy /bootsect.lnx /mnt
# umount /mnt
\end{verbatim}
\end{tscreen}





\section{Windows NT ²¿·ÝµÄ¹¤×÷}

´Ó´ÅÆ¬ÉÏ½«µµ°¸¿½±´µ½ {\ttfamily C:$\backslash$bootsect.lnx}. ÎÒ²»»á¸æËßÄãÔõ÷á×ö£®
(Òë×¢: {\ttfamily copy a:bootsect.lnx c:$\backslash$}, Ó¦¸Ã»á°É£®)



¾ÍÏñ Linux ÏÂµÄ lilo.conf, ÔÚ Windows NT ÖÐÊÇ {\ttfamily c:$\backslash$boot.ini}.
ÔÚÄã±àÐÞËüÖ®Ç°ÓÃÕâ¸öÖ¸Áî³ýÈ¥ËüµÄÏµÍ³¼°Î¨¶ÁÊôÐÔ:

\begin{tscreen}
\begin{verbatim}
C:\attrib -s -r c:\boot.ini 
\end{verbatim}
\end{tscreen}


ÏÖÔÚÓÃÒ»±à¼­Æ÷¸ü¸Ä {\ttfamily boot.ini} µµ°¸£¬ÀýÈç notepad, ÏñÕâÑù:

\begin{tscreen}
\begin{verbatim}
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINNT
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Windows NT Workstation ... 
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Windows NT Workstation ...
C:\BOOTSECT.LNX="Linux"
\end{verbatim}
\end{tscreen}


ÔÚ±¾ÀýÖÐÖ»¼ÓÈëÁË×îááÒ»ÐÐ£®ÔÚÄã´¢´æ {\ttfamily boot.ini} ááÓÃÕâ¸öÖ¸Áî»Ø¸´ËüµÄÊôÐÔ:

\begin{tscreen}
\begin{verbatim}
C:\attrib +s +r c:\boot.ini 
\end{verbatim}
\end{tscreen}


ÔÚ¹ØµôÄãµÄ Windows NT ²¢ÖØÐÂÆô¶¯ááÄãÓ¦¸Ã»á¿´µ½ÏñÕâÑùµÄ:

\begin{tscreen}
\begin{verbatim}
  OS Loader V4.00
 
  ÇëÑ¡ÔñÄúÏëÒªÆô¶¯µÄ×÷ÒµÏµÍ³:

  Windows NT Workstation Version 4.0
  Windows NT Workstation Version 4.0 [VGA mode]
  Linux

  Ê¹ÓÃ¡ü¼üºÍ¡ý¼ü½«ÄúÏëÒªµÄÑ¡Ïî·´°×£¬
  Ñ¡¶¨ááÇë°´ Enter ¼üÈ·ÈÏ
\end{verbatim}
\end{tscreen}


Ñ¡Ôñ Linux ²¢»á¿´µ½

\begin{tscreen}
\begin{verbatim}
  LILO loading zImage ....
\end{verbatim}
\end{tscreen}





\section{ÔÙ×öÒ»´Î}

Ã¿´ÎÄã Linux ·Ö¸îÇøµÄÆô¶¯´ÅÇø±»ÐÞ¸ÄááÒ»·ÝÐÂ¿½±´µÄ bootsect.lnx ¾Í±ØÐë×ªÒÆµ½ {\ttfamily C:$\backslash$BOOTSECT.LNX}£®
Ò»¸öÀý×ÓÊÇµ±ÄãÖØÐÂÓÃ lilo °²×°Ò»ÐÂµÄºËÐÄÊ±£®
Òò´ËÄã¿ÉÒÔ¿´³öÕâÑùµÄÏµÍ³²¢²»ÊÊºÏÓÃÀ´²âÊÔÊµÑéµÄºËÐÄ£®




\section{ÅÅ³ýÎÊÌâ}

Èç¹ûÊÂÇé²¢²»°´ÕÕÔ¤ÆÚµÄÔË×÷£¬ÓÃÒ»´ÅÆ¬À´¼ì²é¿ÉÆô¶¯ÐÔ£®
Èç¹û {\ttfamily /dev/hdb1} ÊÇÄãµÄ Linux ·Ö¸îÇø£¬ÄãµÄ {\ttfamily /etc/lilo.conf} ÓÐÏÂÁÐµÄÏîÄ¿:

\begin{tscreen}
\begin{verbatim}
root=/dev/hdb1
boot=/dev/fd0
\end{verbatim}
\end{tscreen}


²åÈëÒ»´ÅÆ¬²¢Ö´ÐÐ lilo. ÏÖÔÚ³¢ÊÔ´Ó´ÅÆ¬ÉÏÆô¶¯£®
Èç¹ûÄãÔÚ {\ttfamily /dev/hdb1} ÉÏµÄ Linux ÎÞ·¨±»Æô¶¯£¬ÄÇ÷á NT OS loader Ò²½«ÎÞ·¨Æô¶¯Ëü£®
Èç¹ûÄã¿´µ½Ò»´ó¶Ñ {\ttfamily 01 01 01 01}£¬±íÊ¾ÄãµÄ root ´ÅµúÎÞ·¨È¡ÓÃ£®
¼ì²éÊÇ·ñÄãËùÓÐµÄ´Åµú¶¼±» BIOS Õì²âµ½£®



Èç¹ûÕâ´ÅÆ¬¿ÉÒÔÆô¶¯ÄãµÄ Linux ·Ö¸îÇø£¬Äã¿ÉÒÔÓÃÏÂÃæÖ¸ÁîÈ¡³öÄãµÄÆô¶¯´ÅÇø¸ø NT OS loader ÓÃ:

\begin{tscreen}
\begin{verbatim}
# dd if=/dev/fd0 of=/bootsect.lnx bs=512 count=1
\end{verbatim}
\end{tscreen}




Äã¿É±£ÁôÕâ´ÅÆ¬ÔÚÄãµÄ Windows NT °²×°³öÎÊÌâÊ±×÷ÎªÄãµÄ¼±¾È´ÅÆ¬£®




\section{ÆäËü}


\subsection{²Î¿¼×ÊÁÏ}

\begin{itemize}
\item The Linux+WindowsNT mini-HOWTO
\item The FAQ for FreeBSD 2.X
\end{itemize}





\subsection{¸ÐÐ»}

\begin{itemize}
\item ¸ÐÐ» Xiaoming Yi $<$z3c20@ttacs.ttu.edu$>$ ÌáÊ¾ÕâÐ©¹ý³ÌÒ²ÔÚ³ýÁËµÚÒ»¿Å´ÅµúÍâµÄÆäËü´ÅµúÉÏÔË×÷£®
\item ¸ÐÐ» Frank Dennler $<$Frank.Dennler@zkb.ch$>$ Ìá¹©µÄ´Åµú¼¼ÇÉ£®
\end{itemize}





\subsection{»ØÀ¡}

ÈÎºÎÒâ¼û¶¼ºÜ»¶Ó­£®




\subsection{Òë×¢: ÒÔ NT Loader Æô¶¯ FreeBSD}

ÒòÒëÕßµÄµçÄÔÖÐ³ýÁË Windows NT 4.0 ¼° Linux Ö®Íâ£¬»¹×°ÁË FreeBSD 2.2£¬ì¶ÊÇ¾Í·ÂÕÕÉÏÃæµÄ×ö·¨ÊÔÊÔ NT Loader ÓÐÃ»ÓÐ°ì·¨Æô¶¯ FreeBSD£®
ÎÒµÄ FreeBSD ×°ÔÚ {\ttfamily /dev/sda2}, Ò²¾ÍÊÇ FreeBSD µÄ {\ttfamily /dev/sd0s2}.
°´ÕÕÉÏÃæµÄ×ö·¨ÎÒÏÈ½« {\ttfamily /dev/sda2} µÄ boot sector ´æ³ÉÒ»µµ°¸:

\begin{tscreen}
\begin{verbatim}
# dd if=/dev/sda2 of=/bootsect.bsd bs=512 count=1
\end{verbatim}
\end{tscreen}


²¢½«Ëü¿½±´µ½ C:$\backslash$ ÏÂ£®ÔÙì¶ {\ttfamily boot.ini} ÖÐ¼ÓÈë

\begin{tscreen}
\begin{verbatim}
C:\BOOTSECT.BSD="FreeBSD"
\end{verbatim}
\end{tscreen}


²»ÁÏÕâ¸ö·½·¨¾¹È»{\bfseries Ê§°Ü}ÁË£¬ÎÞ·¨Æô¶¯ FreeBSD!



Ò»·½Ãæ¾õµÃÊ§Íû£¬Ò»·½ÃæÓÖ²»ËÀÐÄ£®ºöÈ»Ïëµ½£¬lilo Ò²¿ÉÒÔÄÃÀ´Æô¶¯ FreeBSD£®
ì¶ÊÇ£¬ÓÖ×öÁËÏÂÃæµÄÊµÑé£¬½øÈë Linux áá£¬½« {\ttfamily /etc/lilo.conf} ¸ÄÎª:

\begin{tscreen}
\begin{verbatim}
boot = /dev/fd0
install = /boot/boot.b
vga = normal

other = /dev/sda2
      label = FreeBSD
      table = /dev/sda
      loader = /dev/os2_d.b
\end{verbatim}
\end{tscreen}


·ÅÈëÒ»¸ñÊ½»¯¹ýµÄ´ÅÆ¬£¬ÔÙÅÜ lilo -v£®È»áá½«´ÅÆ¬µÄÆô¶¯´ÅÇø±ä³ÉÒ»µµ°¸:

\begin{tscreen}
\begin{verbatim}
# dd if=/dev/fd0 of=/bootsect.bsd bs=512 count=1
\end{verbatim}
\end{tscreen}


²¢·Åµ½ C:$\backslash$ ÏÂ£®ÒÆÈ¥´ÅÆ¬ááÖØÐÂ¿ª»ú£¬ÔÚ NT Loader µÄÑ¡µ¥ÏÂÑ¡Ôñ FreeBSD£¬½ÓÖø¾Í¿´µ½:

\begin{tscreen}
\begin{verbatim}
  LILO loading FreeBSD
  >> FreeBSD BOOT @ 0x10000: 639/65536 k of memory
  Usage: [[0:][fd](0,a)]/kernel][-abcCdhrsv]
  Use 1:sd(0,a)/kernel to boot sd0 if it is BIOS drive 1
  Use ? for file list or press Enter for defaults
  Boot:
\end{verbatim}
\end{tscreen}


ÎÒ{\bfseries ³É¹¦}ÁË!!



\end{document}
