• Aucun résultat trouvé

If you are a recent converter to Linux, live in both worlds, or haven’t found replace-ment programs for those in Windows, then you’re in luck. Using special programs — which emulate the Windows application, create special environments, or simply run the Windows application — gives you the best of both worlds. However, I cau-tion you that you should not view this as a permanent solucau-tion to migrating applica-tion funcapplica-tions from another platform.

Using one of the following programs does not guarantee the success of launching your favorite Windows program. There are many unpredictable elements to con-sider, especially with x86 machines. The hardware for x86 machines was not designed to have more than one operating system running at a time. The hardware only allows one program that makes use of it; in the following program, an emulator must emulate the hardware as well as the operating system.

DOSEMU

When you have a legacy DOS program to run, you can use DOSEMU

(www.dosemu.org) to run the application on your Linux system. This program cre-ates a virtual machine for the DOS environment under Linux. You can see what the DOS environment looks like in Figure 7-1. You can even run Windows 3.1 in this envi-ronment. This is a self-contained environment for DOS. You can set it up in a couple of ways in order to access files.

Note

Figure 7-1: DOSEMU works just like DOS run natively on a 386 machine.

One way to set up DOSEMU is to use a virtual DOS filesystem running on top of the Linux filesystem (the default). When you run DOS, it appears as if files are in their own drive space. The other option is to create a DOS partition and mount it under Linux. This can be a full drive or just a partition. You can change the parameters for specifying the drive and other configuration settings in the /etc/dosemu/conffile.

Because DOSEMU is not an emulator, it requires a version of DOS to be installed.

The Debian version of DOSEMU uses a free version of DOS called FreeDOS (www.freedos.org). FreeDOS works like any other version of DOS. There are a few drawbacks to it in that it is still under development. For instance, there is no SCSI support for DOS programs yet.

Through the configuration file, you can set the drives for the DOS system — hard drives, floppies, and CD-ROMs. You can also set the paths for the Windows files.

Installation

You can easily install DOSEMU using the dselectprogram for Debian. Search in the applications list for DOSEMU. There are no supporting packages; everything that it needs is installed. Once installed, DOSEMU is simple to use. Following are a few of the ways you can start a DOS session under Linux.

dos— This starts the Linux DOS emulator known as DOSEMU.

xtermdos— This brings up the DOS emulator in an xtermenvironment. It automatically detects the IBM VGA font and the best xterm to run and then runs the terminal with the proper parameters required to run DOSEMU.

dosdebug— This controls or debugs an already running DOSEMU session.

Note

xdos—This starts DOSEMU in its own X window. You can also start it using dos -X.

dosexec — This starts DOSEMU and then executes a DEXE file. You can also do load an executable DOS file using dos -L.

Now that you have a DOS session running on your Linux system, what do you do next? One thing you must know is how to close a DOS session. It takes a particular keystroke sequence to get out of the session. Press Ctrl+Alt+PgDn to close

DOSEMU.

DOSEMU is not a finished product, so it produces many bugs and problems.

However, improvements are made all the time. You can access the Web site to check for updates, report any bugs, and find out the latest news on the program.

You can also check on the latest available Debian package at www.debian.org/

Packages/unstable/otherosfs/dosemu.html.

Wine

Wine Is Not an Emulator, hence the name Wine. Similar to DOSEMU, Wine is more of a virtual machine where DOS loads an application into an emulated DOS environ-ment. Wine is an environment in which Windows applications can run, but that environment is not emulated. Built using the Application Program Interface (API) for Windows, Wine reads the interaction that a program has in Windows and trans-lates it to something that Linux can understand. You can find out more about Wine at www.winehq.comwhere advancements are made all the time.

Installation

When installing Wine through dselect, all the dependencies, required files, and conflicting applications are predetermined by the Wine package set of dependen-cies. Of course, that is true no matter which application you install using dselect. Search for the application using the forward slash (/), then type wineand press Enter. Use the backslash (\) to find the next instance of the string you are searching for. The only one you really need is wine; however, you may wish to install the wine-docdocumentation package as well. There are a couple of library packages for Wine as well.

Configuration

The best way to use Wine is with a dual boot system — Windows and Linux. You can add the Windows partition to the filesystem to make it accessible to Linux. Add the following line to your /etc/fstabfile:

/dev/hda1 /mnt/win vfat defaults,user 0 0 Caution

/dev/hda1is the Windows partition containing the Windows software. /mnt/winis the starting path that Linux uses to mount the Windows partition. Make sure that the path exists before mounting the partition. If not, you need to make a directory for it. If you choose to make the starting path the same as I have it here, you can create the path with this command:

mkdir /mnt/win

You can also change it to whatever you like. Just make sure that the path exists;

otherwise, it cannot mount. The rest should remain the same for the filesystem table (fstab).

After the Windows partition has a mounting path, edit the Wine configuration file (/etc/wine.conf) to reflect the path. You can see from some of the settings in the configuration file shown next that the paths for the floppy, CD-ROM, and C drive all match the mounting path. By default, the C drive is set to /c, which I changed to match the actual path. The F drive in this configuration refers to the user’s home directory. Finally, the WINE area sets the parameters that reflect the location of the Windows files and Windows system files.

[Drive A]

[wine]

Windows=c:\windows System=c:\windows\system Temp=e:\

Path=c:\windows;c:\windows\system;e:\;e:\test;f:\

SymbolTableFile=/usr/lib/wine.sym

The rest of the configuration file is safe to leave alone because it deals with the specifics of the programs. This is where you set some options — such as serial ports, parallel ports, and printer ports.