Kernel: Difference between revisions

From COMP15212 Wiki
pc>Yuron
No edit summary
 
gravatar Yuron [userbureaucratinterface-adminsysopPHRhYmxlIGNsYXNzPSJ0d3BvcHVwIj48dHI+PHRkIGNsYXNzPSJ0d3BvcHVwLWVudHJ5dGl0bGUiPkdyb3Vwczo8L3RkPjx0ZD51c2VyPGJyIC8+YnVyZWF1Y3JhdDxiciAvPmludGVyZmFjZS1hZG1pbjxiciAvPnN5c29wPGJyIC8+PC90ZD48L3RyPjwvdGFibGU+] (talk | contribs)
m (1 revision imported)
(No difference)

Revision as of 12:46, 26 July 2019

Depends on What is an OS

The kernel is the core of an operating system; the part which resides in protected space, including the process manager, scheduler, interprocess communication, exception handlers, resource managers etc. It is isolated from the user space (assuming the processor/system architecture allows this – most ‘large’ systems do, these days) and connected by system calls.

Is the “kernel” the same as the “operating system”?

Maybe: it depends on your design philosophy.

The kernel is responsible for implementing mechanisms; the debate is whether it should also be responsible for policy. Time for an example:

  • A scheduling mechanism includes the code which saves the context of one process and restores the context of another. It may be highly specific to a particular processor ISA.
  • A scheduling policy is responsible for when to switch: decisions on time-slicing, priority etc. This is generally fairly processor-agnostic.

Similar examples can be constructed for memory management, filing systems etc.

Types of Kernel

Monolithic Kernel

Yes. Everything is included in the kernel and runs in the privileged mode. All the routines have direct access to the operating system’s memory.

Monolithic Kernel

Disadvantages:

  • Size: code continues to ‘bloat’ as it develops which makes management difficult.
  • Reliability: an introduced bug in one place can crash the whole system.
  • Portability: it is harder to adapt a large slab of code for a new system/architecture.

Microkernel

No. The kernel contains the handlers which need to be privileged but functions which do not – examples might include the filing system, graphical user interface (GUI) and device drivers – are separated as user-mode processes. This keeps the size of the ‘sensitive’ code down, which is likely to improve reliability as it’s easier to modify and maintain. Only the required device drivers need to be loaded and a fault in one of these (a likely source of problems) cannot crash the kernel itself.

Microkernel

Disadvantages:

  • Speed: the additional needs for communications (and extra system calls) leads to a greater overhead from the O.S.
  • Complexity: greater complexity gives more potential for problems.

Hybrid Kernel

Not entirely. A hybrid kernel is a compromise: a microkernel with some functions inside the ‘privilege’ boundary for efficiency.

Some other approaches – and lots of detail – can be found with a little research: here’s a start.

Which is best?

That depends who you ask. And what it’s for.

Not everyone agrees!