12

In this question:

Why was the DOS kernel discarded?

I was told that DOS is not a kernel. It runs on CPUs that don't even have kernel mode. So how can it be a kernel? So I think this is right.

Now if DOS is not a kernel and the NT kernel comes later (on 2000/XP/Vista...):

What is the Windows 95/98/ME kernel called?

zomega
  • 5,362
  • 4
  • 25
  • 52
  • 1
    At some point, the API targeted by the program became the distinguishing name. DOS API -> Windows API -> Win32 API. – Brian H Nov 29 '22 at 16:21
  • 8
    IDK, but I feel as if the idea that an OS kernel should have its own name, distinct from the name of the rest of the OS, is a fairly new idea. The oldest example I can think of is Linux, which got to have its own name by virtue of the fact that Linux is nothing but a kernel. – Solomon Slow Nov 29 '22 at 16:55
  • 12
    The Mach kernel was created in 1985… – user3840170 Nov 29 '22 at 17:09
  • 10
    It is a leap to assume that an 'OS kernel' must run in some CPU 'kernel' mode, or that the thing running in kernel mode is called the 'kernel'. All 'kernel' means is that it's the thing at the centre. FWIW, RSX-11M didn't have a 'kernel' at all - it had an 'executive' (which ran in CPU kernel mode, if running on a PDP-11 model that had memory management. – dave Nov 29 '22 at 18:23
  • 3
  • @another-dave If you say everything in the center can be called a kernel then for you MSDOS also has a kernel. But for me it hasn't. For me a kernel has to run in a different mode than the user programs. If this is not the case then there are also no kernel calls. – zomega Nov 29 '22 at 19:42
  • 13
    Claims that DOS is ‘not a kernel’ or ‘not really an operating system’ are just snobbery. DOS does what kernels do: provides file system and device abstractions (PRN, AUX, the RTC), manages memory and processes. The only major thing it lacks is concurrency, and even that can be worked around with TSRs and multitaskers like DESQview… and later, in fact, Windows. – user3840170 Nov 29 '22 at 21:38
  • 6
    @user3840170 I would think this is to be seen in context. For a DOS environment, MSDOS-SYS is the kernel, but in 16 bit Windows DOS becomes an access layer used by the Windows kernel (KERNEL/KRNL286/KRNL386). Likewise later KERNEL32 for 32 bit Windows. – Raffzahn Nov 29 '22 at 23:34
  • This is much about what lies in a name - typically a kernel is privileged code that prohibits users and processes to step on each others toes (only one print goes to the printer at the time). MS-DOS does not have that. So no kernel. Does it have something that provides the files+directories abstraction of the harddisks and floppies? Yes. – Thorbjørn Ravn Andersen Nov 30 '22 at 17:18
  • 1
    @ThorbjørnRavnAndersen that’s a modern understanding of the term however, and unprivileged operating system cores have been called kernels in the past. See for example the famously typoed Commodore KERNAL... – Stephen Kitt Nov 30 '22 at 17:27
  • 1
    @StephenKitt It just underlines that definitions are important in order to be certain we are talking about the same thing. To me this questions is a bit like saying "Cars are modern versions of horse carts. What was the name of the transmission back then?" – Thorbjørn Ravn Andersen Nov 30 '22 at 17:38
  • @ThorbjørnRavnAndersen I agree with you. No kernel mode means no kernal. StephenKitt: I looked into the Commodore Kernal. For me it's more like a software library. But we are spinning in circles because people here simply use two different definitions of what a kernel is. – zomega Nov 30 '22 at 17:42
  • 2
    @somega that’s why I said that asking whether DOS is a kernel would lead to opinion-based answers ;-). Your own definition is itself circular: early kernels were developed on systems with no privilege separation; after it became common, privileged mode ended up being called kernel mode because it is used to run kernels. So saying that kernels are whatever runs in kernel mode isn’t useful since kernel mode is named that way because it is used to run kernels... – Stephen Kitt Nov 30 '22 at 18:03
  • @StephenKitt Were parts of the OS called kernel before CPUs supported kernel mode? I know you already named Commodore. But is this the only example or were for example parts of MSDOS also called kernal? When did the word come up? – zomega Nov 30 '22 at 18:09
  • 2
    @somega see for example https://doi.org/10.1145/800001.811675 (1967) where it is used to refer to the core of a supervisor, responsible for handling interrupts and scheduling processes. https://doi.org/10.1145/800009.808043 (1973, with an author you should recognise) is an early paper describing the articulation between hardware privilege levels and software, referring specifically to the PDP-11/45’s “kernel mode” (1972). Before that, “kernel” was often used to refer to the core of a subroutine, or a core library function. – Stephen Kitt Nov 30 '22 at 19:19
  • 3
    @somega if you’re curious about how all this stuff came to be, I recommend Computer Structures: Principles and Examples which provides a comprehensive overview of the evolution of computer architecture and operating systems in the 60s and early 70s. – Stephen Kitt Nov 30 '22 at 19:35
  • @StephenKitt I have looked into both documents. It seems even back then kernels were running in kernel mode. Especially in the second document they are talking about (hardware based) kernel, supervisor and user mode. Now I can be sure that my definition is the right one and it even applies to operating systems from the 1970s. – zomega Nov 30 '22 at 20:15
  • 1
    For that matter, what is "the operating system"? I assume you'd all agree that the Linux kernel is included in "the OS" on a system running it. But do you consider the GNU Core Utilities (including programs like cat, ls, and rm) or the Bash shell to be "part of" (GNU/)Linux? And if so, what about X11? Apache? Interpreters for programming languages like Perl or Python? – dan04 Nov 30 '22 at 20:50
  • Since this is looking like a discussion of "what words mean" -- it's only recently that we've settled on 'the code that manages computer resources' being called a 'kernel'. Prior to that we had monitor, nucleus, director, executive, supervisor, control-program, ... And that's just systems I've used. – dave Dec 03 '22 at 17:48
  • @another-dave That's a good definition. Because on MSDOS system resources are not managed at all. For example a single program can use 100% CPU and 100% RAM. When you have a real kernel you can limit such things. – zomega Dec 03 '22 at 18:19
  • There are perfectly viable cooperative mutitasking kernels around. – dave Dec 03 '22 at 19:24
  • @another-dave Yes but you have to trust the program. On MSDOS the OS is not more powerful than the user programs in any kind. If the user program wants it can do whatever it likes. – zomega Dec 03 '22 at 19:35
  • @zomega if no kernel mode means no kernel then Windows 9x doesn't have a kernel either, because userspace processes can access other processes' data. There are zero protection. Many modern RTOS kernel are also like that, because that'll reduce the context switch overhead. Cooperative multitasking kernels like classic Mac and Windows 3.x also don't need a separate mode – phuclv Dec 04 '22 at 14:51

3 Answers3

31

It is called the kernel; if the context isn’t clear, the “Windows 95 kernel” or whatever version is appropriate. Technical analyses (such as Unauthorized Windows 95) usually distinguish different parts of the operating system kernel, typically the DOS kernel (IO.SYS/MSDOS.SYS or WINBOOT.SYS), the “Win 16” kernel (KRNL386.EXE), the Win32 kernel (KERNEL32), and the Virtual Machine Monitor (which is arguably the “real” operating system in Windows 3.x onwards), but it is all just called the kernel.

Windows’ core services are split up into well-identified components, such as the aforementioned VMM, GDI, USER32, DOSMGR, etc. It’s common for these to be named explicitly in discussions involving them.

Stephen Kitt
  • 121,835
  • 17
  • 505
  • 462
21

Does the kernel of Windows 95/98/ME have a name?

Other than Kernel? No, not a sharp and distinct one, as it's all about what one calls a kernel, so any naming is usually about mutiple components. If one really wants to point to a single most important file, it'll be KRNL386 and WINDOWS32.


I was told that DOS is not a kernel.

Erm, no. The point of the answer wasn't that DOS isn't a kernel, rather that DOS is not the Kernel of Windows, but an access layer used by Windows.

For a DOS environment, MSDOS-SYS is the kernel - or Supervisor as such entity was originally called (*1).

It runs on CPUs that don't even have kernel mode. So how can it be a kernel? So I think this is right.

No. Something being a kernel is not depending on any hardware support (or mode). Otherwise many classic OS, including early Unix, would not have a kernel

In fact, there is much room argueing what a kernel is. Just note the long section about rather divergent architectures in the Wiki entry for Kernel. In it's original definition, as a Supervisor, it's the component that takes and manages all system calls an application issues.

Taking that definition then we get roughly the following assignments for what could be considered the Kernel:

  • For MS-DOS Environment:
    • MSDOS.SYS is providing services via various INT calls
  • For 16 Bit Windows on 8086:
    • KERNEL is the Kernel
  • For 16 Bit Windows on 80286:
    • KRNL286 is the Kernel
  • For 16 Bit Windows on 80386:
    • KRNL386 is the Kernel
  • For 32 Bit Windows
    • KERNEL32 dows the job

Of course, there are more parts to Windows which may or may not count as part of a 'kernel', like USER or GDI (2), so it all depends on the context one is looking at the issue. With 32 Bit Windows the whole part gets even more blurry as the API is not only packeaged in its own system library(s), but what this library is changes from a kernel part to a mere interface library in later versions.

Long story short: It's complex :))


*1 - Or as complete picture in terms as they were first structured:

  • IO.SYS (*3) is the Hardware Abstraction Layer (HAL)
    • Its function is to present physical hardware in machine independed way to the Kernel - in other OS, like Linux, this may be part of the kernel
  • MSDOS.SYS is the Supervisor
    • The part that takes and handles all system calls
  • COMMAND.COM is the Monitor
    • The part that manages jobs consissting of more than a single program run

*2 - KERNEL/KRNL286/KRNL386 presents the OS part of Windows. It covers everything (relevant) that without Windows woudl be offered by DOS - if at all. Windowing is provided by USER, while GDI does the same for all drawing on output devices (including the canvas of a window). KERNEL

*3 - Plus all optional runtime loaded drivers.

Raffzahn
  • 222,541
  • 22
  • 631
  • 918
  • You say a kernel is a supervisor. But how can a kernel be a supervisor without hardware support? Without kernel/protected mode a kernel cannot be a supervisor because it cannot prevent user programs from accessing foreign memory areas or accessing all hardware components without asking. – zomega Nov 30 '22 at 12:12
  • 1
    @somega First of all, Kernel is just another word for Supervisor. Supervisor is the older term. Second, 'preventing' programs from anything isn't a basic requirement for the task of providing services. Memory protection a complete seperate issue - much like virtual addressing or virtual (swaped/paged) memory or many other items people today take as granted within a modern system. – Raffzahn Nov 30 '22 at 12:45
  • Virtual addresses and swap are not necessary to offer memory protection. For me a kernel has to run in kernel mode and offer memory protection + multi tasking. This definition makes it easy to say what a kernel is. As you said yourself your definition makes things complex. That is why I prefer my definition. – zomega Nov 30 '22 at 13:33
  • There's also the situation where you have real-mode DOS and/or Windows with EMM386 loaded - it's EMM386 that controls the memory protection registers and runs DOS/Windows in V86 mode. The version of EMM386 in DRDOS 7 can even multitask DOS / Windows sessions. – john_e Nov 30 '22 at 14:13
  • 1
    @somega Don't twist my words. I said the definition can be complex. I go with a simple one: Kernal is what offers services. No matter what services. Next, note the 'or' between the examples made. The same way virtual addressing (virtual addressing and!= virtual memory != swap) is optional, so is memory protection or multi tasking. These are services a kernel may offer, but they don't define what a kernel is. Making that a base requirement would mean that many OSes have no kernal. Including several UNIXes. Sounds wrong, doesn't it? – Raffzahn Nov 30 '22 at 14:26
  • 1
    @Raffzahn In my opinion it's ok to say that an OS does not have a kernel. If I'd ask you on Windows 98 what the kernel is, what would you say? Obviously everything that runs in kernel mode. Any other answer is absurd. As you can see a kernel is defined by running in kernel mode. That is why it has the name "kernel mode". – zomega Nov 30 '22 at 15:14
  • 3
    @somega "Any other answer is absurd" is a non-argument. I certainly don't find in absurd to imagine a system with a kernel, and most user-space programs running kernel mode, with untrusted programs running in user mode. That someone defined a system mode as kernel mode doesn't mean that everything running in that mode is kernel or that only things running in that mode are kernel. – prosfilaes Nov 30 '22 at 20:42
  • 4
    @somega If you try to play a retroactive word game, tell me what it is with a CPU that does not have a Kernel Mode, but a Supervisor Mode? You may be quite lonely by insisting that OSes like Xenix, AmigaOS or ELKS do not have a kernel :)) Your Argumentation puts the cart before the hores. Kernels have existed before CPUs had a kernel mode. Kernel mode is a later hardware enhancement to ease creation of less dependent kernels. – Raffzahn Dec 01 '22 at 01:25
  • 2
    @zomega If you want to make up your own definition of what a kernel is, then there's no real point discussing what a kernel is, because from your perspective it's whatever the heck you want it to be. However, if you are interested in the actual definition then you should probably listen to what other people are telling you and revise your opinion. Given that kernel mode is a tool to help writing kernels, your argument is a bit like saying "It's not a cycle, because it's not in a cycle lane". – HappyDog Dec 03 '22 at 09:05
  • @Raffzahn Then in your opinion every device like a watch, a fridge or an USB pen drive has a kernel because it has some kind of core component. – zomega Dec 03 '22 at 09:25
  • @Raffzahn These OSes don't have kernel calls so how can they be kernels... – zomega Dec 03 '22 at 09:27
  • @zomega Go ahead, tell me what is needed to separate a kernel call from any other call - beside that it calls a kernel function? – Raffzahn Dec 03 '22 at 14:31
  • @Raffzahn It switches the ring. On MSDOS I think software interrupts are used. But they are like normal jumps. They do not differ from calling any other library function. – zomega Dec 03 '22 at 16:23
  • @zomega Except software interrupts do only change the 'ring' on some CPUs. Would that mean that one and the same software is a kernel or not a kernel, depending on what CPU it is executed? – Raffzahn Dec 03 '22 at 16:27
  • @Raffzahn There is no software core which can run on both. Noone would design a software core which can run on both because it's completely different. – zomega Dec 03 '22 at 16:32
  • @Raffzahn On MSDOS software interrupts do not change ring. That is what I wanted to say. – zomega Dec 03 '22 at 17:09
  • 1
    @zomega - what about MS's Singularity OS? Would you say that that also has no kernel due to the fact that it runs user programs in ring 0 and therefore they can dispatch calls directly to the kernel using the regular call instruction? – occipita Dec 04 '22 at 20:45
  • 1
    @zomega - "Then in your opinion every device like a watch, a fridge or an USB pen drive has a kernel because it has some kind of core component" ... I'd disagree in some but not all cases here. Very simple embedded devices tend to be written with all of the code as part of the same codebase. In this case, there are no separate distinguishable components so realistically one cannot say there is a kernel in them. But as soon as someone writes a separate layer that provides fundamental services (eg multitasking, memory management, etc) that becomes a kernel. For example, many embedded ... – occipita Dec 04 '22 at 20:51
  • 1
    ... devices use this particular kernel, which supports many hardware platforms, quite a few of which do not provide privilege separation of any kind. But it is clearly a kernel, nonetheless. A fridge (if it has a processor at all; most do not) is likely to be in the former category. A USB pen drive, however, would most likely be in the latter category and would probably have a kernel. – occipita Dec 04 '22 at 20:53
  • @occipita AFAIK on MS singularity user programs are written in C#. This is a good example. The C# compilation is not native code. When it is executed at least some parts are emulated. This OS does have a kernel and such an OS can run on any CPU even without a kernel/protected mode. It is clearly to see because the access of user programs is limited. But it is based on emulation which makes it slower. So it is rarely used. – zomega Dec 04 '22 at 21:04
  • 1
    @zomega - "The C# compilation is not native code" -- actually, my understanding is that it is native code. Nothing is "emulated" (whatever that means in this context). If you read the papers, you will find that it is in fact definitively not slower, which is why MS used this system for running services that required high performance computer systems. In fact the entire point of this system is that its software-based isolation is actually faster than the hardware enforced isolation that is more commonly used because it eliminates the need for privilege level switching. – occipita Dec 04 '22 at 21:12
  • @occipita Yes it's a software based isolation. And it is always slower as hardware based isolation. For example you periodically have to check (using software) if it is time to switch to another task. This is one reason why it is slower. It's very ugly. The whole idea of replacing CPU protected mode by software sucks. – zomega Dec 05 '22 at 09:37
  • 1
    @zomega - you have no idea what you're talking about. Singularity did no such thing, and its performance was higher than equivalent systems built on traditional hardware isolation. There are downsides of using software protection, but performance is not one of them. (Restriction in available languages to build system software with is one, and increase in complexity of the security-critical parts of the kernel with resulting increase in likelihood of security flaws existing is the other) – occipita Dec 05 '22 at 18:05
  • @occipita Well believe what you want. – zomega Dec 05 '22 at 18:15
13

As I've said at http://jdebp.info/FGA/operating-system-nut-metaphor.html and at https://superuser.com/a/329479/38062 , this terminology is fairly foreign to the world of MS-DOS, and CP/M before it, in the first place. Always remember: these terms are metaphors. They don't have exact meanings, and arguing whether the "DOS kernel" was discarded or the "DOS part" was discarded or the "DOS foundation" is discarded is really putting too much of a specific meaning into a term that only really means the inner part an operating system when viewed through the analogy of a nut.

The architecture of DOS+Windows 95/98/ME actually has a lot of layers (ROM firmware, DOS layer, virtual machine manager, Win16 layer, Win32 layer, Explorer shell, command processor, and housekeeping utility programs), and how well one can match it up with a simplistic nut metaphor is confounded by how one is viewing it at the time. More realistically, it's more of an onion than a nut, but even that is a simplification, as the layering is not uniform in every aspect.

Some people like to place a single boundary at the Win16 API, and view what is inside that as "the kernel"; but there are at least three boundaries that can be viewed as where the "system calls" are, and which boundary encloses "the kernel" really depends from which boundary one is focussing upon.

Similarly, there are bits actually named "kernel" in their filenames, but that only form parts of the layer at their particular levels. The KERNEL.DLL is only a part of a layer that also encompasses things like USER.DLL, and SYSTEM.DRV.

And the design heritage goes back as far as CP/M, which didn't really have this terminology in the first place. CP/M was not modelled as a "kernel" and a "shell", and people did not really use that metaphor for its architecture at the time. MS-DOS inherited the CP/M way of viewing an operating system architecture, and the way that MS-DOS evolved into DOS+Windows 95/98/ME did not happen along the lines of an operating-system-as-a-nut metaphor.

People who got hung up on their notion that MS-DOS was not a "kernel", forgot that MS-DOS wasn't the only thing that got set aside. Windows NT not only didn't share the underpinning MS-DOS, it didn't share the VMM architecture, the VxDs, or even the way that the 32-bit system was layered over the 16-bit system. They should have pulled you up on your idea that it was "DOS" that was discarded, whether or not one could view that as a "kernel" of a metaphorical nut. A whole lot more was discarded, and re-architected in a very different way.

Finally: Do not conflate the "kernel" of an operating system with "the part that runs when the processor is in supervisor mode". "kernel" is not that precise a term, and there are operating systems for processors that have user/supervisor mode distinctions where "the bits that are internal to the system call interface" (one way that people sometimes choose to define a "kernel") run partly or even wholly in the processor's user mode. Not only is this is a metaphor, not a precise term with one definite meaning, but also it is not necessarily a metaphor aligned with processor modes, or even one that is limited to operating systems with processor modes.

user3840170
  • 23,072
  • 4
  • 91
  • 150
JdeBP
  • 2,288
  • 14
  • 24
  • For me the code running in user mode (for example a system GUI library) are system libraries but not part of the kernel. For me everything running in kernel mode is the kernel. I cannot see any situation where this definition fails. So I am fine with it. – zomega Nov 30 '22 at 15:43
  • 3
    @somega Consider that Unix has been ported to the 8086, once by none other than Microsoft. The 8086 has no kernel mode, but you’d be hard-pressed to say that Unix has no kernel. – user3840170 Nov 30 '22 at 15:55
  • @user3840170 This port in fact has a kernel even though the 8086 has no kernel mode. This is an rare exception of the general rule that the kernel has to run in kernel mode. Because normally it does not make sense to design a kernel for a CPU that does not support kernel mode. This unix port is a rare exception what does not mean that the general rule has been refuted. – zomega Nov 30 '22 at 16:21
  • 2
    @somega - in Windows, the kernel and the exec both run in kernel mode. And for systems in general, loadable drivers are not considered to be 'part of the kernel', even if they have code which runs in the privileged processor modes (note that x86 doesn't even have a "kernel mode"). You're trying to make a word have a crisp meaning that it actually does not possess. – dave Nov 30 '22 at 17:38
  • @another-dave ‘exec’? – user3840170 Nov 30 '22 at 17:44
  • @another-dave Yes drivers are not part of the kernel even though they run in kernel, privileged, real or supervisor mode (what ever you want to call it). But we are spinning in circles. There are simply two definitions around here. Some say everything running in kernal mode is considered kernel. Others say all core components can be called kernal. I prefer the first definition because it clearly says which part of the OS is the kernal. The second definition leaves much space for interpretations and opinions. – zomega Nov 30 '22 at 17:52
  • 1
    @user3840170 - NT uses a layered model. The kernel is basically CPU dispatching, exception handling, and a few other very low-level things. The exec provides the 'services' - process management, object management, I/O, etc. – dave Nov 30 '22 at 20:27
  • 2
    @somega - only Commodore machines have a 'kernal' :-) – dave Nov 30 '22 at 20:29
  • @another-dave Yes I already recognized that but it was too late to edit the comment ;-) – zomega Nov 30 '22 at 20:42
  • 2
    @zomega "Some say everything running in kernel mode is considered kernel." - as far as I can see from the answers and comments on this page, only you say that. That makes it something of a "Humpty-Dumpty definition" - "When I use a word, it means just what I choose it to mean — neither more nor less." – IMSoP Dec 01 '22 at 18:16
  • @IMSoP No this is not true. If you look into the comments directly under my question there is Mr. Andersen saying the same as I. Also if you google for "kernel mode" you can find countless sites saying what I say. In this question I heard for the first time someone saying that code that does not run in a privileged CPU mode can be considered a kernel. Also this document https://doi.org/10.1145/800009.808043 proofes that in the 1970s kernel mode already existed. So saying that kernel mode is a new thing that didn't exist in MSDOS times is also untrue. – zomega Dec 01 '22 at 18:38
  • 1
    Yet another data point: Bill Gates referred to MS-DOS as a kernel, e.g. in this Infoworld article, “we’re committed to operating-system kernels like MS-DOS and Xenix”. – Stephen Kitt Dec 04 '22 at 12:44
  • "there are operating systems for processors that have user/supervisor mode distinctions where "the bits that are internal to the system call interface" (one way that people sometimes choose to define a "kernel") run partly or even wholly in the processor's user mode" -- and of course there are also operating systems where user-supplied code runs in the processor's supervisor mode, e.g. Microsoft's Singularity – occipita Dec 04 '22 at 21:01