156

I am not able to understand the difference between a kernel and an operating system. I do not see any difference between them. Is the kernel an operating system?

John Topley
  • 113,588
  • 46
  • 195
  • 237
Xinus
  • 29,617
  • 32
  • 119
  • 165

11 Answers11

80

The technical definition of an operating system is "a platform that consists of specific set of libraries and infrastructure for applications to be built upon and interact with each other". A kernel is an operating system in that sense.

The end-user definition is usually something around "a software package that provides a desktop, shortcuts to applications, a web browser and a media player". A kernel doesn't match that definition.

So for an end-user a Linux distribution (say Ubuntu) is an Operating System while for a programmer the Linux kernel itself is a perfectly valid OS depending on what you're trying to achieve. For instance embedded systems are mostly just kernel with very small number of specialized processes running on top of them. In that case the kernel itself becomes the OS itself.

I think you can draw the line at what the majority of the applications running on top of that OS do require. If most of them require only kernel, the kernel is the OS, if most of them require X Window System running, then your OS becomes X + kernel.

Sedat Kapanoglu
  • 46,641
  • 25
  • 114
  • 148
  • 6
    *The end-user definition is usually something around "a software package that provides a desktop, shortcuts to applications, a web browser and a media player". A kernel doesn't match that definition.* Just because someone has no idea what an operating system is doesn't mean that their definition is valid. – Byte Lab Dec 08 '16 at 03:02
  • 1
    @dimmsum it’s not just a colloquial definition. operating systems have been sold and marketed to users as such. – Sedat Kapanoglu Jan 19 '18 at 00:25
  • Could you please point me to any such marketing? I could see an OS vendor saying they provide a *platform* on which all such types of programs can run, but an OS does not include those programs. If you conflate the two then you're literally talking about the entire system, so the definition loses its meaning. – Byte Lab Jan 19 '18 at 01:04
  • @dimmsum sure. here is windows xp ad: https://guidebookgallery.org/ads/magazines/windows/winxpyesyoucan-1 – Sedat Kapanoglu Jan 19 '18 at 01:42
  • I won't argue semantics, but that ad is clearly a) some random marketing jargon with no technical influence, and b) potentially not even accurate (it has typos). Either way, some marketing intern's two-line ad for Microsoft XP has nothing to do with the definition of an operating system. It isn't the entire system - that's just a fact and basic common sense. – Byte Lab Jan 20 '18 at 22:26
  • 1
    @dimmsum i understand your point and that’s why i provided two different definitions. perhaps i should have called it “understanding”? i think end-users, especially during the era where operating systems were sold in boxes, have a different understanding of what an operating system is and that is directly relevant to how operating systems are commoditized. the windows xp box promised an entirely different transaction than a technical definition, that’s what i wanted to point out. – Sedat Kapanoglu Jan 21 '18 at 06:22
  • 2
    @dimmsum so there is operating system in computer science and there is another operating system on the shelves of a tech store. both are operating systems fron different perspectives. i wanted to emphasize that distinction. – Sedat Kapanoglu Jan 21 '18 at 06:25
  • I go back to my original point, which is that the end-user, who has no idea what an OS is, doesn't get to define it. There is no definition other than the "computer science" definition. I'm not trying to be pedantic here - it's just factually incorrect to claim that an OS is everything in the entire system just because that's the only frame of reference that an end-user has. If we defined things in the tech world by the buzzwords and misconceptions cooked up by marketing people and end users, nothing would have any meaning, and everything would overlap and be redundant. – Byte Lab Jan 22 '18 at 23:26
  • @DIMMSum i think the same argument can be made for smartphones. "people who buy and use smartphones have no idea what it actually is", because there is a separate intricate technical definition for something doesn't mean consumers can have "no idea" about it's value as a commodity. of course they do. – Sedat Kapanoglu Jan 23 '18 at 00:02
  • Isn't /sbin/init not part of the kernel? In that case, I think you're really limited in what you can do. I guess just boot up. – jinawee Dec 19 '18 at 14:04
79

A kernel is the part of the operating system that mediates access to system resources. It's responsible for enabling multiple applications to effectively share the hardware by controlling access to CPU, memory, disk I/O, and networking.

An operating system is the kernel plus applications that enable users to get something done (i.e compiler, text editor, window manager, etc).

Erich Douglass
  • 51,744
  • 11
  • 75
  • 60
  • 18
    Are compilers and text editors *really* part of the Operating System? Word is a glorified text editor - is that part of the OS? – jon hanson Jan 06 '10 at 16:35
  • 6
    What I don't get is "An operating system is the kernel plus applications" but if I install an application, say Word Perfect, then that shouldn't count as part of the operating system, no? – Celeritas Nov 05 '13 at 18:01
  • 7
    @Celeritas A little late to the party but no that installed application won't be counted as a part of operating system. The "applications" are actually the system utilities which come with the operating system. All the other softwares/applications you install lie on the layer above this. – hashcode55 Aug 29 '16 at 19:07
  • You were doing well until you wrote the parenthetical remark in the second paragraph. An operating system handles _requests_ made by those applications to control the hardware. So, the OS includes the kernel, devices drivers, and any other software/firmware that specifically controls the hardware at the lowest level. – Bob Jan 05 '19 at 14:39
48

It seems that the original metaphor that got us the word "kernel" for this in the first place has been forgotten. The metaphor is that an operating system is a seed. The "kernel" of the seed is the core of the operating system, providing operating system services to applications programs, which is surrounded by the "shell" of the seed that is what users see from the outside.

Some people want to tie "kernel" (and, indeed, "shell") down to be more specific than that. But in truth there's a lot of variation across operating systems. Not the least these variations is what constitutes a "shell" (which can range from Solaris' sh through Netware's Console Command Interpreter to OS/2's Workplace Shell and Windows NT's Explorer), but there's also a lot of variance from one operating system to another in what is, and isn't, a part of a "kernel" (which may or may not include disk I/O, for example).

It's best to remember that these terms are metaphors.

Further reading

JdeBP
  • 2,127
  • 16
  • 24
  • 1
    Nice. However your answer is verbatim taken from the "Further reading". Now I know how to get lots of upvotes via copy and paste. LOL. Still helpful nonetheless. – lacostenycoder Nov 27 '19 at 22:46
19

Well, there is a difference between kernel and OS. Kernel as described above is the heart of OS which manages the core features of an OS while if some useful applications and utilities are added over the kernel, then the complete package becomes an OS. So, it can easily be said that an operating system consists of a kernel space and a user space.

So, we can say that Linux is a kernel as it does not include applications like file-system utilities, windowing systems and graphical desktops, system administrator commands, text editors, compilers etc. So, various companies add these kind of applications over linux kernel and provide their operating system like ubuntu, suse, centOS, redHat etc.

n.zia
  • 191
  • 1
  • 2
9

The kernel is part of the operating system, while not being the operating system itself. Rather than going into all of what a kernel does, I will defer to the wikipedia page: http://en.wikipedia.org/wiki/Kernel_%28computing%29. Great, thorough overview.

danben
  • 80,905
  • 18
  • 123
  • 145
  • 3
    Meh, Try the first sentence of http://en.wikipedia.org/wiki/Operating_system instead. An operating system is formally tasked with mediating access to limited resources (approximately *everything* on the computer), and monolithic kernels do exactly that (micro kernels dump some of that work onto processes, but those are still distributed with the kernel). From a programmers prospective the kernel *is* the OS. Users may count on the shell or other interfaces, but that is *users*. Remember that OSs run on everything from super computers down to any embedded widget that needs to do *two* things. – dmckee --- ex-moderator kitten Jan 06 '10 at 19:05
  • So your point is that SOME operating systems are themselves kernels, or that the parts of an OS that a user interacts with are not part of the OS? – danben Jan 06 '10 at 19:43
  • Also, "the first sentence of en.wikipedia.org/wiki/Operating_system" says "An operating system (OS) is an interface between hardware and user..." so I don't understand why you are making the distinction between what a user interacts with and the rest of it. – danben Jan 06 '10 at 19:44
9

The Operating System is a generic name given to all of the elements (user interface, libraries, resources) which make up the system as a whole.

The kernel is "brain" of the operating system, which controls everything from access to the hard disk to memory management. Whenever you want to do anything, it goes though the kernel.

Kyle
  • 763
  • 3
  • 9
  • 18
7

a kernel is part of the operating system, it is the first thing that the boot loader loads onto the cpu (for most operating systems), it is the part that interfaces with the hardware, and it also manages what programs can do what with the hardware, it is really the central part of the os, it is made up of drivers, a driver is a program that interfaces with a particular piece of hardware, for example: if I made a digital camera for computers, I would need to make a driver for it, the drivers are the only programs that can control the input and output of the computer

noah
  • 91
  • 1
  • 2
3

Simple Answer

The Kernel is the core piece of the operating system. It is not necessarily an operating system in and of itself.

Everything else is built around it.

Ellaborate Definition

Kernel (computing) - Wikipedia

Justin Niessner
  • 242,243
  • 40
  • 408
  • 536
2

In computing, the 'kernel' is the central component of most computer operating systems; it is a bridge between applications and the actual data processing done at the hardware level. The kernel's responsibilities include managing the system's resources (the communication between hardware and software components). Usually as a basic component of an operating system, a kernel can provide the lowest-level abstraction layer for the resources (especially processors and I/O devices) that application software must control to perform its function. It typically makes these facilities available to application processes through inter-process communication mechanisms and system calls.

2

The kernel might be the operating system or it might be a part of the operating system. In Linux, the kernel is loaded and executed first. Then it starts up other bits of the OS (like init) to make the system useful.

This is especially true in a micro-kernel environment. The kernel has minimal functionality. Everything else, like file systems and TCP/IP, run as a user process.

Richard Pennington
  • 19,673
  • 4
  • 43
  • 72
  • What about Kernel in a scripting language like Ruby? For example if you have Ruby installed, you can run this from *nix terminal `ruby -e "puts Kernel.methods"` and you will see many methods defined. – lacostenycoder Nov 27 '19 at 22:51
2

Kernel resides in OS.Actually it is a memory space specially provided for handling the os functions.Some even say OS handles Resources of system and Kernel is one which is heart of os and maintain,manage i.e.keep track of os.

Raj
  • 51
  • 1
  • 4