UWIN UNIX for Windows

UWIN UNIX for Windows

The following paper was originally published in the Proceedings of the USENIX Windows NT Workshop Seattle, Washington, August 1997 UWIN—UNIX for Windows David G. Korn AT&T Laboratories Florham Park, N.J. For more information about USENIX Association contact: 1. Phone: 510 528-8649 2. FAX: 510 548-5738 3. Email: [email protected] 4. WWW URL: http://www.usenix.org UWIN ± UNIX* for Windows David G. Korn ([email protected]) AT&T Laboratories Florham Park, N. J. 07932 Abstract One way to lower this cost is to use a middleware layer that hides the differences among the operating systems. The problem with this approach is that it This paper describes an effort of trying to build a forces one to program to a non-standard, and often UNIX interface layer on top of the Windows NT[1] proprietary, interface. In addition, it often limits one and Windows 95[2] operating system. The goal was to the least common denominator of features of the to build an open environment rich enough to be both different operating systems. a good development environment and a suitable execution environment. An alternative is to build a middleware layer based on existing standards. This has been the approach The result of this effort is a set of libraries, headers, followed by IBM with the introduction of and utilities that we collectively refer to as UWIN. OpenEdition[6] for the MVS operating system, URL UWIN contains nearly all the X/Open Release 4[3] http://www.s390.ibm.com/products/oe. headers, interfaces, and commands. An earlier paper OpenEdition is X/Open compliant so that a large on porting to Windows NT[4], describes alternative collection of existing software can be transported at porting strategies and presents some performance little cost. results for UWIN. In this paper we discuss some of the design decisions behind UWIN and some of the Windows NT is an operating system developed by results so far as well as some of the remaining Microsoft to ®ll the needs of the high-end market. It challenges. is a layered architecture, designed from the ground up, built around a microkernel that is similar to 1. INTRODUCTION Mach.[7] One or more subsystems can reside on top of the microkernel which gives Windows NT the The marketplace has dictated the need for software ability to run different logical operating systems applications to work on a variety of operating system simultaneously. For example, the OS/2 subsystem platforms. Yet, maintaining separate source code allows OS/2 applications to run on Windows NT. versions and development environments creates The most important subsystem that runs on Windows additional expense and requires more programmer NT is the WIN32 subsystem. The WIN32 subsystem training. runs all applications that are written to the WIN32 The Software Engineering Research department at Application Programming Interface (API)[8]. The AT&T Labs writes and distributes several widely API for the WIN32 subsystem is also provided with used development tools and reusable libraries that are Windows 95, although not all of the functions are portable across virtually all UNIX platforms.[5] To implemented. In most instances binaries compiled enhance reuse of these tools and libraries, we wanted for Windows NT that use the WIN32 API will also to make them available on systems running Windows run on Windows 95. NT and/or Windows 95. We did not want to spend The POSIX subsystem allows applications that are the cost needed to support multiple versions of these strictly conforming to the IEEE POSIX 1003.1 libraries, and we wanted to minimize the amount of operating system standard[9] to run on Windows NT. conditionally compiled code. Since the POSIX standard contains most of the __________________ * UNIX is a registered trademark, licensed exclusively through X/Open, Limited. standard UNIX system call interface, many UNIX so that all WIN32 interfaces would be available to utilities are simple to port to any POSIX system. applications. Because most of our tools require only the POSIX Initially, our goal was to provide the IEEE POSIX.1 interface, we thought that it would be suf®cient to interface with a library. This would be suf®cient to port them to the POSIX subsystem of Windows NT. run ksh and about eighty utilities that we had Unfortunately, this is not a viable alternative for written. It soon became obvious that this wasn't most applications. Microsoft has made the POSIX enough for many applications. Most real programs subsystem as useless as possible by making it a use facilities that are not part of this standard such as closed system. There is no way to access sockets and/or IPC. functionality outside of the 1990 POSIX 1003.1 standard from within the POSIX subsystem, either at We needed to provide a character based terminal the library level or at the command level. Thus, it is interface so that curses based applications such as vi impossible to invoke the Microsoft C compiler from could run. After the initial set of utilities was within the POSIX subsystem. Softway System, Inc., running, we wanted to get several socket based tools URL http://www.softway.com, has an working. Several projects at AT&T that became agreement with Microsoft to enhance the POSIX interested in using our libraries, required the System subsystem. Softway claims that they will open up V IPC facilities. The S graphics system[10] and the POSIX subsystem so that it can access WIN32 ksh±93[11] required runtime dynamic linking. As applications. They have built the OpenNT product the project progressed, the need for privileged users, with this enhanced subsystem. However, it is still such as root on UNIX systems, surfaced. We not possible to mix UNIX API calls and WIN32 decided that it was important to have setuid and calls in a single application. A ®nal drawback to setgid capabilities. It soon became clear that we this approach is that the POSIX subsystem is not needed full UNIX functionality and we set our goal available for Windows 95. on X/Open Release 4 conformance. We investigated alternative strategies that would We needed to have a complete set of UNIX allow us to run programs on both UNIX and development tools since we didn't want to get into Windows NT based systems. After looking at all the the business of rewriting make®les or changing build alternatives, we decided to write our own library that scripts. Most code written at AT&T, including our would make porting to Windows NT and Windows own, uses nmake[12], (no relation to the Microsoft 95 easy. We spent three months putting together the nmake), but we also wanted to be able to support basic framework and getting some tools working. other make variants. We didn't want to do manual Realizing that the task was larger than a one person con®guration on tools that have automatic project, we contracted a small development team of 2 con®guration scripts. or 3 to do portions of the library, packaging, and A second measure of completeness is the degree to documentation. This paper discusses the which all the system services can be accessed implementation of our POSIX library and current through the UNIX API. Our goal was to be able to status. Version 1.2 of UWIN has been freely perform as many of the Windows NT tasks as available in binary form for non-commercial use on possible via traditional UNIX commands. For the internet from the web site example, it should be possible to reboot the system http://www.research.att.com/sw/tools/uwin. when logged in through a telnet session by calling Version 1.3, described here, should be available from the UNIX shutdown program. We should also be this site by the time of this conference. able to access the Windows registry database with grep 2. GOALS standard UNIX utilities such as . One important goal that we had from the beginning We wanted our software to work with Windows 3.1, was to not require WIN32 speci®c changes to the Windows 95, and Windows NT. A summer student source to get it to compile and execute. The reason wrote a POSIX library for Windows 3.1 and we were for this is that we wanted to be able to compile and able to port a number of our tools. However, the execute UNIX programs without having to limited capabilities of Windows 3.1 made it a less understand their semantics. In addition we wanted to than desirable platform. We instead focused our limit the number of new interfaces functions and goals on Windows NT and Windows 95. We environments variables that we had to add to use our decided to use only the WIN32 API for our library library. It is dif®cult to manage more than one or so that the library would work on Windows 95 and two environment variables when installing a new pathname c:\home\dgk names the ®le in package. directory \home\dgk on drive c:. Many UNIX utilities expect only / separated names, and expect a Another goal that we had was to provide a robust set leading / for absolute pathnames. They also expect of utilities with minimal overhead. If utilities written multiple /'s to be treated as a single separator. to the X/Open API were noticeably slower than the same utilities written to the native WIN32 API, then Even though NTFS supports case sensitivity for ®le they were likely to be rewritten making our library names, the WIN32 API has no support for case unnecessary in the long run.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    14 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us