I've read that the last DOS kernel based Windows was ME. Later versions use the NT kernel. Why did Microsoft rewrite the whole kernel? Why was the DOS kernel discarded?
The DOS kernel is made to provide basic filesystem and memory management for single-tasking 16-bit systems. This still was good enough up to Windows 3.1, as Windows consolidated all the Windows tasks into one virtual task running on DOS. If we exclude the 386 Enhanced mode, DOS tasks in windows could only be run one at a time and only in full screen mode, so again only a single task was running. Making a clean switch between DOS tasks and the Windows system is difficult without knowing a lot of DOS internals (which Microsoft obviously knew, at least for MS-DOS), but works well enough. The cooperative multitasking philosophy of Windows 3.1 made it easy to make sure the multiple Windows tasks could easily interact with DOS like only one task were running.
The operating philosophy changed with the introduction of the Win32 API, which provided preemptive multitasking and 32-bit support, both of which are unfit for use with the DOS kernel. Windows 95 included "compatibility mode" passthrough drivers that sent requests to DOS and/or the BIOS when there was no 32-bit Windows 95 driver for a hardware component, but using this capability was seen as a last resort and known to provide significant performance issues.
On the other hand, the NT kernel was designed with multitasking, memory security and access control in mind, so it proved to be a good fit for a modern 32-bit operating system. The architecture of NT is designed flexible enough, that porting it to 64 bits (e.g. an experimental 64-bit Alpha version, an official Itanium version and (it used to say centuries here...) some years later to x86-64 aka x64 aka AMD64) was easy enough without breaking the established programming model.
DOS is not capable to deliver what any Windows after 2.0 needs. It can only handle real mode and 1 MiB of Memory. All Windows after 2.0/286 were essentially replacing/virtualizing large parts of DOS. By 9x DOS wasn't much more than a boot loader.
Maybe some points to consider
- DOS was never a "kernel" of any OS.
- DOS is a very basic I/O abstraction layer, not much more.
- More important, it was only single tasking.
- It is a hard bottle neck to anyone trying to multitask above/around.
- Windows started out as little more than a GUI library.
- If at all, it's Windows that brought something like an OS-Kernel, using DOS as I/O layer(hence KERNEL.DLL).
As well as the timeline
- DOS development was supposed to end with DOS 3.2
- MS focused after 3.2 on what now is often called 'European DOS 4.0' a DOS compatible multitasking system
- DOS 3.3 was created solely by IBM, mostly as a maintenance release to support their new PS/2 line
- Only aber about a year of nagging customers, who wanted to have 3.3 to be able to compete with IBM, MS rolled out a generic 3.3 (3.31 for example for Compaq)
- 'European' DOS 4.0 was cancelled as MS and IBM agreed to build a new OS together, OS/2
- IBM made DOS 4.0 to support larger disk sizes and new graphics cards.
- At the same time MS and IBM ship OS/2 1.0, destined to replace DOS for all Text mode application on 286 and up.
- OS/2 1.1 introduced a GUI which looks essentially Windows 2.0
- MS ships Windows 3.0 which is seen as a bridg leading customers over to OS/2
- Windows 3.0 (and even more 3.11) becomes an instant success as it does run acceptable on low end machines while keeping high DOS compatibility
- MS decides to put their force behind the success of Windows 3.x
- MS creates Windows NT in part based on their experience with OS/2 but with a goal of high Windows compatibility.
- At first NT is supposed to be a network and professional OS
- Windows 3.x takes the role as client and consumer OS
- While Windows 3.x does work rather fine for simple application the kludged architecture was not really scaling to growing needs.
- MS tries a lot of work around with Win32, new drivers and much more. Not really successful
Long story short: While Windows on top of DOS was a nice idea in 1990, and a great low end solution during the decade, especially due high compatibility with older software, it was simply no longer capable to deliver at the end of the decade.
Microsoft didn’t “rewrite” the DOS kernel, they replaced the DOS ecosystem. Windows wasn’t even their first attempt to do so!
The short answer
DOS was never a complete operating system, so it didn’t provide a comprehensive platform which could be migrated or extended as a platform, taking its hosted software and its users with it; and a lot of its success (and DOS-based Windows’ success) was accidental, and therefore didn’t provide the development lead-time necessary for planned transitions.
It ended up being replaced by Windows 2000 and XP, which descended from Windows NT. NT wasn’t designed to replace DOS; it wasn’t even designed for PCs initially! It was designed to be the best operating system that its creator, Dave Cutler, could come up with. Of Microsoft’s many attempts to produce a new operating system after DOS, it ended up being the successful one, and the various ecosystems around it either converged (Windows 3.x, Windows 9x, and NT) or saw their importance diminish so that end-users wouldn’t balk at not-quite-perfect support (DOS). G. Pascal Zachary’s Show-Stopper! covers the creation of NT in detail.
DOS services and limitations
Microsoft bought DOS to provide an operating system for IBM’s forthcoming PC (see When was QDOS changed to MS-DOS?). It was a simple operating system closely tied to the 8086/8088 CPU, and it wasn’t designed to provide a base for an evolving platform. Its APIs cover only a small amount of what many programs need, so it never provided a full operating system platform: DOS services’ include file system I/O, disk I/O, stream-based I/O, date/time, process management, and memory management; there is no support for graphics, full-screen text (even with
ANSI.SYS), scheduling, any moderately sophisticated handling of parallel or serial ports, etc. Part of this is because MS-DOS was a multi-platform system, and was available for a variety of non-PC-compatible systems; but the result was that many programs ended up tied to other services on the system (provided by the BIOS), or even directly to the hardware (it was common to write directly to video buffers). DOS provides no protection between processes, or between processes and the hardware; it can’t even protect itself! In fact it provides APIs to change interrupt vectors, so it was seemingly expected for programs to be able to make deep changes to the running system.
An operating system is only as relevant as the programs that run on top of it. By the time it was obvious DOS was a success, and it might make sense to improve it to increase its future relevance, it was too late: successful programs used DOS services but also had to work around the lack of features. In particular, direct hardware access and the way memory was handled meant that it wasn’t possible to change the DOS kernel so that it could benefit from the 286’s additional capabilities (in part because the 286 was designed before lessons from the 8086 could be learned), and it would have been difficult to cater for all types of DOS programs even with the 386’s additional capabilities (V86 mode for example). Even as far as DOS’ APIs are concerned, it wouldn’t have been possible to change them to add general-purpose support for multi-tasking or multiple users. (Some did try; for example, DR DOS included multi-tasking and multi-user support, but it didn’t work with everything and was easily broken.)
So DOS ended up stuck in its ways, impossible to revamp to provide a new platform — or at least, not in an economically interesting way, compared to either creating an entirely new operating system or just layering new features on top of it. And once a successful layer emerged (Windows), its own APIs were sufficiently isolated from DOS’ that it made more sense to provide them on another system (NT) than to rewrite the DOS kernel.
Microsoft’s other early operating system: Xenix
At the time DOS was released, Microsoft already had another operating system, also bought in — Xenix, a licensed version of Unix. That was seen as the “grown up” operating system, sold on a number of platforms, including (eventually) PCs; and as DOS grew up (with version 2.0), a number of concepts were ported to it from Xenix (see What's the relationship betweeen MS-DOS and XENIX?).
History tells us that Xenix never replaced DOS, and by the end of 80s Microsoft had abandoned it (see What were the differences between Xenix and Unix?). By this time, Microsoft had embarked on two new operating systems: MS-DOS 4.0 and OS/2.
There was one attempt to extended MS-DOS to produce a more capable operating system. MS-DOS 4.0 (“European MS-DOS”) was a multi-tasking version of DOS, albeit not really a general-purpose one. It introduced background tasks which could continue running in parallel with a foreground task, and was marketed somewhere in between “plain” MS-DOS (for run-of-the-mill PCs) and Xenix (for workstations and servers). IBM weren’t interested in this, and it failed to gain traction.
OS/2 was a joint effort with IBM, and supposed to be the operating system which would take the PC (or rather, from IBM’s perspective, the PS/2) into the future. It was designed as a fully multi-tasking system from the beginning. For backwards compatibility purposes it could run DOS programs, but because it targeted the Intel 80286 CPU, it could only provide limited support for them; in particular, it could only run one DOS program at a time. Most end-users in the 80s wanted to use PCs to run DOS programs, so OS/2 didn’t have a significant advantage; it was also marketed as not for PCs, and required well-equipped PCs. (This changed with OS/2 2.0 and even more so OS/2 Warp, but by then it was too late.)
Windows on DOS
In parallel with all this, Microsoft had been developing Windows, its DOS-based graphical user interface. It didn’t meet with much success initially, but it did lay all the groundwork for a complete operating system replacement in the future: it provided a complete API and rules for memory management etc., allowing programs to be developed in isolation from the hardware. Its initial versions were tied to the 8086 and 80286 platforms, but a few extremely talented engineers figured out a way to rework it so that it could take advantage of the 80386’s new features without rewriting the whole ecosystem (see What key factor led to the sudden commercial success of MS Windows with v3.0?).
The sudden success of Windows 3.0 allowed Microsoft to give up on OS/2, and they pulled out of their partnership with IBM. A couple of years before this, Microsoft had hired David Cutler to develop a new operating system (Microsoft’s fourth major operating system), to ensure Microsoft would stay relevant in the face of the emerging RISC platforms and the perceived threat of Unix. (See How much better was DEC Alpha than contemporaneous x86? and this issue of PC Magazine to get a feel for the landscape in the late 80s and early 90s.)
The success of Windows 3.x also meant that, at least for software other than games, DOS became less important as an application platform: users switched to Windows applications.
This fourth operating system is what became Windows NT: a brand-new, multi-platform, multi-ecosystem environment designed for longevity. It was designed to be portable and to be able to host a variety of APIs. It was marketed for servers and workstations, and was released in 1993, in between Windows 3.1 and 3.11 for the lower end of the market.
DOS becomes irrelevant
Thus in 1993, Microsoft was developing and selling two operating environments in parallel: MS-DOS with Windows 3.x, and Windows NT. Both of these had the same user interface, and for Windows applications, similar APIs (so developers used to Windows 3.x could switch to Windows NT without too much hassle); and NT on x86 could run most existing Windows 3.x software. Windows 3.x in enhanced (386) mode was arguably an operating environment in its own right: when it was running, it effectively was in control of the system, and DOS was just one of the things it took care of. By Windows 3.11 for Workgroups, the core of Windows was largely a 32-bit operating system (although applications were mostly still 16-bit). That trend continued with Windows 95, 98 and Me, which added support for much of NT’s Win32 API (and thus 32-bit applications). In parallel, Windows NT was also improved to make it more relevant for “regular” users, in particular with better support for games (see How exactly did Windows become the OS of the home PC?), helped also by the increasing hardware capabilities in commodity PCs.
Ultimately, Windows NT (2000 and XP) became viable as operating systems for PCs across the board, and since by that time most PC users had switched to 32-bit Windows (Win32) applications, which could run on Windows 95/98/Me and NT, the switch was painless for most. A few DOS applications and games were left behind (e.g. games using 16- or 32-bit extenders which assumed they were in charge of the whole system), but by this time that was acceptable.
So the DOS kernel wasn’t really replaced, it just became irrelevant…
Older versions of Windows generally relied upon the notion that if only one program is trying to use a piece of hardware at a time, and that program knows how to use it, it doesn't really matter if Windows itself understands it. Many complaints about older versions of Windows being unstable were an offshoot of this. If a program sets up an interrupt handler to place data received via serial port into memory starting at some address, and Windows knows nothing about how the interrupt handler is planning to use that memory, it will have no way of knowing that it must disable the interrupt handler if the program that was using it gets terminated.
If one had a piece of hardware for which one had a DOS device driver, but no Windows driver, being able to use the DOS mode driver and hope that everything plays nice with it might be better than being unable to use the hardware at all, but there was and still is no way to have a really stable multitasking OS which doesn't understand device hardware that will be accessed by transiently-loaded applications.
In many cases, if one has a piece of specialized hardware for which one has a DOS driver, but for which no Windows driver will ever exist, the best way to continue using it will be to maintain a DOS machine for that purpose. While some people may find the idea of continuing to use DOS machines weird, if one has a $50,000 piece of industrial equipment which continues to do what it needs to do, maintaining a DOS machine to run it, along with few spares, may be much more practical than replacing the equipment or developing control software for a more modern platform, especially if one needs to avoid down time.
While there was a time when computers were sufficiently expensive that being able to use device-specific DOS software on a machine that was also used to run Windows, that time is now long past. Today, it makes far more sense to have the tasks which need to be done using DOS software on a machine running DOS, and have other tasks done on a newer machine running Windows, than to try to have one machine perform both kinds of task poorly.
Many, many reasons. But apart from anything else, DOS (and some of DOS-based Windows) was written in x86 assembler at a time when RISC machines were the speed demons.
Microsoft had a Portable Systems Group that were working on the "New Technology OS/2" platform; one of Microsoft's goals was to NOT tie it to specific hardware; thus early platforms were a homebrew machine based on the i860, and then MIPS machines.
After Microsoft and IBM's little spat, NT OS/2 became Windows NT (which wasn't technically hard, because the NT kernel, after Cutler's arrival, was designed to run multiple 'personality' subsystems, including OS/2 and Windows, so they simply placed more emphasis on the latter).
Thank you for the many answers. It made me think about the topic and I want to write an own answer because I think I understood now.
To understand the topic it is important to know what CPUs looked like when DOS was around and what they look today.
When DOS was around CPUs did not have protected mode. There was one single thread and it was allowed to do everything. DOS was run before any program was run and it also provides drivers and an API. Today there are these little Arduino development boards. I think the firmware on them is similar to DOS (about the points I mentioned).
Later CPUs had protected mode. Programs now have limited privileges and communicate with the kernel using system calls. From now on DOS is deprecated and all software now has to use the Win32 API.
The changes where simply too big. Maybe it would have been possible to keep the DOS API but because of the big changes it was easier to create a new API.
The change was necessary because CPUs got protected mode. That's the point.
By 1996, Microsoft had two desktop operating systems for the same basic kind of x86 hardware:
- Windows 9x, which used DOS as a loader, was a mixture of 16- and 32-bit code and had lots of non-portable assembler code.
- Windows NT Workstation, which was entirely 32-bit, and portable onto other architectures (it also supported Alpha, MIPS and PowerPC, and it was not yet clear that Intel/AMD would win the desktop processor battle).
Microsoft produced Office, and most of their other software, in a single version that ran on both Win9x and IntelNT, so they had to keep those operating systems closely compatible. This involved a lot of duplicated work, and thus extra costs.
The advantages of Win9x were that it didn't need such powerful hardware, and it would let games access the hardware directly. Making the latter work without destabilising the OS was hard work, especially since Windows didn't get regular updates back then.
The correct thing to do from the perspective of Microsoft senior management was to make Windows NT capable of running games, so that it wasn't necessary to maintain two separate operating systems and keep them compatible. Doing this by allowing games to access hardware would have ruined the stability and reliability of NT, so they didn't do that.
Instead, Microsoft created DirectX, originally as a set of separate APIs called DirectDraw, Direct3D, DirectSound, and so on. These allowed games to be written in ways that allowed good performance without operating the hardware directly, so they could be compatible with NT.
The problem of NT's greater hardware needs was solved by waiting a few years, for powerful hardware to become cheaper, during which the gaming APIs could mature. This plan was completed in August 2001 with the release of Windows XP.
DOS was abandoned as a side-effect of abandoning Windows 9x, which was abandoned because maintaining two operating systems was expensive.
i don't know if this is what you mean but here is my answer. MS-DOS stopped being used in windows xp. the last version to use it was windows ME and 2000. DOS was made to run 1 thing at a time so it kind of removed the whole "multitasking" thats microsoft wanted. plus, ms dos is over 40 years old now and is very outdated.