Vous êtes sur la page 1sur 15

KERNEL DESIGN COMPARISON

LINUX (2.6.28)

VS

WINDOWS (VISTA SP1)

MEMBER NAMES: ROLL #:

AIMEN AHMER CS-137

SHIRAZ SIDDIQ CS-014

SUBMISSION DATE: 19 September, 2010


 
TABLE OF CONTENTS

OVERVIEW 3

KERNEL COMPARISON: LINUX (2.6.28) VERSUS WINDOWS (VISTA SP1) 9

ARCHITECTURE 9

Kernel Architecture 9

Architecture Exceptions 10

OS 11

System Calls 11

OS API 11

Available OS API 11

SOURCE CODE 12

Kernel Source Code 12

Driver Source Code 13

Kernel + Drivers Source Code 14 


 
Overview

Both Windows and Linux come in many flavors. All the flavors of Windows come
from Microsoft, the various distributions of Linux come from different companies
(i.e. Linspire, Red Hat, SuSE, Ubuntu, Xandros, Knoppix, Slackware, Lycoris, etc. ).

Windows has two main lines. The older flavors are referred to as "Win9x" and
consist of Windows 95, 98, 98SE and Me. The newer flavors are referred to as "NT
class" and consist of Windows NT3, NT4, 2000, XP and Vista. Going back in time,
Windows 3.x preceded Windows 95 by a few years. And before that, there were
earlier versions of Windows, but they were not popular. Microsoft no longer
supports Windows NT3, NT4, all the 9x versions and of course anything older.
Support for Windows 2000 is partial (as of April 2007).

The flavors of Linux are referred to as distributions (often shortened to "distros"). All
the Linux distributions released around the same time frame will use the same
kernel (the guts of the Operating System). They differ in the add-on software
provided, GUI, install process, price, documentation and technical support. Both
Linux and Windows come in desktop and server editions.

There may be too many distributions of Linux, it's possible that this is hurting Linux
in the marketplace. It could be that the lack of a Linux distro from a major computer
company is also hurting it in the marketplace. IBM is a big Linux backer but does not
have their own branded distribution. Currently there seem to be many nice things
said about the Ubuntu distribution.

Linux is customizable in a way that Windows is not. For one, the user interface,
while similar in concept, varies in detail from distribution to distribution. For
example, the task bar may default to being on the top or the bottom. Also, there are
many special purpose versions of Linux above and beyond the full blown
distributions described above.


 
For example, NASLite is a version of Linux that runs off a single floppy disk (since
revised to also boot from a CD) and converts an old computer into a file server. This
ultra-small edition of Linux is capable of networking, file sharing and being a web
server.

KERNEL

A kernel is the core component of every computer operating system. While kernels
are highly technical in nature, and may be hidden from the user under many layers
of software and applications, they do have distinguishing or characteristic features,
such as computer architecture, design goals, as well as the more practical features
that they provide. A direct comparison of operating system kernels can highlight
these design choices, and provide insight into different niches and the evolving
technology of kernels.

Technical Features

Linux supports true preemptive multitasking (both in user mode and kernel
mode), virtual memory, shared libraries, demand loading, shared copy-on-write
executable, memory management, the Internet protocol suite, and threading.

Linux is a monolithic kernel. Device drivers and kernel extensions run in kernel
space (ring 0 in many CPU architectures), with full access to the hardware, although
some exceptions run in user space. The graphics system most people use with Linux
doesn't run in the kernel, in contrast to that found in Microsoft Windows.

Kernel mode preemption allows device drivers to be preempted under certain


conditions. This feature was added to handle hardware interrupts correctly and
improve support for symmetric multiprocessing (SMP). Preemption also
improves latency, increasing responsiveness and making Linux more suitable for
real-time applications


 
Kernel Panic

In Linux, a "panic" is an unrecoverable system error detected by the kernel contrary


to similar errors detected by user space code. It is possible for kernel code to indicate
such a condition by calling the panic function located in the header
file sys/system.h. However, most panics are the result of unhandled
processor exceptions in kernel code, such as references to invalid memory addresses.
These are typically indicative of a bug somewhere in the call chain leading to the
panic. They can also indicate a failure of hardware, such as a failed RAM cell or
errors in arithmetic functions in the processor caused by a processor bug,
overheating/damaged processor, or a soft error.

Kernel Oops

A report of a bug in the kernel is called an "OOPS". It is automatically collected by


the kerneloops software or the abrt kernel oops plugin. KernelOops.org collects
these reports and publishes statistics on their website.


 
Windo
ows Vista
a
Vista process
p dessign is driv
ven by thee need to p
provide sup
pport for a variety o
of
OS en
nvironments. Accordiingly, the native process
p stru
uctures an
nd services
provided by the Windows
W K
Kernel aree relatively
y simple aand generaal purposee,
ng
allowin each OS subsysstem to em
mulate a particular
p p
process strructure and
d
functio
onality. Heere are so
ome of th
he importaant charactteristics off Windows
processses:
• Windows processes are
a implem
mented as ob
bjects.

• An executtable processs may conttain one or more threaads.

• Both proceess and threead objects have built--in synchro


onization caapabilities.

Figure below illu


ustrates thee way in which
w a process relattes to the resources
r iit
controlls or uses. Each process is asssigned a seecurity acccess token, called thee
primarry token of the
t processs.

Figure windowss process an


nd its thread
d

6
When a user first logs on, Vista creates an access token that includes the security
ID for the user. Every process that is created by or runs on behalf of this user has
a copy of this access token. Windows uses the token to validate the user’s ability
to access secured objects or to perform restricted functions on the system and
on secured objects. The access token controls whether the process can change its
own attributes. In this case, the process does not have a handle opened to its
access token. If the process attempts to open such a handle, the security system
determines whether this is permitted and therefore whether the process may
change its own attributes.
Also related to the process is a series of blocks that define the virtual address
space currently assigned to this process. The process cannot directly modify these
structures but must rely on the virtual memory manager, which provides a
memory allocation service for the process.
Finally, the process includes an object table, with handles to other objects known
to this process. One handle exists for each thread contained in this object.
In addition, the process has access to a file object and to a section object that
defines a section of shared memory.
Windows Vista supports concurrency among processes because threads in
different processes may execute concurrently. Moreover, multiple threads within
the same process may be allocated to separate processors and execute
simultaneously. A multithreaded process achieves concurrency without the
overhead of using multiple processes. Threads within the same process can
exchange information through their common address space and have access to
the shared resources of the process. Threads in different processes can exchange
information through shared memory that has been set up between the two
processes.
An object-oriented multithreaded process is an efficient means of implementing
a server application. For example, one server process can service a number of
clients.


 
Linux Kernel 2.6

A process, or task, in Linux is represented by a task_struct data structure.


The task_struct data structure contains information in a number of categories:

1. Unlike Vista, processes in Linux are both containers and the schedulable
entities; processes can share address space and system resources, making
processes effectively usable as threads.
2. Also unlike Vista and Most services are implemented in the kernel, with the
exception of many networking functions. Thus Linux kernel is relative bigger
in size comparing former two OS.

Linux provides a unique solution in that it does not recognize a distinction


between threads and processes. Using a mechanism similar to the lightweight
processes of Open Solaris, user-level threads are mapped into kernel-level
processes. Multiple user-level threads that constitute a single user-level process
are mapped into Linux kernel-level processes that share the same group ID. This
enables these processes to share resources such as files and memory and to avoid
the need for a context switch when the scheduler switches among processes in the
same group.


 
Kernel C
Comparison
n: Linux (2.66.28) versuss Windowss (Vista SP11)

Architeccture
Kernel A
Architecturre
Architeccture Linu
ux Win
ndows

Architeccture monolithic (with monolitthic (with


exceptions) excep
ptions)

i.e. subsy
ystems / drivers
d user space N N

Y (exception
ns below) Y (exceptiions below))

i.e. posssible kerneel protectio


on from N N
subsysteems / driveers
Y (exception
ns below) Y (exceptiions below))

9
Architeccture Excep
ptions
Architeccture (excep
ptions) Linux Windows

user spaace - USB Y Y

user spaace - printin


ng Y Y

user spaace - filesysttem (FUSE,, -) Y N

user spaace - audio (see below)) Y Y

user spaace - graphiics (see belo


ow) Y Y

Operating System

10
OS
System Calls
System Calls Linux Windows

interrupt not needed Y Y

system calls total 324 402

OS API
OS API Linux Windows

OS API Linux Win32

API call system call library call46

user space library glibc C runtime, Win32, Native

API change list 2.6.x Vista

Available OS API
OS API (available) Linux Windows

POSIX API Y Y (option)

N (without option)

Linux API Y N

Win32 API N Y

11 
 
OS/2 API N N

MS Native API N Y (mostly undocumented)

Related Standards

Single UNIX Specification (SUS) Y (not cert.) N

Linux Standard Base (LSB) Y N

Category

Microsoft Windows N Y

Unix-like - Genetic UNIX N N

Unix-like - Trademark / Branded UNIX N N

Unix-like - Functional UNIX Y N

Source Code
Kernel Source Code
Kernel Language (no drivers) Linux Windows

source open closed source


source
partly open source (WAP access
WRK)

language - C Y Y

language - Assembly Y Y

12 
 
language - SEH N Y

language - VEH N Y

language - C++8 N Y

language - C proportion8 94% ±3% 60% ±25%

kernel 3.5M 10M ±5M


size Source_lines_of_code 28 ±0.5M

Driver Source Code


Source Code (drivers) Linux Windows

language - C Y Y

language - Assembly Y Y'

language - SEH N Y

language - VEH N Y

language - C++8 N Y

drivers proportion of total 50% 40% ±20%

i.e. drivers - size Source_lines_of_code 28 3.5M ±0.5M 7M ±3M

drivers proportion of total bugs 85% 75% ±20%

13 
 
Kernel + Drivers Source Code
Source Code (kernel + drivers) Linux Windows

language - C proportion8 94% ±3% 70% ±25%

language - C++8 N Y

total Source_lines_of_code28 7M ±2M 17M ±9M

estimated bug error rate per line 0.02% 0.2%

i.e. estimated bugs total 1400 34000

14 
 
BIBLIOGRAPHY

1. Operating Systems by William Stallings

2. http://www.wikipedia.org

3. Understanding the Linux Kernel, Second Edition - O'Reilly Media

15 
 

Vous aimerez peut-être aussi