general

What is UWIN?
UWIN is a UNIX to Windows Integration Toolkit that gives you almost all the features of a traditional UNIX operating system on Windows 7, Windows Vista, Windows XP, Windows 2000, Windows ME, and Windows 95/98.
Why did we write UWIN?
We needed a UNIX layer to port the AST Toolkit to Windows so that applications using the AST toolkit would run on Windows platforms without the need to recode or to support multiple versions of the software. At the time we started UWIN, there were no alternatives. Now there are alternatives such as Cygwin and Unix System Services, but neither meet our needs as closely as UWIN does.
Which is the latest version of UWIN available?
Version 5.0 is the latest version of UWIN.
Who are the authors of UWIN?
Most of the POSIX library was created David Korn, author of the KornShell at AT&T Research. Portions of the code were developed under contract by Wipro, Ltd, in India. The AST Toolkit which provides most of the UNIX utilities are part of the AST Toolkit developed primarly by Glenn Fowler, David Korn, and Phong Vo of AT&T Research. A few of the utilities were built from GNU or BSD source code.
Are there separate versions of UWIN for different versions of Windows?
No, the same UWIN binaries should work with all versions of Windows.
What are the licensing terms for UWIN?
Starting with release 5.0, most of UWIN base package is available under the EPL 1.0 (Eclipse Public License version 1.0) license which is an Open Source License approved by the Open Source consortium. The vt100 emulator uses an MIT license, and a few utilities use BSD or GPL licenses. All of these are Open Source license. Earlier versions of UWIN had separate educational and commercial licenses.
Can closed source applications use UWIN?
The EPL license does not require you to make your source code available in order to use EPL software. The GPL license requires you to make source code available for any binaries that use GPL code. As long as you do not use any GPL code, you can use UWIN without making your source code available.
Why is UWIN split into packages?
The primary reason for splitting into packages was to reduce the size for users that do not require everyting. For example, users that don't do software development do not need the development package. Not everyone requires the X11, groff, or perl software either. The license for these add-on packages might differ depending on where the sofware has been derived from. In addition, once the base package is installed, the installation of other packages can use standard UNIX tools for installing these additional packages.
What is UWIN Base package?
UWIN Base package consists of the UWIN runtime libraries, shells, utilities, daemons and services. It provides a virtual UNIX environment on Windows. Most of the utilities were developed by AT&T and conform to POSIX.2 and X/Open. A few utilities were compiled from GNU and BSD source code.
What is UWIN Development pagkage?
UWIN Development package adds application development support on UWIN. It consists of header files, libraries and development utilities like cc, make, rcs, etc. It can be used to build UWIN applications and/or to build native applications. The UWIN Development package requires the UWIN base package to be installed on the system.
What are some other add-on packages?
The X11 base package provides a number of X11 client applications as well as an X11 server. The X11 development package provides include files and libraries needed to build X11 applications. The perl package is a compilation of perl 5.8. The groff package is a compilation of the GNU groff utilities.
Is UWIN supported?
Currently UWIN is unsupported. However since UWIN is used internally at AT&T, we need to maintain it for internal use. By providing UWIN under an Open Source license, we are hoping that some organization(s) will provide support for UWIN.
Where do I report bugs in UWIN?
There are two mailing groups for UWIN that you can use for this purpose as well as to get more UWIN information. The uwin-users@research.att.com group is more general, wherease the uwin-developers@research.att.com is for users that are developing applications that run under UWIN. In addition, problems that are related to the AST Toolkit, and not UWIN specific, can be posted on the ast mailing group. We are happy to receive bug fixes from users and will merge them into our base software.
Is source code available?
Yes, the source code as a separate package. It requires the version 4.0 or later development kit to build UWIN. Some parts of UWIN require the Microsoft Visual C/C++ compiler to build. The compiler can be downloaded from the Microsoft site.
Does UWIN require the POSIX subsystem on Windows NT or XP?
No. UWIN does not require POSIX subsystem. UWIN APIs are implemented using Win32 APIs and therefore interacts only with the WIN32 subsystem of Windows.
Does UWIN conform to the X/Open standards?
While UWIN contains nearly all of the X/Open 95 interaces, UWIN Version 4.0 has not been tested for X/Open Conformance.
Does UWIN handle UNIX permissions?
UNIX permissions are handled on Windows NT/2000/XP only. The UNIX permissions are implemented in terms of the NT security permissions. Administrator has only some of the root privileges. Setuid and setgid programs can be created for a user provided that UCS for that user is installed.
Can UWIN handle upper and lower case distinction?
Case distinction is not handled by default, but any part of the file system can be mounted as case sensitive both in Windows NT/XP and Windows 95/98 using loop back mounts. The performance of the system might be impacted somewhat and the names for some files might be different in UWIN than with the native system.
Are UNIX ttys and links supported?
Yes, but they are not accessible outside UWIN. Hard links are supported for Windows NT/2000/XP and Windows 95/98 but are accessible outside UWIN only on Windows/NT NTFS file systems. Symlinks are accessible as shortcuts outside of UWIN.
Are tape devices supported?
Tape devices are supported for Windows NT/2000/XP only. You can use the tar command to create and restore tape archives.
Are ptys supported?
Yes. The master pty is /usr/dev/ptym[0-9A-F] and the slave pty is /usr/dev/ptys[0-9A-F].
Does UWIN work with Samba?
Yes, UWIN will work with the Samba file system but on some versions of Samba file permissions are not supported.
Is the /proc directory supported?
Yes, a number of features of the /proc file system are supported by UWIN.
Can I access Windows Registry using UWIN?
The Windows Registry can be accessed as the virtual file system mounted at /reg from UWIN. Keys that contain subkeys are directories. Without a trailing /, each registry key is a file whose contents are the value of this registry key.
How do I change just one registry subkey for a key that has multiple subkeys?
Use the ... registry pathname operator to access individual subkeys by name:
# this key has subkeys
$ cat '/reg/HKLM/SOFTWARE/AT&T Labs/UWIN'
Release=5.0
# and this list the Rlease subkey value
$ cat '/reg/HKLM/SOFTWARE/AT&T Labs/UWIN/.../Release'
5.0
... may be used to create and delete subkeys:
$ cat '/reg/HKLM/SOFTWARE/AT&T Labs/UWIN/5.0/Install'
Root=/C/Program Files/UWIN
Home=/C/Users
$ cat '/reg/HKLM/SOFTWARE/AT&T Labs/UWIN/5.0/Install/.../Test'
cat: /reg/HKLM/SOFTWARE/AT&T Labs/UWIN/5.0/Install/.../Test: cannot open [No such file or directory]
$ echo AHA > '/reg/HKLM/SOFTWARE/AT&T Labs/UWIN/5.0/Install/.../Test'
$ cat '/reg/HKLM/SOFTWARE/AT&T Labs/UWIN/5.0/Install/.../Test'
AHA
$ cat '/reg/HKLM/SOFTWARE/AT&T Labs/UWIN/5.0/Install'
Root=/C/Program Files/UWIN
Home=/C/Users
Test=AHA
$ rm '/reg/HKLM/SOFTWARE/AT&T Labs/UWIN/5.0/Install/.../Test'
$ cat '/reg/HKLM/SOFTWARE/AT&T Labs/UWIN/5.0/Install/.../Test'
cat: /reg/HKLM/SOFTWARE/AT&T Labs/UWIN/5.0/Install/.../Test: cannot open [No such file or directory]
$ cat '/reg/HKLM/SOFTWARE/AT&T Labs/UWIN/5.0/Install'
Root=/C/Program Files/UWIN
Home=/C/Users
Can I take a binary from UNIX to UWIN?
No. UWIN does not provide binary level compatibility. But in most cases the UNIX code can be taken to UWIN and compiled to get a binary (.exe) working on Windows.
I am running 64 bit Windows, do I need 64 bit UWIN?
32 bit and 64 bit UWIN run on 64 bit Windows and both can be installed on the same machine. If you plan on developing 64 bit applications then install 64 bit UWIN; if you plan on developing 32 bit applications then install 32 bit UWIN; if you plan on doing both 32 and 64 bit development then install both 32 and 64 bit UWIN. Absent development preferences install 64 bit UWIN -- 64 bit is the future of Windows -- eventually 32 bit applications will go the way of 16 bit applications. We don't have hard performance numbers yet, but UWIN 64 does feel a bit peppier.


installation

How much space will UWIN take up on my system?
UWIN will typically use about 25-30 MB of disc space.
Does it matter whether I install on a FAT partition or an NTFS partition?
Some UNIX features will not be available if you install on a FAT partition. In particualy, UNIX file permission only work on NTFS and therefore some commands might not be secure on FAT.
Are the registry keys created for UWIN? If so, where?
Yes, registry keys are all created in
HKEY_LOCAL_MACHINE\SOFTWARE\AT&T Labs\UWIN\
Note the the directory that you choose to install UWIN will become the UWIN_ROOT which is referenced by / from UWIN. Most of the entries in the registry can be controlled by the UWIN Applet.
Does it matter what directory I install UWIN in?
No, it should not matter. However, you should install it on an NTFS file system rather than a FAT file system if possible.
What is the UWIN Applet?
The UWIN applet is a program that is invoked from the Window Control Panel which can be used to configure UWIN and to stop and start services.
What is the UMS service?
On NT/2000/XP UWIN creates a service known as the UWIN Master Service which should start up whenever you start the system. This service runs the shell script /etc/rc. In addition, the Master Service handles setuid/setgid requests and starts up UCS servers to run these requests.
What does /etc/rc do?
The script /etc/rc is executed when UMS starts up. This script is used clear out files, run inetd, and start the at/cron daemon. In addition, you can edit it to start the X11 server or the ssh daemon.
What is the function of UCS in UWIN?
A UWIN Client Service (UCS) has to be installed for every user to whom a setuid() call is to be made. Telnet-ing to a user account in UWIN, automatically installs a UCS service for that user. Alternatively, UCS services can be created by the /etc/ucs command and from the UWIN Applet.
How do I restart UWIN without re-booting the machine?
You can do this from the control panel under the master serice tab. You can stop the UMS service which will kill all UWIN processes and then restart the service. Alternatively, the script /etc/stop_uwin should stop all uwin processes.
Does UWIN log error messages and if so where?
The following are the list of log files associated with UWIN processes and services:

/tmp/install_log    UWIN Installation trace
/tmp/uwin_log    Windows API errors
/tmp/ums.out    UWIN Master Service errors
/tmp/ucs.out    UWIN Client Service errors
How can I generate the /etc/passwd and /etc/group files?
On NT/2000/XP the /etc/passwd and /etc/group files are generated when the UMS service starts. They can be regenerated running /etc/mkpasswd. Note, that the /etc/passwd.add will be prepended so that you can override generated entries. On Windows 95/98/ME you need to generate these manually.
How can I manipulate the maximum values for IPC (inter-process communication) configurations?
You can manipulate the IPC values using the System tab in the UWIN applet and can revert back to default values using the Restore Default button.
How can I prevent anyone from telnet-ing into my machine?
You can disable the telent service to prevent anyone from telneting into the system or you can selectively allow or disallow users by entries in the files /etc/login.allow and /etc/login.deny.
How do I Enable/Disable the services like ftp, telnet, rlogin and rsh?
You can edit the /etc/services file directly or you can do this with the UWIN Applet as follows:
  1. Open Inetd Tab of the UWIN applet.
  2. Double Click on the service name you want to enable/disable or select the service name and click on Configure button.
  3. Check/uncheck the Enable combo box.
  4. Click the OK button.
Why do I get telnet: Unable to connect to remote host: Connection refused message when I try to telnet into a UWIN box?
One of the common reasons why this happens is that the inetd may not be running on the UWIN host. First check if UMS services is running on the host machine. If UMS is not running then start uwin service. This will start inetd by default. If UMS is already running on the host, start inetd using /etc/inetd & command from the prompt.
How do I start the ssh daemon?
After you have done the key setup, you can add /usr/sbin/ssh to the /etc/profile file.


usage

How do I get a shell Window?
Double click on the UWIN desktop icon labled Ksh so start a shell window. This will create a console window with a UNIX shell.
How do I name files with UWIN?
UWIN uses UNIX naming conventions with / meaning the UWIN_ROOT. Each drive is mounted under /. The directories on the filesystem can be accessed using /<drive_letter>. For example, /c/temp refers to the temp directory on the C drive.
Can I specify environment variables containing path names to be converted to and from native format like PATH is?
The environment variable DOSPATHVARS can be set to a space separated list of names of additional variables to be converted to and from native path formats.
Can I access other shared directories from UWIN?
The directories shared using Windows are automatically mounted by UWIN. These directories can be accessed in the same way as any other hard disk on the machine is accessed.
What Shells are available?
UWIN Version 4.0 has ksh, tcsh and tclsh. ksh is the latest release of the KornShell(Ksh93). This shell is also linked to the /bin/sh.
Can I access UWIN from a UNIX workstation?
UWIN for Windows NT comes with a telnet daemon that allows you to telnet into a workstation or server. While all the UWIN commands run over telnet, some Windows commands only produce output to the console.
Are the /etc/passwd and /etc/group file available?
On Windows NT/2000/XP, the /etc/passwd and /etc/group files are generated by the UMS service on startup based on the Windows registry. By default, only local accounts are added.
Does UWIN support crontab entries?
UWIN supports crontab.
Does UWIN have a ps command?
Yes, but the ps command does not provide complete information for native commands.
Can I kill a WIN32 application using kill command?
Along with the UWIN applications, the kill command can terminate a Win32 process as well. When a UWIN process is killed from the Win32 environment, certain important clean up functions may not be performed, resulting in a possible memory leakage.
Can I run a Win32 application from UWIN?
Yes, Win32 applications can be invoked from UWIN. But the application name should be in posix format the arguments must be in the format expected by the program (usually Win32 format).
How can I copy and paste on UWIN console windows?
UWIN support mouse based copy-paste. Selecting the text using the left mouse button can do copying and the same can be pasted by clicking the right button in a two-buttoned mouse or by clicking the middle button in a three-buttoned mouse.
How do I access Windows Clipboard from UWIN?
The Windows clipboard can be accessed through /dev/clipboard. In addition, each time you select a region of text with the mouse from a UWIN application, the selected region is copied to the Clipboard.
How do I change the title of the ksh window?
Title for the ksh window, or any console window, can be changed using the shell function command /usr/fun/title.
How can I control the properties of the UWIN Console?
It is possible to resize the terminal, change the colors and scroll back through the previously displayed material. The properties of the terminal window can be controlled both through the stty command and by adjusting the Windows properties of the console window.
How do I enable scrolling on a UWIN console window?
Set the Screen Buffer Size to a larger value than the Window Size using the control panel.
How do I view man pages on UWIN?
Man pages can be viewed in three ways. For most commands, running command --man will generate that man page. The command man command brings up the man page using groff. This requires the groff package. The html version of man pages can be viewed using man -b command
How can I convert a file in MS-DOS text format to UNIX format?.
A carriage-return/line-feed marks the end-of-line in a text file in MS-DOS text format. UNIX systems use the just the line-feed (newline) character. Most native utilities will accept either format but some require carriage-return/line-feed. Many UNIX utilities will fail if carriage-return/line-feed is used. The UWIN cat command has options -t and -T to convert to and from MS-DOS format. In addition, the UWIN provides the nocrnl utility to convert carriage-return/line-feeds to line-feeds in text files in place.
How do I run a command like dir which is built into the MS-DOS shell?
The Windows NT command processor CMD.EXE can be run from ksh, so CMD.EXE built-in commands can also be run. Assuming that PATH has been set up to include the Windows NT system directory, UWIN environment could be set to give the dir command for directory listings. For example setting the alias, alias dir='CMD.EXE /c "dir /on"', will allow the native dir command to be used in ksh.
How can I set the home directory for an user?
Home directory for an user should be set through NT user manager. Absolute path should be given for the User Profile Path field of the Users profile.
How are pid's assigned to UWIN processes on NT|2000|XP?
The pid for an UWIN process will will be contructed from the Windows pid unless the process has been created by exec. The value is obtained by multiplying by 32 and then adding a number from 0-31.
How are pid's assigned to UWIN processes on 9X|ME?
On Windows 9X, the pid is a huge value and hence becomes negative when converted to pid_t type. UWIN has a way of mapping the actual id with the one that is returned by getpid() function.
How are user ids and group ids assigned in UWIN?
UWIN maintains a table of subject identifier prefixes, and constructs the user id and group id by a combination of the index in this table and the last component of the subject identifier. The number of subject identifier prefixes that are likely to be encountered on a given machine is much smaller than the number of accounts so that this table is easier to maintain. The subject identifier prefix for the local system is 0 so that local accounts have small ids. The local adminstrator id is 0 and the local system account is mapped to group 1.


development

Which language has been used for developing UWIN?
UWIN is written almost entirely in C or ksh. The control panel Applet was written by Wipro in C++. UWIN was compiled with the Microsoft Visual C/C++ compiler.
What compiler comes with UWIN?
The UWIN development kit provides a cc command that is a wrapper for an underlying compiler which is not provided by UWIN. The cc command can work with several different compilers including free and commercial versions of Microsoft Visual C/C++, MingW (GNU), Digital Mars, and Borland. The compiler uses UNIX conventions and generates .o and .a files. The cc and ld can also be used to generate DLLs. With the -V option of cc, you can see the compiler commands that are invoked.
Is gcc available for building UWIN executables?
The GNU compiler set, gcc, g++, g77.exe, gdb is available for UWIN as part of MingW.
Can I compile and run C++ applications for UWIN?
Yes. UWIN provides the CC compiler that takes the same options as the compiler on any UNIX platform. The compiler is a wrapper over the underlying native C compiler.
Can I develop native applications with UWIN development kit?
Yes, you can use ncc and nld to build native executables and dlls that do not depend on the UWIN run time facilities or headers.
How do I pass non-standard options to the underlying compiler?
To pass options directly to the underlying compiler, linker, or preprocessor, use the -Y option of cc. The -Y option takes an option argument of the form <letter>,<option> where <letter> is c,l, or p and option is the option to be passed down. For example, -Yl,-Z20 will pass the option -Z20 to the underlying linker.
What C preprocessor does UWIN use?
By default, UWIN uses the AST C/C++ preprocessor. The reason for this is that native C preprocessors do not know how to resolve UWIN symlinks and UNIX source code frequently contains symlinks. The AST preprocessor should be able to emulate all the known preprocessors. To use the native preprocessor, set the environment variable nativepp=-1.
Which system calls are supported?
Most of the X/Open Release 4 APIs are supported.
Are there any UWIN specific APIs?
Yes, UWIN provides some functions which help the user to use native WIN32 calls from UWIN applications. The <uwin.h> header provides an interface to these functions.
Can I mix UWIN with native Win32 API's?
Yes, you can mix calls. However, in some cases blocking WIN32 calls will not be interruptable by UNIX signals.
Does UWIN support sockets?
UWIN provides a UNIX interface to WINSOCK2 and returns file descriptors instead of Windows handles.
Can I run curses programs with UWIN?
Yes. UWIN supports vt100 emulation and provides virtually complete termios support. The curses library is included in UWIN 4.0.
Is tcl/tk available for UWIN?
UWIN 4.0supports tcl 7.6 but it should be possible to compile newer versions.
How can I make my application obey the older BSD signal semantics?
Compile the applications with the -D_BSDCOMPAT flag to obey BSD Unix signal semantics.
How can I build dynamically linked libraries for UWIN Applications?
Using the ld command. For detailed procedure on building Dlls refer documentation in /usr/doc.
What debugger comes with UWIN?
UWIN does not provide a debugger. You can use the native debugger for debugging by invoking msvc or msdev. Applications compiled on UWIN using the cc compiler can be debugged using the Microsoft Visual C++ IDE. However, when the GNU gcc compiler is used, the debugger that comes along with it must be used.
How can I trace an application using UWIN?
All UWIN applications can be traced using the command /bin/trace. It gives information about the system calls made the application. The output can also be redirected to a file. For more information on how to use trace command see the man page.
How do I trace the UWIN daemons?
The utility /etc/traceit can be used to enable system call tracing for a daemon. See the man page for /etc/traceit for more details.
Why is the setuid call failing on UWIN?
There can be two reasons why a setuid call can fail in UWIN. Either the UMS service is not installed/not running or the UCS client is not installed for that particular user.


X11

Is X11 supported?
The X11R6 libraries and fonts have been built for UWIN release 4.0 as part of the X11 package. The X11R6 libraries and fonts have been built with UWIN and are available as part of the X11 development package.
What version of X11 is provided?
The current release uses X11R6.5.
Does UWIN contain an X11-server?
The X11 base package contains an X11-server but the X11-server is not installed to start automatically.
How do I start the X11 server?
The script xrun, will start an X11 server in multi-window mode. In multi-window mode, each window is managed by the native Windows system.
How do I start an xterm using UWIN?
First and foremost ensure that X Server is running on the machine. Then export the DISPLAY variable to the machine where you want the display, typically locahost:0.0. The run xterm& to run it in the background.
show all answers hide all answers


August 17, 2012