📄 ch62.htm
字号:
Something Other Than a Virtual Console</FONT></H4>
<P>DOSemu does not need to run under just a Linux virtual console. DOSemu can run
in an <TT>xterm</TT>, on a remote (network or dial-up) connection, or within its
own X Window interface. Remote connections and <TT>xterms</TT> are configurable in
exactly the same way as virtual consoles, except that no levels of graphics are possible.
Remote sessions typically cannot generate a Ctrl-Alt-Page Down to end the session;
using the <TT>exitemu.com</TT> is the quickest way to end a remote DOS session.</P>
<P>The X Window interface to DOSemu is called xdos. Xdos is a relatively recent development
for DOSemu, and it has only a few additional advantages over running DOSemu in an
<TT>xterm</TT>. 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 it might eventually be possible--development work is underway. Figure 62.1
shows a sample xdos session running within X Window. Configuration parameters available
for xdos are listed in Table 62.1.</P>
<P>Parameters specific to xdos take the following form:</P>
<PRE><FONT COLOR="#0066FF">X { param1 value1 param2 value2}
</FONT></PRE>
<H6><FONT COLOR="#0066FF"></FONT></H6>
<P><A NAME="Heading17<A HREF="../art/62/62lnx01.jpg"><FONT COLOR="#000077">FIGURE
62.1.</FONT></A><FONT COLOR="#000077"><I> </I></FONT><I>A sample xdos session running
under X Window.</I></P>
<CENTER>
<P><FONT SIZE="4"><B>Table 62.1. Xdos-specific dosemu.conf parameters. </B></FONT>
<TABLE BORDER="0">
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT"><I>Parameter</I></TD>
<TD ALIGN="LEFT"><I>Sample</I></TD>
<TD ALIGN="LEFT"><I>Meaning</I></TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT"><TT>title</TT></TD>
<TD ALIGN="LEFT"><TT>"DOS box"</TT></TD>
<TD ALIGN="LEFT">X Window-specific title.</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT"><TT>display</TT></TD>
<TD ALIGN="LEFT"><TT>"mybox:0"</TT></TD>
<TD ALIGN="LEFT">X server to use if xdos is to be displayed on another X server.</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT"><TT>font</TT></TD>
<TD ALIGN="LEFT"><TT>"vga"</TT></TD>
<TD ALIGN="LEFT">Monospaced font to be used.</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT"><TT>icon_name</TT></TD>
<TD ALIGN="LEFT"><TT>"xdos"</TT></TD>
<TD ALIGN="LEFT">Icon name to use when DOSemu is iconized.</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT"><TT>updatelines</TT></TD>
<TD ALIGN="LEFT"><TT>25</TT></TD>
<TD ALIGN="LEFT">Number of text lines in the display.</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT"><TT>updatefreq</TT></TD>
<TD ALIGN="LEFT"><TT>8</TT></TD>
<TD ALIGN="LEFT">How often X updates the xdos screen. 20 is approximately once per second.</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT"><TT>blinkrate</TT></TD>
<TD ALIGN="LEFT"><TT>8</TT></TD>
<TD ALIGN="LEFT">How often the cursor blinks.</TD>
</TR>
</TABLE>
</P>
</CENTER>
<P>A starting point for configuring xdos is the following line:</P>
<PRE><FONT COLOR="#0066FF">X { title "DOS box" icon_name "xdos" updatelines 25 updatefreq 8}
</FONT></PRE>
<CENTER>
<H4><A NAME="Heading18<FONT COLOR="#000077">Configuring Keyboards</FONT></H4>
</CENTER>
<P>The DOSemu keyboard can be configured to handle various keyboard layouts for international
keyboards. If a given layout is available in the Linux kernel configuration, it is
probably available to DOSemu. This is the default configuration for a keyboard:</P>
<PRE><FONT COLOR="#0066FF">keyboard { layout us keybint on rawkeyboard off }
</FONT></PRE>
<P>The <TT>keybint</TT> option enables DOSemu to handle keyboard interrupts more
accurately but is a bit unstable.</P>
<P>The normal keyboard handlers should suffice for simpler DOS tasks, but they don't
handle more complicated keystrokes. Keyboard-intensive packages such as WordPerfect
that make heavy use of Alt and Ctrl keys need to be represented better. The <TT>rawkeyboard</TT>
option offers a nearly complete representation of the PC keyboard by bypassing all
key translations. This is known as raw mode. To use raw mode, simply turn it on in
the keyboard configuration. Raw mode is possible only when you are running DOSemu
from a virtual console.
<DL>
<DT></DT>
</DL>
<DL>
<DD>
<HR>
<A NAME="Heading19<FONT COLOR="#000077"><B>CAUTION:</B> </FONT>If DOSemu unexpectedly
exits while a keyboard is in raw mode, you might be stuck with a disabled keyboard.
The only option might be to reboot your PC.
<HR>
</DL>
<P>If you are running xdos, the keyboard mapping is controlled mainly by your <TT>~/.Xmodmap</TT>
file. Because the Backspace and Delete keys are typically reversed under X Window,
the following Linux commands restore the expected keystrokes:</P>
<PRE><FONT COLOR="#0066FF">xmodmap -e "keycode 107 = 0xffff"
xmodmap -e "keycode 22 = 0xff08"
</FONT></PRE>
<P>Changing this mapping might cause the same problem with other X Window applications.
<DL>
<DT></DT>
</DL>
<DL>
<DD>
<HR>
<A NAME="Heading20<FONT COLOR="#000077"><B>TIP: </B></FONT>Sometimes keystrokes
are echoed in duplicate. This phenomenon happens on consoles that have the <TT>istrip</TT>
setting turned on. To turn <TT>istrip</TT> off, use <TT>stty</TT>.
<HR>
</DL>
<CENTER>
<H4><A NAME="Heading21<FONT COLOR="#000077">Configuring Serial Ports</FONT></H4>
</CENTER>
<P>To configure serial ports, you simply need to make them known to DOSemu. The basic
configuration looks like this:</P>
<PRE><FONT COLOR="#0066FF">serial { com1 device /dev/cua0 }
</FONT></PRE>
<P>This example maps DOSemu's <TT>com1</TT> to Linux's serial port 0 (which maps
to COM1 under native DOS). You can specify additional parameters, such as the port
address and IRQ. All the serial port parameters except the Linux port apply only
to ports configured under DOSemu. DOSemu accesses the real serial ports as Linux
devices that are configured by the kernel. The IRQ, COM port number, and port addresses
are what you want DOSemu to simulate, and they do not need to match the actual hardware.
The same IRQ restrictions between COM 1/3 and COM 2/4 still exist under DOSemu. If
you cannot use two ports simultaneously under Linux, you cannot do so under DOSemu.</P>
<P>The following example configures the hardware <TT>com1</TT> as <TT>com3</TT> with
a different IRQ and base address:</P>
<PRE><FONT COLOR="#0066FF">serial { com3 base 0x3e8 iq 5 device /dev/cua0 }
</FONT></PRE>
<P>It is generally less confusing if you configure ports as they really exist.
<CENTER>
<H4><A NAME="Heading22<FONT COLOR="#000077">Configuring Printers</FONT></H4>
</CENTER>
<P>Printers under DOSemu can print to a device or file, or you can let a Linux program
such as <TT>lpr</TT> handle the output. Each printer statement in <TT>dosemu.conf</TT>
is assigned an LPT device number in the order in which it occurs in the file. Multiple
printers can be declared to DOSemu; however, MS-DOS has a set limit of three LPT
devices.</P>
<P>To configure a printer to save to a file or device, simply specify the <TT>file</TT>
keyword and the name of the file or device. A timeout value specifies how long DOSemu
waits in seconds after the last character is received before flushing data and closing
the file or device. Here are some example printer configurations using a file and
device designation:</P>
<PRE><FONT COLOR="#0066FF">printer { file "/usr/tmp/dos-print-1" timeout 10 }
printer { file "/dev/lp1" timeout 10 }
</FONT></PRE>
<DL>
<DT><FONT COLOR="#0066FF"></FONT></DT>
</DL>
<DL>
<DD>
<HR>
<A NAME="Heading23<FONT COLOR="#000077"><B>CAUTION: </B></FONT>Direct access
to a printer using the device name can cause problems if other Linux tasks also access
that device. Avoid this method if possible.
<HR>
</DL>
<P>To configure a printer to send data through an external program such as <TT>lpr</TT>,
specify the command to use and any options to include on the print line. The option
parameter must contain the string <TT>%s</TT> in the same place you would specify
the filename if you were using this command under Linux (for example, <TT>lpr -p
%s</TT>). An example of configuring the printer to print using <TT>lpr</TT> is as
follows:</P>
<PRE><FONT COLOR="#0066FF">printer { command "lpr" options "-p %s" timeout 10 }
</FONT></PRE>
<P>DOSemu implements printing as a two-step process:
<DL>
<DD><B>1.</B> Save the file to a temporary disk file.<BR>
<B><BR>
2.</B> Issue a command to print the file.
</DL>
<P>When the timeout expires, DOSemu closes the temporary file and issues the specified
command. The directory <TT>/usr/tmp</TT> needs to exist to save the temporary files,
and it should have world access.<EM> </EM>Setting the sticky bit on this directory
helps speed up printing. The sticky bit speeds up file access by maintaining the
files in memory rather than only on disk.
<CENTER>
<H3><A NAME="Heading24<FONT COLOR="#000077">Netware Support with DOSemu</FONT></H3>
</CENTER>
<P>You can get limited support for Netware access by using IPX from within DOSemu
with the use of the pktdrv driver.</P>
<P>The pktdrv packet driver uses interrupt 0x62. Following is the general procedure
for adding support:
<DL>
<DD><B>1. </B>Go to the DOSemu distribution directory (<TT>cd ./net)</TT>.<BR>
<B><BR>
2.</B> Copy the <TT>libpacket.c.single</TT> file to <TT>libpacket.c</TT>.<BR>
<B><BR>
3.</B> Copy the <TT>pktnew.c.single</TT> file to <TT>pktnew.c</TT>.
</DL>
<P>Now recompile DOSemu. Then take the steps described in the <TT>v-net/dosnet.README</TT>
file and rerun the emulator. There is also a file called <TT>Netware-HOWTO</TT>,
by Lauri Tischler (<TT>ltischler@fipower.pp.fi</TT>), that is included with the DOSemu
distribution. You can also get this document at the Web site <TT>http://sunsite.unc.edu/mdw/linux.html</TT>.
<CENTER>
<H4><A NAME="Heading25<FONT COLOR="#000077">Using Debug Parameters</FONT></H4>
</CENTER>
<P>A large level of debugging information is available under DOSemu. This information
is sent to <TT>stderr</TT>, but it can be sent to a file using redirection; for example,</P>
<PRE><FONT COLOR="#0066FF">dos 2> dbg.out
</FONT></PRE>
<P>Or it can be sent through a DOS command-line option:</P>
<PRE><FONT COLOR="#0066FF">dos -p dbg.out
</FONT></PRE>
<P>Approximately 20 different debug message types can be turned on. When you are
configuring DOSemu, the most useful message type is the <TT>config</TT> parameter.
This points out syntax problems in the configuration file. Turning on debug information
is most helpful when DOSemu returns to the shell prompt without any error messages.</P>
<P>The following debug configuration example shows all the available debug parameters:</P>
<PRE><FONT COLOR="#0066FF">debug { config off disk off warning off hardware off
port off read off general off IPC off
video off write off xms off ems off
serial off keyb off dpmi off printer off
mouse off}
</FONT></PRE>
<CENTER>
<H4><A NAME="Heading26<FONT COLOR="#000077">Other Configuration Parameters</FONT></H4>
</CENTER>
<P>Several miscellaneous parameters can be adjusted for DOSemu. Table 62.2 shows
the various parameters and their meanings.</P>
<CENTER>
<P><FONT SIZE="4"><B>Table 62.2. Other DOSemu configuration parameters. </B></FONT>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT"><I>Parameter</I></TD>
<TD ALIGN="LEFT"><I>Possible Values</I></TD>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -