Cygwin gives you the ability to do Linux-like development in a WinXP window without installing Linux as a seprate operating system. It is very compatible with Linux (although Linux apps must be recompiled). There is only a small performance penalty. These notes pertain to the distribution available in my classes. They may also be useful to students in other disciplines. Contact me if there are questions.
Getting the distribution:
http://neamh.cns.uni.edu/cygwin.zip
Download and save this file to the root directory of your C: disk if it has enough space. to hold the installation (about 2.55 GB and 136,463 files). Otherwise, use a different disk and replace "C:" in the following by that disk letter.
The following are annotated screen shots of the install. I used Firefox as the web browser to download the distribution. MS IE has a similar download set of screens.
Note: if you are re-installing, remove all copies of the old distribution and its directories. You should also edit your Windows registry and delete all references to "cygwin". Editing the registry is dangerous and you do not want to make a mistake. You edit the resgistry using the progrem "regedit" and it has a search function. Search for cygwin. When you exit regedit, the changes are made permanent. Unfortunately, cygwin remembers past installs and they can interfere with new installs.
|
The basic installation is done. You may now alter the colors and default screen size.
Colors
Start cygwin.Right click on the title bar and then click "Properties".
Click Colors tab
Select a screen background color (you can adjust the color by playing with the Red Blue and Green "Selected Color Values"
Repeat above for "Screen Text".
Click OK
Click "Modify Shortcut ..." button and then click OK.
exit and restart - your colors should be set. If not, try again.
Window size
Right click the cygwin title bar.
Click "Properties"
Click "Layout" tab
Adjust the "Window Size" as desired. The small picture will show how much of your screen will be the cygwin window (it can be minimized). Also use the "Window Position" adjustments (after clicking the "Let system position window" box off). Don't make the window too big or it will exceed your screen size.
The "Screen Buffer" adjustments determine how many prior lines can be scrolled back to. You probably want to leave this alone.
Try entering and compiling a program:
nano prog1.c
Type the "Hello World" program. Use the arrows, delete and backspace to navigate. Hit Control-O to write the file out (^O). Hit "enter" when nano asks: "File name to write". Hit Control-X (^X) to exit nano.
compile the program:
gcc prog1.c
run the program:
./a
or
./a.exe
Exiting
You can exit Cygwin by typing exit or clicking the X box in the upper left hand corner of the window. Sometimes, when you type exit, it will ask if you want to exit the batch job. Type Y.
X Windows
After you have successfully installed cygwin on your MS WinXP system, you may want to run X Windows. This can be done as follows:
X Windows should now start and you should see something that looks like:
- save the file xw.tar to:
c:\cygwin\home\user
(assumes you installed to the C: drive).
- start cygwin.
- type:
tar xvf xw.tar
- type:
xinit
![]()
This is the fvwm2 window manager. An xterm window is opened by default. You may exit X Windows by hitting the control-alt-backspace keys simultaneously.
Note there are four desktops (see lower left box). You may switch from one to another by clicking the appropriate box.
If you move your cursor to the MS Windows command bar, X Windows sometimes interpretes this as a command to move to a lower desk top (see display in lower right corner). Return to the correct desktop by clicking in its window.
To bring up applications, right click in an unused window area and select from the menu or enter the application command and any parameters into a command window. For example, type:
xeyes &
Focus follows Mouse!!! That is, the window under the mouse is the active window. Move the mouse to another window, and it becomes active.
You may drag windows by holding down the righ mouse botton over the menu bar and dragging. Resize and application by moving the mouse to a corner and, when the cursor changes, hold the right button down and drag.
If you are using a firewall, you may be asked several times for permission to access the internet. This is normal and represents internal communication between modules.
Toys
xearth
- start cygwin.
- download the xearth distribution with the following commands to cygwin:
wget http://www.cs.uni.edu/~okane/cygwin/xearth-1.1.tar.gz
- unzip/tar the file:
tar xvzf xearth-1.1.tar.gz
- enter the directory created:
cd xearth-1.1
- build the program:
xmkmf
make allyou will see many messages. this is compiling and building the program.
- start X Windows:
xinit
- from the command window, move to the xearth-1.1 directory if you are not already there (check where you are by typing pwd) and run the program:
xearth &
The background of your X Window display will be a globe of the earth that will update and rotate:
![]()