In what ways was the Windows NT family of systems more advanced in design than the UNIX family of systems?



Former Google and current Microsoft software engineer Giulio Merino has put together a comparison between

the Windows NT family , which forms the underlying architecture of modern Windows 11, and UNIX- based systems such as FreeBSD and Linux.

Windows NT vs. Unix: A design comparison - by Julio Merino
https://blogsystem5.substack.com/p/windows-nt-vs-unix-design



・Development history
Microsoft released MS-DOS, a DOS-based operating system, in August 1981, and Windows 1.0 in November 1985. They then co-developed OS/2 with IBM as a successor to DOS, but the project ran into difficulties, so Microsoft started developing its own 'Windows NT-based operating system' in 1989, which was released as Windows NT 3.1 in July 1993.



The history of UNIX is older than that of Windows NT, and its development began in 1969, inspired by Multics . The main purpose of UNIX is to provide a platform that is convenient for programmers, and Merino evaluates that UNIX was able to beat Multics by focusing on simplicity. However, portability and multitasking were not included in the original design goals of UNIX, and these features were added later in forks and reinventions.

·kernel
With a few exceptions, UNIX systems are mostly implemented as a monolithic kernel that exposes a set of system calls to access the functionality provided by the OS, and user-space applications interact with the kernel directly through this system call interface.

On the other hand, Windows NT kernels use a hybrid design that combines features of a monolithic kernel and a microkernel . At the heart of this design is a privileged component called the 'executive.'

A distinctive feature of the Windows NT family is that user-space applications do not talk directly to the kernel, but to specific protected subsystems . These subsystems include Win32, POSIX, OS/2, etc., each of which is implemented as a special user-space process. The role of the subsystems is to 'translate' the APIs used by the applications into executive system calls.

One of the main design goals for the Windows NT family was to ensure compatibility with DOS, DOS-based Windows, OS/2, and POSIX applications, which Merino says were driven by the need to support the OS/2 applications that were being developed in collaboration with IBM.



One of the key components of the NT kernel is the Hardware Abstraction Layer (HAL), which provides abstract primitives to access the machine's hardware. This layer allows Windows NT to run on multiple architectures, including i386, Alpha, and PowerPC.

The NT kernel also supports multiprocessing systems and has a preemptive design, which allows kernel threads to be suspended and preempted to allow other kernel threads to run, which plays a key role in enabling high performance systems.

These features mean that the Windows NT kernel was designed to be flexible and extensible from the start, in contrast to the approach taken by many UNIX systems, which added functionality incrementally at a later date.


By Marc Buehler

User space
First, regarding system and application settings, NT introduced a centralized database called the registry, which made the settings uniform and easy to manage, whereas UNIX-based systems use many different configuration files and formats, which can lead to inconsistencies.

Because Microsoft was conscious of the global market, the Windows NT family had built-in support for locales from the beginning. On the other hand, UNIX-based systems added UTF-8 support and multilingual support later. In terms of programming language, NT was implemented using Microsoft's own C language extensions, adding features such as Structured Exception Handling (SEH). On the other hand, such proprietary extensions are not common in UNIX-based systems. Merino argued that the Windows NT family shows that the user space design took a different approach than the UNIX family in terms of uniformity, internationalization, and language extensions.

・Object-oriented
The Windows NT kernel was designed to have a common representation for various elements in the system. UNIX processes are defined by structures, and file systems are implemented using virtual nodes (Vnodes), but the design is not as thoroughgoing object-oriented as Windows NT.

The main advantages of the Windows NT-like object-oriented design are consistency and efficiency across the system. First, it allows for centralized access control. Because all objects are created centrally by the Object Manager, security policies such as permission checks can be defined in a single place and applied consistently across the system. This simplifies security administration and reduces potential vulnerabilities.

Secondly, there is a common identity system: every resource in the system - processes, file handles, pipes, etc. - is represented in a single object tree. This simplifies resource management by providing a unified namespace for all resources, and also allows operations across different types of objects to be performed in a consistent manner.

Furthermore, there is a unified event handling system: all object types have a signaled state, allowing user space programs to wait for and handle different kinds of events, such as a process exit or the completion of an I/O operation, in the same way, facilitating event-driven programming and making efficient use of system resources.

Object-oriented design ensures that complex system resources are managed in a consistent way, providing developers with interfaces that are easier to understand and use, and improving system extensibility, as new types of resources and services can be easily integrated into the existing framework as they are added to the system.

But this object-oriented design also had its challenges: objects are specific to Windows NT and therefore difficult to generalize to all APIs that Windows NT was intended to support. For example, the POSIX subsystem must perform logical conversions between NT objects and POSIX entities, whereas the Win32 subsystem simply passes objects to clients without any intermediaries.

·process
In UNIX systems, processes are represented as a tree structure, where each process has a parent and can have zero or more child processes, whereas in Windows NT systems, there is no such relationship between processes, and processes are independent after their creation, although they can 'inherit' any type of object from their creator.

Windows NT systems have supported threads since their inception because it was recognized as essential for high performance computing on SMP machines. In contrast, many UNIX systems added threads later and had to adapt to their existing designs.

Windows NT does not have UNIX-like signals , but instead has alerts. These exist in both kernel and user mode, and the POSIX subsystem emulates signals using kernel-mode alerts. NT also introduced the concept of pico-processes, which allow for processes with minimal Windows constructs, and are used in WSL 1 to implement Linux-compatible processes.

Virtual memory
Both Windows NT and UNIX variants use a memory management unit (MMU) and paging to provide protection between processes and a virtual address space larger than the physical memory.

One notable thing about NT is that the kernel itself could be paged out to disk. Of course the whole kernel couldn't be paged out, because that would create problems for filesystem driver code that would be needed to resolve kernel page faults, and that code itself might have been paged out, but large parts of the kernel could be paged out, which saved memory at the time.

Furthermore, from the beginning, Windows NT systems used a ' unified memory architecture ' in which the memory cache for the file system and virtual memory were combined, in contrast to older UNIX systems, which had separate memory caches for the file system and virtual memory.

There are also differences between Windows NT and UNIX-like systems regarding the management and representation of shared memory. In Windows NT-like systems, shared memory sections are objects, subject to the same access validation checks as other objects, and can be addressed in the same way as other objects. In UNIX-like systems, however, shared memory is a later addition, with a separate namespace and a different API from other entities, and the usual permissions do not apply to it.

・I/O subsystem
The Windows NT family was designed from the beginning to support multiple file systems, in contrast to the UNIX family which started with a single file system and later introduced the Virtual File System (VFS) abstraction to achieve multi-file system support. In the Windows NT family, file systems are represented as objects in an object tree, where each object is responsible for parsing the rest of the path.

NTFS, the Windows NT family of file systems, was very advanced for its time, supporting 64-bit addressing, a journaling file system , Unicode file names, and more.

Also, it's worth noting that NT's I/O subsystem was designed from the beginning with features like disk stripping, mirroring, and hot-plugging of devices, which are equivalent to modern-day RAID, Merino said.

'What makes the NT I/O subsystem particularly advanced is that its interfaces are inherently asynchronous,' Reno points out. In contrast, support for asynchronous I/O on many UNIX-like systems was added later, and its performance has not always been excellent.

Additionally, the NT I/O subsystem takes a different approach to implementing named pipes than UNIX-like systems: Whereas in UNIX-like systems named pipes are local constructs, NT allows named pipes to run over a network, allowing applications on different computers to communicate without having to worry about network details.

·network
In the days when the Internet was not as widespread as it is today, DOS and Windows 3.0 only supported limited network functions. On the other hand, UNIX-based systems were the foundation of the Internet, and all basic Internet protocols were written and implemented on UNIX-based systems. Therefore, Windows NT-based systems supported both Internet protocols and traditional LAN protocols that were used in existing environments.

Most notably, the Windows NT family introduced the concept of network domains . In UNIX systems, network administrators typically synchronized user accounts between machines manually. But NT network domains integrated directory and authentication capabilities, making them easier to set up in an enterprise network.

Also, while UNIX variants have long offered only a simple set of read/write/execute permissions, Windows NT variants have offered advanced access control lists (ACLs) since their inception. Linux and BSD also support ACLs, but they are later additions and are not as consistently implemented as Windows NT variants.

As for network file systems, UNIX used Network File System (NFS) and NT used Server Message Block (SMB). In addition, Windows NT provided the Network Driver Interface Specification (NDIS) to make it easier to support network card drivers. This is in contrast to systems such as Linux, which had a hard time supporting manufacturer-supplied drivers, Merino said.

Conclusion
Merino said that Windows NT was certainly groundbreaking when it was released, since it had many of the system design features that we take for granted today. However, he said that even though Windows NT had solid design principles, its greatness was lost due to the bloated UI, and that it cannot be said to be significantly more advanced than modern UNIX systems such as Linux and FreeBSD.

in Software, Posted by log1i_yk