rhl57.htm
来自「linux的初学电子书」· HTM 代码 · 共 2,354 行 · 第 1/4 页
HTM
2,354 行
<LI>Change the cpu to 80386 if you do not have a 80486 or Pentium.
<BR>
<BR>
<LI>If your boot floppy is a 5.25, replace threeinch with fiveinch.
<BR>
<BR>
</UL>
<P>Make sure your drive A floppy is not mounted under Linux and insert your boot floppy into drive A. Start DOSemu from a virtual console by typing DOS. Your version of DOS will boot from drive A, and you should be at the familiar A:> prompt. If you are
using an empty MS-DOS disk, you will soon run out of things to do. To exit DOSemu prompt press Alt-Ctrl-PgDn, or use the exitemu.com command provided on your boot floppy.
<BR>
<BR>
<A NAME="E69E560"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Configuring Disk Options</B></FONT></CENTER></H4>
<BR>
<P>Most Linux users have DOS partitions on a hard drive. Some may even have a separate hard drive dedicated to DOS. This section shows several ways to configure DOSemu to access these drives as native DOS disks. You can abandon your boot floppy and boot
from a hard drive, even if you do not have an MS-DOS formatted drive or partition anywhere.
<BR>
<BR>
<A NAME="E70E28"></A>
<H5 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Accessing a Dedicated MS-DOS Disk or Partition</B></FONT></CENTER></H5>
<BR>
<P>The easiest way to access a hard drive is to configure the drive in your dosemu.conf file. The disk or partition in question must be formatted for MS-DOS and be a primary partition. Extended DOS partitions are not yet supported. The format of the
parameter entry to access a hard drive is
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">disk { type "device" readonly }</FONT></PRE>
<P>The type parameter can be partition or wholedisk, and the device is the Linux device being accessed. Typical names would be /dev/hda1 for a partition or /dev/sda for an entire disk. The readonly qualifier is optional, and like the name infers, it
write-locks the disk or partition in question. If you boot Linux from a hard drive using LILO, do not access that drive using wholedisk. When DOSemu boots from that drive, it will give you a LILO prompt. Unfortunately, neither LILO nor Linux will run from
within a DOSemu session.
<BR>
<P>The following are some examples of valid entries for disks:
<BR>
<PRE>
<FONT COLOR="#000080">disk { partition "/dev/sda4" } # mount 4th partition
disk { partition "/dev/hda1" readonly} # mount 1st IDE partition readonly
disk { wholedisk "/dev/sda" } # mount the whole 1st SCSI disk</FONT></PRE>
<BLOCKQUOTE>
<BLOCKQUOTE>
<HR ALIGN=CENTER>
<BR>
<NOTE>Linux may have other tasks also accessing disks. To avoid problems with file corruption, disks mounted as read/write under Linux should be configured as read-only. Use umask=022 in the /etc/fstab entry for the dos partition:
<BR>/dev/hda1 /dos messydos umask=022</NOTE>
<BR>
<HR ALIGN=CENTER>
</BLOCKQUOTE></BLOCKQUOTE>
<BR>
<A NAME="E70E29"></A>
<H5 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>How To Access Any Linux Directory from DOSemu</B></FONT></CENTER></H5>
<BR>
<P>A much safer way to access a DOS directory is through the emufs.sys device driver. This driver enables you to access any Linux subdirectory as a logical device under DOS. In your config.sys of your boot device, simply add the lines
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">device = emufs.sys /c</FONT></PRE>
<P>where /c is the Linux directory you want to mount. The next available drive letter is used for this logical drive.
<BR>
<P>Any disk or device mounted in the Linux file system can be made available to DOSemu as a logical disk through the emufs driver. Disks and directories do not need to be DOS formatted and can include CD-ROMs as well as NFS and IPX mounted disks. However,
files in these directories must be in the MS-DOS 6.0 format to be visible under DOSemu.
<BR>
<P>With a logical device you can do typical operations such as read, write, and delete files, and run executables. Utilities such as drvspace, undelete, and defrag will not work on disks accessed through dosemufs.
<BR>
<BR>
<A NAME="E69E561"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Creating Diskimages</B></FONT></CENTER></H4>
<BR>
<P>DOSemu has an additional abstraction called a diskimage. A diskimage is a Linux file that appears to DOS as a logical device. Either a floppy or a hard disk is supported as a diskimage. A diskimage makes an ideal boot device because the size can be set
just large enough to boot MS-DOS. Unlike drives accessed by dosemufs, drives configured by diskimages work with utilities like undelete, scandisk, and defrag.
<BR>
<BR>
<A NAME="E70E30"></A>
<H5 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Creating Floppy Image Files</B></FONT></CENTER></H5>
<BR>
<P>A floppy disk file is easy to create under Linux. The floppy image file does not need to do anything except exist initially. To create an initial floppy image file use the touch command; for example,
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">touch filename</FONT></PRE>
<P>This new floppy will appear as an unformatted floppy when you boot DOSemu. Because the size of the floppy is configured in DOSemu, formatting the floppy will expand the image file to the expected size (1.44MB for a high-density, 3.5-inch floppy).
<BR>
<BR>
<A NAME="E70E31"></A>
<H5 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Accessing a Floppy Image Under DOSemu</B></FONT></CENTER></H5>
<BR>
<P>To use a floppy disk, you need to specify the floppy geometry for the benefit of DOS.
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">floppy { heads 2 sectors 18 tracks 80 threeinch file /usr/dos/hdimage }</FONT></PRE>
<P>This simulates a 1.44MB, 3.5-inch floppy. A diskimage floppy can be used in the same way as any floppy, except that it cannot be removed. Expect the diskimage floppy to operate significantly faster than a real floppy, with formatting taking only a few
seconds.
<BR>
<BLOCKQUOTE>
<BLOCKQUOTE>
<HR ALIGN=CENTER>
<BR>
<NOTE>Some DOS utilities that like to reboot MS-DOS, such as DRVSPACE, will check to see if you have a floppy in drive A before allowing you to continue. Because you cannot eject a floppy diskimage, you need to remove the floppy configuration and restart
DOSemu.</NOTE>
<BR>
<HR ALIGN=CENTER>
</BLOCKQUOTE></BLOCKQUOTE>
<BR>
<A NAME="E70E32"></A>
<H5 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Creating Hard Diskimage Files Under Linux</B></FONT></CENTER></H5>
<BR>
<P>Hard diskimage files are more confusing to configure than floppies. To initially create the hard disk file, use the command mkhdimage found in the periph directory of the DOSemu distribution. Instead of specifying the size of the image, you need to
specify the number of heads, sectors, and cylinders of the disk to create. The following is an example mkhdimage command that creates a 10MB disk:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">mkhdimage -h 8 -s 20 -c 128 > /usr/dos/hdimage</FONT></PRE>
<P>To compute the size of a disk based on disk geometry, multiply heads´sectors´cylinders´512 (number of bytes per sector under MS-DOS). Because these parameters do not represent the real characteristics of a disk, the ratio of heads to
sectors to cylinders does not matter to DOSemu. However, MS-DOS will only recognize the first 1024 cylinders of a disk.
<BR>
<P>Because mkhdimage only creates a file of 128 bytes, no other check of available space for the configured amount takes place. Do not configure a diskimage drive larger than the available disk space.
<BR>
<BR>
<A NAME="E70E33"></A>
<H5 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Accessing a Diskimage Under DOS</B></FONT></CENTER></H5>
<BR>
<P>To use a diskimage as a logical hard drive, use the disk parameter with a type of image rather than wholedisk or partition, as well as the name of the Linux file used.
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">disk { image "/usr/dos/hdimage" }</FONT></PRE>
<P>Like floppy diskimages, hard diskimages are not initially formatted. When a diskimage file is initialized it is also unpartitioned. Use the MS-DOS fdisk utility to create a partition on the drive you configure. To avoid confusion and data loss,
configure DOSemu with only one real floppy and only the new hard diskimage for a hard drive. Sometimes a new diskimage will appear to fdisk to have a partition created, but MS-DOS is unable to access the partition. The easy fix is to delete the existing
partition and re-create it.
<BR>
<P>Hard diskimages are different than floppies in that disk space used under Linux is allocated on demand. A newly formatted diskimage of any size takes up enough disk space to store FAT information. The disk file grows as disk space is used under DOS. An
interesting observation is if a diskimage is drvspaced under MS-DOS, drvspace will allocate the entire amount of space for its drive mapping.
<BR>
<BR>
<A NAME="E69E562"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Configuring Video Options for the Virtual Consoles of Linux</B></FONT></CENTER></H4>
<BR>
<P>Linux's virtual console can support more than just text-mode virtual consoles. Due to the direct-access nature of most DOS-based video, this is perhaps DOSemu's biggest weakness. Not all video boards will work correctly with DOSemu, and even fewer will
work perfectly. The basic configuration for the video section with graphics looks like the following:
<BR>
<PRE>
<FONT COLOR="#000080">video { type console graphics chipset chipset_type memsize kb vbios_seg address
vbios_size=hex }</FONT></PRE>
<P>If your video board is 100 percent VGA—compatible, omitting everything past the keyword graphics might work.
<BR>
<P>The following chipset keywords are supported:
<BR>
<UL>
<LI>et4000
<BR>
<BR>
<LI>s3 (801, 805, and 928)
<BR>
<BR>
<LI>diamond
<BR>
<BR>
<LI>trident
<BR>
<BR>
</UL>
<P>Video boards that do not have the BIOS configured at 0´C000 need the vbios_seg to be set to the actual address. When in doubt, the video BIOS starting address (vbios_seg) as well as the video BIOS size (vbios_size) can be determined by the
Microsoft Diagnostics (MSD) utility that comes with MS-DOS and Windows.
<BR>
<P>The following line will allow DOS access to known video ports directly, and will help compati-bility:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">allowvideoaccess on</FONT></PRE>
<BR>
<A NAME="E69E563"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Using DOSemu from Other Than a Virtual Console</B></FONT></CENTER></H4>
<BR>
<P>DOSemu does not need to run under just a Linux virtual console. DOSemu can run in an xterm, on a remote (network or dial-up) connection, or within its own X Window interface. Remote connections and xterms are configurable in exactly the same way as are
virtual consoles, except that no levels of graphics are possible. Remote sessions typically cannot generate a Ctrl-Alt-PgDn to end the session; using the exitemu.com is the quickest way to end a remote DOS session.
<BR>
<P>The X Window interface to DOSemu is called xdos. Xdos is a relatively recent development for DOSemu, and has only a few additional features over running DOSemu in an xterm. Xdos has built-in mouse support so that a mouse supported under X Window also
works within the xdos window. Graphics support does not yet exist for xdos, but may be eventually possible—development work is underway. Figure 57.1 shows an example xdos session running within X Window. Configuration parameters available for xdos are
listed in Table 57.1.
<BR>
<P><B> <A HREF="57rhl01.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/57rhl01.gif">Figure 57.1. Example xdos session running under X </B><B>Window.</A></B>
<BR>
<P>Parameters specific to xdos take the form
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">X { param1 value1 param2 value2}</FONT></PRE>
<BR>
<P ALIGN=CENTER>
<CENTER>
<FONT COLOR="#000080"><B>Table 57.1. Xdos-specific </B><B>dosemu.conf</B><B> parameters.</B></FONT></CENTER>
<BR>
<TABLE BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 WIDTH="100%" CELLPADDING=2 >
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<I>Parameter</I>
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<I>Sample </I>
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<I>Meaning</I></FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
title
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
"DOS box"
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
X Window—specific title.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
display
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
"mybox:0"
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
X server to use if xdos is to be displayed on another X server.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
font
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
"vga"
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Monospaced font to be used.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
icon_name
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
"xdos"
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Icon name to use when DOSemu iconized.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
updatelines
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
25
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Number of text lines in the display.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
updatefreq
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
8
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
How often X updates the xdos screen. 20 is approximately once per second.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
blinkrate
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
8
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
How often the cursor blinks.</FONT>
</TABLE><P>A starting point for configuring xdos is the following line:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">X { title "DOS box" icon_name "xdos" updatelines 25 updatefreq 8}</FONT></PRE>
<BR>
<A NAME="E69E564"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Configuring Keyboards</B></FONT></CENTER></H4>
<BR>
<P>The DOSemu keyboard can be configured to handle a number of different keyboard layouts for international keyboards. If a given layout is available in the Linux kernel configuration, it is probably available to DOSemu. The following is the default
configuration for a keyboard:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">keyboard { layout us keybint on rawkeyboard off }</FONT></PRE>
<P>The keybint option enables DOSemu to handle keyboard interrupts more accurately but is a bit unstable.
<BR>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?