Mast Kalandar

bandar's colander of random jamun aur aam

Thu, 07 Nov 2002

GNU/Windows?


floss [link] [comments ()] [raw]

A short write-up1 on how to get GNU and Windows2 software to interoperate.
You should only do this if you find it absolutely essential. Chances are that you do not need this at all. GNU software runs very easily on the Linux, Hurd and *BSD platforms and handles e-mail, web, editing, drawing and programming more than adequately.
Modulo the above warning, some users may still want to read on for a variety of reasons.

There are essentially three ways to get GNU and Windows(TM) software to interoperate:

  1. The above solution. Just migrate to GNU/Linux. Your life will definitely show improvement after about 6 months.
  2. Use Windows tools on GNU/Linux. This is the solution offered by tools like Wine, CrossOver, Lindows and Xandros.
  3. Use GNU tools on Windows. This is the solution offered by Cygwin and MinGW.
We will approach this problem from bottom-up since (3) is the most likely choice of people who were not convinced by the above warning!

1 Using GNU on Windows

1.1 Some ideological verbiage
Contrary to what you may have heard, the GNU folks are not against you using GNU software on a Windows platform. Use it, get familiar with it, and find out (after a while) that you hardly use the so-called tools that come bundled with your so-called operating system. Then you are ripe for the switch-over to solution (2) or even (1) (being hopeful here!).

Secondly, it is not essential (though it is ideologically desirable) to use Linux or *BSD or Hurd to run GNU software. GNU software was designed with portability in mind. GNU software runs easily on multiple platforms (except Apple but that is long story). In fact, a typical user of a GNU/Linux system uses very little of the Linux aspect and would probably not be able to tell the difference between her system and GNU/*BSD.

It is thus appropriate that the solution outline below be called GNU/Windows -- perhaps that is an oxymoron!

1.2 User interface
The two systems described below work within the user interface of Windows or DOS. In addition, you can also get the look and feel of a ``terminal window'' (as in X) with a bash or tcsh command prompt. Standard (for GNU systems) utilities like TEX, EMACS, GIMP, Ghostscript, Xfig, Gnuplot and others are also available. Cut and paste between these utilities and the Windows programmes is also possible. You can even run web services via Apache and use Secure Shell (OpenSSH). You can read/compose your mail using Mutt or Elm or Pine. At the same time if you have essential need for Internet Explorer or Outlook or Office then these come from your Windows environment.
1.3 CygWin - RedHat on Windows
Cygwin is a POSIX environment developed by RedHat which allows users to experience the glory of using GNU tools on a Windows platform. At base it consists of cygwin1.dll which is an emulation layer that emulates the GNU library calls on the windows platform. In addition numerous pre-compiled tools from the GNU software suite are made available at www.cygwin.com along with a setup/configuration/upgrade tool.

Installation of a cygwin system from Windows is as easy as connecting to the above site and clicking on various buttons. In other words, one can safely say that the users wanting the easiest approach to using GNU tools while not losing their favourite Windows environment will find CygWin the most comfortable of all.

1.4 MinGW - Minimalist GNU for Windows
(For those who know their history of the recent past--recall that Linux started off as a better way to port the GNU compilation suite to Minix). The Minimalist(!) GNU system for Windows is at the base a port of (that extremely basic) GNU compilation suite to Windows. In combination with MSYS (or minimal system) which provides a POSIX command line and programming environment, this provides a context in which most of the standard configure, make and make install installations of GNU software work.

Thus, to install a MinGW-base GNU/Windows system you need to download and install the MinGW and MSYS packages from mingw.org. This provides us with the environment to download and install source-based packages from ftp.gnu.org and other sources.

Clearly, this solution is not for the faint-of-heart. Perhaps someone will someday make a ``distribution'' like CygWin using MinGW. On the other hand perhaps someone has to use Windows and is a bit of a ``hacker''. Such a user will find this system ideal.

2 Using Windows on GNU

2.1 Some more ideological verbiage
While some may have entitled this section ``Windows on Linux'' , we will stick with calling the system GNU. It will become more and more clear as we go along that it is the GNU-ish aspect of the underlying system that is required to make things work rather than the Linux aspect. In fact, most of the solution outlined below work quite well with *BSD or Hurd and some can be made to work with Solaris or HP/UX as well. (Now if only some one set up a GNU/Solaris or GNU/HPUX site!).
2.2 User Interface
The user is faced with the common X (or other) graphical interface in its simpler (twm, fvwm) or more fancy (KDE or Gnome) form. The Windows applications can be started in a ``sub''-window (which can even be full screen). Thus (if you must) you can run Internet Explorer, Office or Outlook right from within your X interface with no need to re-boot. At the same time you are in a multi-user environment with the protection from viruses and other nefarious bugs and crashes that this can bring you. (Don't try any of these as root!). You can even run Windows applications in ``sandbox'' environments if you are particularly paranoid.
2.3 Crossover, Lindows and Xandros
If you are willing to spend some money (of the order of $100-$200) there are complete point-and-click installations of GNU (Linux) that come with adequate tools to get current applications from Windows working. These solutions use the CrossOver package developed by CodeWeavers who also contribute to the Wine project. The relevant urls are codeweavers.com, xandros.com and lindows.com. There is more than enough help and support (after all you pay for it!) from these sites to install and run these systems. Reports are generally positive.
2.4 DosEMU
If you have some old DOS stuff that you absolutely must access, this is your easiest solution. You need to install only one package dosemu and then go through that more or less fully automated install. After that you have DOS in a window panel or even at a command line in an existing panel. You need to have a DOS boot floppy or FreeDOS freedos.org in order to have even a ``base'' working system.
2.5 Wine
The Wine Project at winehq.com is an ongoing project that aims to implement the Windows Application Layer on top of X and Unix. In some ways this is a reversal of what CygWin does. The problem is that the the POSIX and X interfaces are very well documented so that constructing exact replications of these interfaces is easier than doing it the other way around. The Windows ABI changes with each release of Windows. Further, some ``fast'' interfaces are only released based on non-disclosure agreements which makes the job of the programmers at the Wine Project rather hard. Still, this is an excellent interface for running a large number of Windows applications like Office (even the latest XP version!). Moreover, since Wine implements the DLL based interfaces of Windows you do not actually have to buy Windows to get various programmes working.

3 Reading Windows files on GNU

3.1 Yet more ideological verbiage
Since Windows is such an incredibly important operating system created by a company with the best programmers in the world, they have no option but to invent their own file formats and conventions that differ from standards created elsewhere! In any case, there are always problems of interoperation and most people want Windows only because some of their friends and colleagues have it too and send them these files which they can't access. Now it is not entirely clear why it can't work the other way--why can't the Windows guys figure out ways to convert their files before they send them? Perhaps the answer is that GNU tends to empower folks and get them to think about other people's problems as well--Windows users tend to have a more monotonous view of a sanitised world!
3.2 Graphics
Other than standards like PNG, JPEG and so on it is possible that your Windows friends may send you files in WMF or BMP formats. The program convert that is part of the ImageMagick suite is a general purpose graphical conversion tool that will solve most of your problems. It does depend on external tools like libwmf for some formats like WMF. The only complaint that some may have with Imagemagick is that it (occasionally) produces ``fat'' files. Reading the documentation on proper command line switches may help in this respect. In reverse, you may wish to use this so that you avoid sending XPM to Windows users. To convert PostScript files to PDF using ps2pdf (get a new version of ghostScript!) is also a good idea as most Windows programs cannot handle these files.
3.3 Audio
Most of the audio utilities have converged onto a few formats and so one is on somewhat safer territory here. However, you may find someone sending you RIFF files or some other obscure format. The universal program is sox that is like convert but for audio. Two exceptions to this are MP3 and MIDI. For the former you may find mpg321 a useful utility. The latter format is actually not an audio format but is compressed musical notation somewhat like DVI for TEX. In any case, there is extensive support for MIDI in GNU. The most generic application for playing MIDI is timidity. Finally, there is ``Real Audio''. For this you (currently) need the ``Real Player'' which may or may not work. (More info on this is in the next subsection).
3.4 Video
This is still an evolving medium so there are a number of variants that have less or more support under GNU. The typical VCD is stored as MPEG and can be played easily. The thumb rule here is to use xine. You can also find plugins for xine by following the links at xine.sourceforge.net. The sole exception to this is ``Real Video''. This is a proprietary format and one needs to buy or download the player. However, the company has announced that it plans to release the codec details soons. If this happens, then sox would be able to support conversion.
3.5 Compressed Archives
Numerous compression methods are in use. The utilities zip/unzip, lharc, zoo and unrar are typically required to convert files that may be sent in archived format from Windows environments. The program cabextract is also useful to extract files from the CAB ``cabinet'' format.
3.6 Text
Under this umbrella of ``text'' one includes all the remaining types of files! The first thing to note is that actual text files require conversion because of differences between the way lines are terminated on DOS and *nix. The programs todos and fromdos perform the neccessary conversion. The second thing to note the useful-ness of strings (used as strings -a) which will try to extract all possible textual data from any file. This may even extract data which the sender did not know she was sending!

The typical file sent by most Windows users to others is a DOC file. Unfortunately, the details about this format are undisclosed and also undergo periodic review causing most conversion utilities to choke. In spite of this the wv library and suite is very useful as it does 90% of the job in 90% of the cases. For the remaining cases you may have little option but to use abiword or the much larger openoffice or staroffice.

Another typical format used by Windows is RTF. Unlike DOC the details of this format are publicly disclosed and so conversion is feasible. The typical utility is unrtf.

Finally, some folks use PowerPoint to develop presentations and then mail these presentations to folks! The program ppthtml is able to convert the PowerPoint to HTML. After this a Web browser like mozilla should be able to view the file. Note however that there may be embedded graphics which are in WMF files and embedded audio and so on. These would have to be converted on-the-fly by making suitable ``Helper'' entries in the ``Preferences'' menu for mozilla.



Footnotes

... write-up1
The author is grateful to Rahul Sinha for numerous pointers regarding Windows systems.
... Windows2
all trademarks used in this write-up are owned by their respective owners!



Archives

< November 2002 >
SuMoTuWeThFrSa
      1 2
3 4 5 6 7 8 9
10111213141516
17181920212223
24252627282930

2016, 2015, 2014, 2013, 2012, 2011, 2010, 2009, 2008, 2007, 2006, 2005, 2004, 2003, 2002, 2001, 2000, 1999, 1997, 1995,