operating systems the kernel is a program that constitutes the central core of a computer operating...
TRANSCRIPT
Operating Systems
bullThe kernel is a program that constitutes the central core of a computer operating system It has complete control over everything that occurs in the system
bullThe kernel is the first part of the operating system to load into the main memory (DRAM) during booting and it remains in the memory for the entire duration of the computer session
bullThe kernel is usually loaded into a protected area of memory which prevents it from being overwritten by other programs
bullThe kernel performs its tasks (eg executing processes and handling interrupts) in kernel space whereas everything a user normally does is done in user space
bullthe processor usually provides two modes of execution to separate normal user modes from the special supervisor privileges eg when a process executes a system call the execution mode of the process changes from user mode to kernel mode
bullWhen a computer crashes it actually means the kernel has crashed
bullThe kernel provides basic services for all other parts of the operating system typically including memory management process management file management and IO (inputoutput) management (ie accessing the peripheral devices)
bullA typical kernel containsbullMemory managementAllocates the systems address spaces among all users of the kernels services
bullTimers Kernel timers
bullSystem Calls System calls interface Interrupts and Exceptions Interrupts and exceptions handling
bullProcesses Process management Scheduling Process scheduling
bullIO Low levelbullThe kernel should not be confused with the BIOS(Basic InputOutput System) which is an independent program stored in a chip on the motherboard that is used during the booting (ie startup) process for such tasks as initializing the hardware and loading the kernel into memory (RAM) Whereas the BIOS always remains in the computer and is specific to its particular hardware the kernel is different for every operating system or version
Kernel Analogy to Chef Cooking a Dish
bull Ingredients = computer applications
bull Kitchen appliances = computer resources
bull Dish = operating system
ndash decides which ingredients and appliances are
needed ndash ie the recipe
bull Chef = kernel
ndash chef decides when the ingredients are put in the
appliances ndash the cook
bull People attending dinner = users
Without a recipe a cook cannot prepare a dinner
A recipe without a cook cannot magically prepare itself
bullKernels can be classified into three broad categoriesbullmonolithic kernelsbullmicrokernels1048766bullHybrid kernels
Monolithic kernels which have traditionally been used by Unix and Linux contain all the operating system core functions and the device drivers
A microkernel usually provides only minimal services such as defining memory address spaces interprocess communication (IPC) and process management All other functions such as hardware management are implemented as processes running independently of the kernel
Hybrid kernels are similar to microkernels except that they include additional code in kernel space so that such code can run more swiftly than it would were it in user space These kernels represent a compromise
System Calls
bull Applications and modules in user space
need to use system calls to communicate
ndash A system call analogy would be like having to use a phone via a switchboard to communicate with the person on the next desk
bull In a monolithic kernel every part of the kernel is located in the same address space ndash hence no system calls required
Monolithic vs Microkernel Analogy
Monolithic Kernel
bull A single piece of beef
Microkernel
bull Chop the above piece of beef into chunks
bull Put each chunk in a plastic bag (isolation)
bull Tie each bag together using pieces of string (IPC)
The total weight for the microkernel analogy will be
the weight of the beef plus the weight of bags and
string
So although the microkernel appears simple at a
local level it is much more complex at a global
level
The Monolithic Versus Micro Controversy
bullWith a monolithic kernel an error in the kernel can cause the entire system to crash
bullWith a microkernel if a kernel process crashes it is still possible to prevent a crash of the system as a whole by merely restarting the service that caused the error
bullHowever operating systems with monolithic kernels such as Linux have become extremely stable and can run for years without crashing
bullAnother disadvantage cited for monolithic kernels is that they are not portable that is they must be rewritten for each new architecture that the operating system is to be ported to However in practice this has not appeared to be a major disadvantage and it has not stopped Linux from being ported to numerous processors
bullMonolithic kernels also appear to have the disadvantage that their source code can become extremely large
bullHowever the advocates of monolithic kernels claim that in spite of their size such kernels are easier to design correctly
bullThe size of the compiled kernel is only a tiny fraction of that of the source code
bullContributing to the small size of the Linux kernel is its ability to dynamically load modules at runtime
bullLinux kernel can be made extremely small not only because of its ability to dynamically load modules but also because of its ease of customisationndasheg embedded linux
bullAlthough microkernels are very small by themselves in combination with all their required auxiliary code they are in fact often larger than monolithic kernels
bullThere are extremely few widely used operating systems today that utilise microkernels--mainly just AIX and QNX
Shells
bullThe shell is the outermost part of the operating system It is the part that interacts with the user
bullIn modern operating systems most users interact with the operating system through a Graphical User Interface(GUI)
bullThe basic unit of software that the operating system deals with in scheduling the work done by the processor is either a processor a thread depending on the operating system
bullA process is a program which is running ie the operating system has assigned the process memory it can use a stack priority status etc
bullThere are also numerous processes that run without giving you direct evidence that they ever exist For example Windows XP and UNIX can have dozens of background processes running to handle the network memory management disk management etc
bullThe operating system allows the application to begin running suspending the execution only long enough to deal with interrupts and user input
bullInterrupts are special signals sent by hardware or software to the CPU
bullSome interrupts are masked--that is the operating system will ignore the interrupts from some sources so that a particular job can be finished as quickly as possible
bullSome interrupts are so important that they cant be ignored These non-maskable interrupts(NMIs) must be dealt with immediately regardless of the other tasks at hand
bullMulti-tasking allows several processes to be active at one time by switching between them using timer interrupts
bullAll of the information needed to keep track of a process when switching is kept in a data package called a process control block The process control block(PCB) typically contains
An ID number that identifies the process
Pointers to the locations in the program and its data where processing last occurred
Register contents States of various flags and switches
Pointers to the upper and lower bounds of the memory required for the process
A list of files opened by the process The priority of the process
The status of all IO devices needed bythe process
bullProcesses that are running often require an input from the user and whilst waiting is stopped ndashthis state is known as blocked or suspended
bullProblems can occur if the user tries to have too many processes functioning at the same time The operating system itself requires some CPU cycles to perform the saving and swapping of all the registers queues and stacks of the application processes
bullWhen too many processes are active the vast majority of its available CPU cycles are used to swap between processes rather than run processes ndashthrashing
bullOne way that operating-system designers reduce the chance of thrashing is by reducing the need for new processes to perform various tasks
bullSome operating systems allow for a process-lite called a thread that can deal with all the CPU-intensive work of a normal process but generally does not deal with the various types of IO and does not establish structures requiring the extensive process control block of a regular process
- Slide 1
- Slide 2
- Kernel Analogy to Chef Cooking a Dish
- Slide 4
- Slide 5
- System Calls
- Monolithic vs Microkernel Analogy
- Slide 8
- Slide 9
- Slide 10
- Slide 11
- Slide 12
-
bullThe kernel provides basic services for all other parts of the operating system typically including memory management process management file management and IO (inputoutput) management (ie accessing the peripheral devices)
bullA typical kernel containsbullMemory managementAllocates the systems address spaces among all users of the kernels services
bullTimers Kernel timers
bullSystem Calls System calls interface Interrupts and Exceptions Interrupts and exceptions handling
bullProcesses Process management Scheduling Process scheduling
bullIO Low levelbullThe kernel should not be confused with the BIOS(Basic InputOutput System) which is an independent program stored in a chip on the motherboard that is used during the booting (ie startup) process for such tasks as initializing the hardware and loading the kernel into memory (RAM) Whereas the BIOS always remains in the computer and is specific to its particular hardware the kernel is different for every operating system or version
Kernel Analogy to Chef Cooking a Dish
bull Ingredients = computer applications
bull Kitchen appliances = computer resources
bull Dish = operating system
ndash decides which ingredients and appliances are
needed ndash ie the recipe
bull Chef = kernel
ndash chef decides when the ingredients are put in the
appliances ndash the cook
bull People attending dinner = users
Without a recipe a cook cannot prepare a dinner
A recipe without a cook cannot magically prepare itself
bullKernels can be classified into three broad categoriesbullmonolithic kernelsbullmicrokernels1048766bullHybrid kernels
Monolithic kernels which have traditionally been used by Unix and Linux contain all the operating system core functions and the device drivers
A microkernel usually provides only minimal services such as defining memory address spaces interprocess communication (IPC) and process management All other functions such as hardware management are implemented as processes running independently of the kernel
Hybrid kernels are similar to microkernels except that they include additional code in kernel space so that such code can run more swiftly than it would were it in user space These kernels represent a compromise
System Calls
bull Applications and modules in user space
need to use system calls to communicate
ndash A system call analogy would be like having to use a phone via a switchboard to communicate with the person on the next desk
bull In a monolithic kernel every part of the kernel is located in the same address space ndash hence no system calls required
Monolithic vs Microkernel Analogy
Monolithic Kernel
bull A single piece of beef
Microkernel
bull Chop the above piece of beef into chunks
bull Put each chunk in a plastic bag (isolation)
bull Tie each bag together using pieces of string (IPC)
The total weight for the microkernel analogy will be
the weight of the beef plus the weight of bags and
string
So although the microkernel appears simple at a
local level it is much more complex at a global
level
The Monolithic Versus Micro Controversy
bullWith a monolithic kernel an error in the kernel can cause the entire system to crash
bullWith a microkernel if a kernel process crashes it is still possible to prevent a crash of the system as a whole by merely restarting the service that caused the error
bullHowever operating systems with monolithic kernels such as Linux have become extremely stable and can run for years without crashing
bullAnother disadvantage cited for monolithic kernels is that they are not portable that is they must be rewritten for each new architecture that the operating system is to be ported to However in practice this has not appeared to be a major disadvantage and it has not stopped Linux from being ported to numerous processors
bullMonolithic kernels also appear to have the disadvantage that their source code can become extremely large
bullHowever the advocates of monolithic kernels claim that in spite of their size such kernels are easier to design correctly
bullThe size of the compiled kernel is only a tiny fraction of that of the source code
bullContributing to the small size of the Linux kernel is its ability to dynamically load modules at runtime
bullLinux kernel can be made extremely small not only because of its ability to dynamically load modules but also because of its ease of customisationndasheg embedded linux
bullAlthough microkernels are very small by themselves in combination with all their required auxiliary code they are in fact often larger than monolithic kernels
bullThere are extremely few widely used operating systems today that utilise microkernels--mainly just AIX and QNX
Shells
bullThe shell is the outermost part of the operating system It is the part that interacts with the user
bullIn modern operating systems most users interact with the operating system through a Graphical User Interface(GUI)
bullThe basic unit of software that the operating system deals with in scheduling the work done by the processor is either a processor a thread depending on the operating system
bullA process is a program which is running ie the operating system has assigned the process memory it can use a stack priority status etc
bullThere are also numerous processes that run without giving you direct evidence that they ever exist For example Windows XP and UNIX can have dozens of background processes running to handle the network memory management disk management etc
bullThe operating system allows the application to begin running suspending the execution only long enough to deal with interrupts and user input
bullInterrupts are special signals sent by hardware or software to the CPU
bullSome interrupts are masked--that is the operating system will ignore the interrupts from some sources so that a particular job can be finished as quickly as possible
bullSome interrupts are so important that they cant be ignored These non-maskable interrupts(NMIs) must be dealt with immediately regardless of the other tasks at hand
bullMulti-tasking allows several processes to be active at one time by switching between them using timer interrupts
bullAll of the information needed to keep track of a process when switching is kept in a data package called a process control block The process control block(PCB) typically contains
An ID number that identifies the process
Pointers to the locations in the program and its data where processing last occurred
Register contents States of various flags and switches
Pointers to the upper and lower bounds of the memory required for the process
A list of files opened by the process The priority of the process
The status of all IO devices needed bythe process
bullProcesses that are running often require an input from the user and whilst waiting is stopped ndashthis state is known as blocked or suspended
bullProblems can occur if the user tries to have too many processes functioning at the same time The operating system itself requires some CPU cycles to perform the saving and swapping of all the registers queues and stacks of the application processes
bullWhen too many processes are active the vast majority of its available CPU cycles are used to swap between processes rather than run processes ndashthrashing
bullOne way that operating-system designers reduce the chance of thrashing is by reducing the need for new processes to perform various tasks
bullSome operating systems allow for a process-lite called a thread that can deal with all the CPU-intensive work of a normal process but generally does not deal with the various types of IO and does not establish structures requiring the extensive process control block of a regular process
- Slide 1
- Slide 2
- Kernel Analogy to Chef Cooking a Dish
- Slide 4
- Slide 5
- System Calls
- Monolithic vs Microkernel Analogy
- Slide 8
- Slide 9
- Slide 10
- Slide 11
- Slide 12
-
Kernel Analogy to Chef Cooking a Dish
bull Ingredients = computer applications
bull Kitchen appliances = computer resources
bull Dish = operating system
ndash decides which ingredients and appliances are
needed ndash ie the recipe
bull Chef = kernel
ndash chef decides when the ingredients are put in the
appliances ndash the cook
bull People attending dinner = users
Without a recipe a cook cannot prepare a dinner
A recipe without a cook cannot magically prepare itself
bullKernels can be classified into three broad categoriesbullmonolithic kernelsbullmicrokernels1048766bullHybrid kernels
Monolithic kernels which have traditionally been used by Unix and Linux contain all the operating system core functions and the device drivers
A microkernel usually provides only minimal services such as defining memory address spaces interprocess communication (IPC) and process management All other functions such as hardware management are implemented as processes running independently of the kernel
Hybrid kernels are similar to microkernels except that they include additional code in kernel space so that such code can run more swiftly than it would were it in user space These kernels represent a compromise
System Calls
bull Applications and modules in user space
need to use system calls to communicate
ndash A system call analogy would be like having to use a phone via a switchboard to communicate with the person on the next desk
bull In a monolithic kernel every part of the kernel is located in the same address space ndash hence no system calls required
Monolithic vs Microkernel Analogy
Monolithic Kernel
bull A single piece of beef
Microkernel
bull Chop the above piece of beef into chunks
bull Put each chunk in a plastic bag (isolation)
bull Tie each bag together using pieces of string (IPC)
The total weight for the microkernel analogy will be
the weight of the beef plus the weight of bags and
string
So although the microkernel appears simple at a
local level it is much more complex at a global
level
The Monolithic Versus Micro Controversy
bullWith a monolithic kernel an error in the kernel can cause the entire system to crash
bullWith a microkernel if a kernel process crashes it is still possible to prevent a crash of the system as a whole by merely restarting the service that caused the error
bullHowever operating systems with monolithic kernels such as Linux have become extremely stable and can run for years without crashing
bullAnother disadvantage cited for monolithic kernels is that they are not portable that is they must be rewritten for each new architecture that the operating system is to be ported to However in practice this has not appeared to be a major disadvantage and it has not stopped Linux from being ported to numerous processors
bullMonolithic kernels also appear to have the disadvantage that their source code can become extremely large
bullHowever the advocates of monolithic kernels claim that in spite of their size such kernels are easier to design correctly
bullThe size of the compiled kernel is only a tiny fraction of that of the source code
bullContributing to the small size of the Linux kernel is its ability to dynamically load modules at runtime
bullLinux kernel can be made extremely small not only because of its ability to dynamically load modules but also because of its ease of customisationndasheg embedded linux
bullAlthough microkernels are very small by themselves in combination with all their required auxiliary code they are in fact often larger than monolithic kernels
bullThere are extremely few widely used operating systems today that utilise microkernels--mainly just AIX and QNX
Shells
bullThe shell is the outermost part of the operating system It is the part that interacts with the user
bullIn modern operating systems most users interact with the operating system through a Graphical User Interface(GUI)
bullThe basic unit of software that the operating system deals with in scheduling the work done by the processor is either a processor a thread depending on the operating system
bullA process is a program which is running ie the operating system has assigned the process memory it can use a stack priority status etc
bullThere are also numerous processes that run without giving you direct evidence that they ever exist For example Windows XP and UNIX can have dozens of background processes running to handle the network memory management disk management etc
bullThe operating system allows the application to begin running suspending the execution only long enough to deal with interrupts and user input
bullInterrupts are special signals sent by hardware or software to the CPU
bullSome interrupts are masked--that is the operating system will ignore the interrupts from some sources so that a particular job can be finished as quickly as possible
bullSome interrupts are so important that they cant be ignored These non-maskable interrupts(NMIs) must be dealt with immediately regardless of the other tasks at hand
bullMulti-tasking allows several processes to be active at one time by switching between them using timer interrupts
bullAll of the information needed to keep track of a process when switching is kept in a data package called a process control block The process control block(PCB) typically contains
An ID number that identifies the process
Pointers to the locations in the program and its data where processing last occurred
Register contents States of various flags and switches
Pointers to the upper and lower bounds of the memory required for the process
A list of files opened by the process The priority of the process
The status of all IO devices needed bythe process
bullProcesses that are running often require an input from the user and whilst waiting is stopped ndashthis state is known as blocked or suspended
bullProblems can occur if the user tries to have too many processes functioning at the same time The operating system itself requires some CPU cycles to perform the saving and swapping of all the registers queues and stacks of the application processes
bullWhen too many processes are active the vast majority of its available CPU cycles are used to swap between processes rather than run processes ndashthrashing
bullOne way that operating-system designers reduce the chance of thrashing is by reducing the need for new processes to perform various tasks
bullSome operating systems allow for a process-lite called a thread that can deal with all the CPU-intensive work of a normal process but generally does not deal with the various types of IO and does not establish structures requiring the extensive process control block of a regular process
- Slide 1
- Slide 2
- Kernel Analogy to Chef Cooking a Dish
- Slide 4
- Slide 5
- System Calls
- Monolithic vs Microkernel Analogy
- Slide 8
- Slide 9
- Slide 10
- Slide 11
- Slide 12
-
bullKernels can be classified into three broad categoriesbullmonolithic kernelsbullmicrokernels1048766bullHybrid kernels
Monolithic kernels which have traditionally been used by Unix and Linux contain all the operating system core functions and the device drivers
A microkernel usually provides only minimal services such as defining memory address spaces interprocess communication (IPC) and process management All other functions such as hardware management are implemented as processes running independently of the kernel
Hybrid kernels are similar to microkernels except that they include additional code in kernel space so that such code can run more swiftly than it would were it in user space These kernels represent a compromise
System Calls
bull Applications and modules in user space
need to use system calls to communicate
ndash A system call analogy would be like having to use a phone via a switchboard to communicate with the person on the next desk
bull In a monolithic kernel every part of the kernel is located in the same address space ndash hence no system calls required
Monolithic vs Microkernel Analogy
Monolithic Kernel
bull A single piece of beef
Microkernel
bull Chop the above piece of beef into chunks
bull Put each chunk in a plastic bag (isolation)
bull Tie each bag together using pieces of string (IPC)
The total weight for the microkernel analogy will be
the weight of the beef plus the weight of bags and
string
So although the microkernel appears simple at a
local level it is much more complex at a global
level
The Monolithic Versus Micro Controversy
bullWith a monolithic kernel an error in the kernel can cause the entire system to crash
bullWith a microkernel if a kernel process crashes it is still possible to prevent a crash of the system as a whole by merely restarting the service that caused the error
bullHowever operating systems with monolithic kernels such as Linux have become extremely stable and can run for years without crashing
bullAnother disadvantage cited for monolithic kernels is that they are not portable that is they must be rewritten for each new architecture that the operating system is to be ported to However in practice this has not appeared to be a major disadvantage and it has not stopped Linux from being ported to numerous processors
bullMonolithic kernels also appear to have the disadvantage that their source code can become extremely large
bullHowever the advocates of monolithic kernels claim that in spite of their size such kernels are easier to design correctly
bullThe size of the compiled kernel is only a tiny fraction of that of the source code
bullContributing to the small size of the Linux kernel is its ability to dynamically load modules at runtime
bullLinux kernel can be made extremely small not only because of its ability to dynamically load modules but also because of its ease of customisationndasheg embedded linux
bullAlthough microkernels are very small by themselves in combination with all their required auxiliary code they are in fact often larger than monolithic kernels
bullThere are extremely few widely used operating systems today that utilise microkernels--mainly just AIX and QNX
Shells
bullThe shell is the outermost part of the operating system It is the part that interacts with the user
bullIn modern operating systems most users interact with the operating system through a Graphical User Interface(GUI)
bullThe basic unit of software that the operating system deals with in scheduling the work done by the processor is either a processor a thread depending on the operating system
bullA process is a program which is running ie the operating system has assigned the process memory it can use a stack priority status etc
bullThere are also numerous processes that run without giving you direct evidence that they ever exist For example Windows XP and UNIX can have dozens of background processes running to handle the network memory management disk management etc
bullThe operating system allows the application to begin running suspending the execution only long enough to deal with interrupts and user input
bullInterrupts are special signals sent by hardware or software to the CPU
bullSome interrupts are masked--that is the operating system will ignore the interrupts from some sources so that a particular job can be finished as quickly as possible
bullSome interrupts are so important that they cant be ignored These non-maskable interrupts(NMIs) must be dealt with immediately regardless of the other tasks at hand
bullMulti-tasking allows several processes to be active at one time by switching between them using timer interrupts
bullAll of the information needed to keep track of a process when switching is kept in a data package called a process control block The process control block(PCB) typically contains
An ID number that identifies the process
Pointers to the locations in the program and its data where processing last occurred
Register contents States of various flags and switches
Pointers to the upper and lower bounds of the memory required for the process
A list of files opened by the process The priority of the process
The status of all IO devices needed bythe process
bullProcesses that are running often require an input from the user and whilst waiting is stopped ndashthis state is known as blocked or suspended
bullProblems can occur if the user tries to have too many processes functioning at the same time The operating system itself requires some CPU cycles to perform the saving and swapping of all the registers queues and stacks of the application processes
bullWhen too many processes are active the vast majority of its available CPU cycles are used to swap between processes rather than run processes ndashthrashing
bullOne way that operating-system designers reduce the chance of thrashing is by reducing the need for new processes to perform various tasks
bullSome operating systems allow for a process-lite called a thread that can deal with all the CPU-intensive work of a normal process but generally does not deal with the various types of IO and does not establish structures requiring the extensive process control block of a regular process
- Slide 1
- Slide 2
- Kernel Analogy to Chef Cooking a Dish
- Slide 4
- Slide 5
- System Calls
- Monolithic vs Microkernel Analogy
- Slide 8
- Slide 9
- Slide 10
- Slide 11
- Slide 12
-
A microkernel usually provides only minimal services such as defining memory address spaces interprocess communication (IPC) and process management All other functions such as hardware management are implemented as processes running independently of the kernel
Hybrid kernels are similar to microkernels except that they include additional code in kernel space so that such code can run more swiftly than it would were it in user space These kernels represent a compromise
System Calls
bull Applications and modules in user space
need to use system calls to communicate
ndash A system call analogy would be like having to use a phone via a switchboard to communicate with the person on the next desk
bull In a monolithic kernel every part of the kernel is located in the same address space ndash hence no system calls required
Monolithic vs Microkernel Analogy
Monolithic Kernel
bull A single piece of beef
Microkernel
bull Chop the above piece of beef into chunks
bull Put each chunk in a plastic bag (isolation)
bull Tie each bag together using pieces of string (IPC)
The total weight for the microkernel analogy will be
the weight of the beef plus the weight of bags and
string
So although the microkernel appears simple at a
local level it is much more complex at a global
level
The Monolithic Versus Micro Controversy
bullWith a monolithic kernel an error in the kernel can cause the entire system to crash
bullWith a microkernel if a kernel process crashes it is still possible to prevent a crash of the system as a whole by merely restarting the service that caused the error
bullHowever operating systems with monolithic kernels such as Linux have become extremely stable and can run for years without crashing
bullAnother disadvantage cited for monolithic kernels is that they are not portable that is they must be rewritten for each new architecture that the operating system is to be ported to However in practice this has not appeared to be a major disadvantage and it has not stopped Linux from being ported to numerous processors
bullMonolithic kernels also appear to have the disadvantage that their source code can become extremely large
bullHowever the advocates of monolithic kernels claim that in spite of their size such kernels are easier to design correctly
bullThe size of the compiled kernel is only a tiny fraction of that of the source code
bullContributing to the small size of the Linux kernel is its ability to dynamically load modules at runtime
bullLinux kernel can be made extremely small not only because of its ability to dynamically load modules but also because of its ease of customisationndasheg embedded linux
bullAlthough microkernels are very small by themselves in combination with all their required auxiliary code they are in fact often larger than monolithic kernels
bullThere are extremely few widely used operating systems today that utilise microkernels--mainly just AIX and QNX
Shells
bullThe shell is the outermost part of the operating system It is the part that interacts with the user
bullIn modern operating systems most users interact with the operating system through a Graphical User Interface(GUI)
bullThe basic unit of software that the operating system deals with in scheduling the work done by the processor is either a processor a thread depending on the operating system
bullA process is a program which is running ie the operating system has assigned the process memory it can use a stack priority status etc
bullThere are also numerous processes that run without giving you direct evidence that they ever exist For example Windows XP and UNIX can have dozens of background processes running to handle the network memory management disk management etc
bullThe operating system allows the application to begin running suspending the execution only long enough to deal with interrupts and user input
bullInterrupts are special signals sent by hardware or software to the CPU
bullSome interrupts are masked--that is the operating system will ignore the interrupts from some sources so that a particular job can be finished as quickly as possible
bullSome interrupts are so important that they cant be ignored These non-maskable interrupts(NMIs) must be dealt with immediately regardless of the other tasks at hand
bullMulti-tasking allows several processes to be active at one time by switching between them using timer interrupts
bullAll of the information needed to keep track of a process when switching is kept in a data package called a process control block The process control block(PCB) typically contains
An ID number that identifies the process
Pointers to the locations in the program and its data where processing last occurred
Register contents States of various flags and switches
Pointers to the upper and lower bounds of the memory required for the process
A list of files opened by the process The priority of the process
The status of all IO devices needed bythe process
bullProcesses that are running often require an input from the user and whilst waiting is stopped ndashthis state is known as blocked or suspended
bullProblems can occur if the user tries to have too many processes functioning at the same time The operating system itself requires some CPU cycles to perform the saving and swapping of all the registers queues and stacks of the application processes
bullWhen too many processes are active the vast majority of its available CPU cycles are used to swap between processes rather than run processes ndashthrashing
bullOne way that operating-system designers reduce the chance of thrashing is by reducing the need for new processes to perform various tasks
bullSome operating systems allow for a process-lite called a thread that can deal with all the CPU-intensive work of a normal process but generally does not deal with the various types of IO and does not establish structures requiring the extensive process control block of a regular process
- Slide 1
- Slide 2
- Kernel Analogy to Chef Cooking a Dish
- Slide 4
- Slide 5
- System Calls
- Monolithic vs Microkernel Analogy
- Slide 8
- Slide 9
- Slide 10
- Slide 11
- Slide 12
-
System Calls
bull Applications and modules in user space
need to use system calls to communicate
ndash A system call analogy would be like having to use a phone via a switchboard to communicate with the person on the next desk
bull In a monolithic kernel every part of the kernel is located in the same address space ndash hence no system calls required
Monolithic vs Microkernel Analogy
Monolithic Kernel
bull A single piece of beef
Microkernel
bull Chop the above piece of beef into chunks
bull Put each chunk in a plastic bag (isolation)
bull Tie each bag together using pieces of string (IPC)
The total weight for the microkernel analogy will be
the weight of the beef plus the weight of bags and
string
So although the microkernel appears simple at a
local level it is much more complex at a global
level
The Monolithic Versus Micro Controversy
bullWith a monolithic kernel an error in the kernel can cause the entire system to crash
bullWith a microkernel if a kernel process crashes it is still possible to prevent a crash of the system as a whole by merely restarting the service that caused the error
bullHowever operating systems with monolithic kernels such as Linux have become extremely stable and can run for years without crashing
bullAnother disadvantage cited for monolithic kernels is that they are not portable that is they must be rewritten for each new architecture that the operating system is to be ported to However in practice this has not appeared to be a major disadvantage and it has not stopped Linux from being ported to numerous processors
bullMonolithic kernels also appear to have the disadvantage that their source code can become extremely large
bullHowever the advocates of monolithic kernels claim that in spite of their size such kernels are easier to design correctly
bullThe size of the compiled kernel is only a tiny fraction of that of the source code
bullContributing to the small size of the Linux kernel is its ability to dynamically load modules at runtime
bullLinux kernel can be made extremely small not only because of its ability to dynamically load modules but also because of its ease of customisationndasheg embedded linux
bullAlthough microkernels are very small by themselves in combination with all their required auxiliary code they are in fact often larger than monolithic kernels
bullThere are extremely few widely used operating systems today that utilise microkernels--mainly just AIX and QNX
Shells
bullThe shell is the outermost part of the operating system It is the part that interacts with the user
bullIn modern operating systems most users interact with the operating system through a Graphical User Interface(GUI)
bullThe basic unit of software that the operating system deals with in scheduling the work done by the processor is either a processor a thread depending on the operating system
bullA process is a program which is running ie the operating system has assigned the process memory it can use a stack priority status etc
bullThere are also numerous processes that run without giving you direct evidence that they ever exist For example Windows XP and UNIX can have dozens of background processes running to handle the network memory management disk management etc
bullThe operating system allows the application to begin running suspending the execution only long enough to deal with interrupts and user input
bullInterrupts are special signals sent by hardware or software to the CPU
bullSome interrupts are masked--that is the operating system will ignore the interrupts from some sources so that a particular job can be finished as quickly as possible
bullSome interrupts are so important that they cant be ignored These non-maskable interrupts(NMIs) must be dealt with immediately regardless of the other tasks at hand
bullMulti-tasking allows several processes to be active at one time by switching between them using timer interrupts
bullAll of the information needed to keep track of a process when switching is kept in a data package called a process control block The process control block(PCB) typically contains
An ID number that identifies the process
Pointers to the locations in the program and its data where processing last occurred
Register contents States of various flags and switches
Pointers to the upper and lower bounds of the memory required for the process
A list of files opened by the process The priority of the process
The status of all IO devices needed bythe process
bullProcesses that are running often require an input from the user and whilst waiting is stopped ndashthis state is known as blocked or suspended
bullProblems can occur if the user tries to have too many processes functioning at the same time The operating system itself requires some CPU cycles to perform the saving and swapping of all the registers queues and stacks of the application processes
bullWhen too many processes are active the vast majority of its available CPU cycles are used to swap between processes rather than run processes ndashthrashing
bullOne way that operating-system designers reduce the chance of thrashing is by reducing the need for new processes to perform various tasks
bullSome operating systems allow for a process-lite called a thread that can deal with all the CPU-intensive work of a normal process but generally does not deal with the various types of IO and does not establish structures requiring the extensive process control block of a regular process
- Slide 1
- Slide 2
- Kernel Analogy to Chef Cooking a Dish
- Slide 4
- Slide 5
- System Calls
- Monolithic vs Microkernel Analogy
- Slide 8
- Slide 9
- Slide 10
- Slide 11
- Slide 12
-
Monolithic vs Microkernel Analogy
Monolithic Kernel
bull A single piece of beef
Microkernel
bull Chop the above piece of beef into chunks
bull Put each chunk in a plastic bag (isolation)
bull Tie each bag together using pieces of string (IPC)
The total weight for the microkernel analogy will be
the weight of the beef plus the weight of bags and
string
So although the microkernel appears simple at a
local level it is much more complex at a global
level
The Monolithic Versus Micro Controversy
bullWith a monolithic kernel an error in the kernel can cause the entire system to crash
bullWith a microkernel if a kernel process crashes it is still possible to prevent a crash of the system as a whole by merely restarting the service that caused the error
bullHowever operating systems with monolithic kernels such as Linux have become extremely stable and can run for years without crashing
bullAnother disadvantage cited for monolithic kernels is that they are not portable that is they must be rewritten for each new architecture that the operating system is to be ported to However in practice this has not appeared to be a major disadvantage and it has not stopped Linux from being ported to numerous processors
bullMonolithic kernels also appear to have the disadvantage that their source code can become extremely large
bullHowever the advocates of monolithic kernels claim that in spite of their size such kernels are easier to design correctly
bullThe size of the compiled kernel is only a tiny fraction of that of the source code
bullContributing to the small size of the Linux kernel is its ability to dynamically load modules at runtime
bullLinux kernel can be made extremely small not only because of its ability to dynamically load modules but also because of its ease of customisationndasheg embedded linux
bullAlthough microkernels are very small by themselves in combination with all their required auxiliary code they are in fact often larger than monolithic kernels
bullThere are extremely few widely used operating systems today that utilise microkernels--mainly just AIX and QNX
Shells
bullThe shell is the outermost part of the operating system It is the part that interacts with the user
bullIn modern operating systems most users interact with the operating system through a Graphical User Interface(GUI)
bullThe basic unit of software that the operating system deals with in scheduling the work done by the processor is either a processor a thread depending on the operating system
bullA process is a program which is running ie the operating system has assigned the process memory it can use a stack priority status etc
bullThere are also numerous processes that run without giving you direct evidence that they ever exist For example Windows XP and UNIX can have dozens of background processes running to handle the network memory management disk management etc
bullThe operating system allows the application to begin running suspending the execution only long enough to deal with interrupts and user input
bullInterrupts are special signals sent by hardware or software to the CPU
bullSome interrupts are masked--that is the operating system will ignore the interrupts from some sources so that a particular job can be finished as quickly as possible
bullSome interrupts are so important that they cant be ignored These non-maskable interrupts(NMIs) must be dealt with immediately regardless of the other tasks at hand
bullMulti-tasking allows several processes to be active at one time by switching between them using timer interrupts
bullAll of the information needed to keep track of a process when switching is kept in a data package called a process control block The process control block(PCB) typically contains
An ID number that identifies the process
Pointers to the locations in the program and its data where processing last occurred
Register contents States of various flags and switches
Pointers to the upper and lower bounds of the memory required for the process
A list of files opened by the process The priority of the process
The status of all IO devices needed bythe process
bullProcesses that are running often require an input from the user and whilst waiting is stopped ndashthis state is known as blocked or suspended
bullProblems can occur if the user tries to have too many processes functioning at the same time The operating system itself requires some CPU cycles to perform the saving and swapping of all the registers queues and stacks of the application processes
bullWhen too many processes are active the vast majority of its available CPU cycles are used to swap between processes rather than run processes ndashthrashing
bullOne way that operating-system designers reduce the chance of thrashing is by reducing the need for new processes to perform various tasks
bullSome operating systems allow for a process-lite called a thread that can deal with all the CPU-intensive work of a normal process but generally does not deal with the various types of IO and does not establish structures requiring the extensive process control block of a regular process
- Slide 1
- Slide 2
- Kernel Analogy to Chef Cooking a Dish
- Slide 4
- Slide 5
- System Calls
- Monolithic vs Microkernel Analogy
- Slide 8
- Slide 9
- Slide 10
- Slide 11
- Slide 12
-
The Monolithic Versus Micro Controversy
bullWith a monolithic kernel an error in the kernel can cause the entire system to crash
bullWith a microkernel if a kernel process crashes it is still possible to prevent a crash of the system as a whole by merely restarting the service that caused the error
bullHowever operating systems with monolithic kernels such as Linux have become extremely stable and can run for years without crashing
bullAnother disadvantage cited for monolithic kernels is that they are not portable that is they must be rewritten for each new architecture that the operating system is to be ported to However in practice this has not appeared to be a major disadvantage and it has not stopped Linux from being ported to numerous processors
bullMonolithic kernels also appear to have the disadvantage that their source code can become extremely large
bullHowever the advocates of monolithic kernels claim that in spite of their size such kernels are easier to design correctly
bullThe size of the compiled kernel is only a tiny fraction of that of the source code
bullContributing to the small size of the Linux kernel is its ability to dynamically load modules at runtime
bullLinux kernel can be made extremely small not only because of its ability to dynamically load modules but also because of its ease of customisationndasheg embedded linux
bullAlthough microkernels are very small by themselves in combination with all their required auxiliary code they are in fact often larger than monolithic kernels
bullThere are extremely few widely used operating systems today that utilise microkernels--mainly just AIX and QNX
Shells
bullThe shell is the outermost part of the operating system It is the part that interacts with the user
bullIn modern operating systems most users interact with the operating system through a Graphical User Interface(GUI)
bullThe basic unit of software that the operating system deals with in scheduling the work done by the processor is either a processor a thread depending on the operating system
bullA process is a program which is running ie the operating system has assigned the process memory it can use a stack priority status etc
bullThere are also numerous processes that run without giving you direct evidence that they ever exist For example Windows XP and UNIX can have dozens of background processes running to handle the network memory management disk management etc
bullThe operating system allows the application to begin running suspending the execution only long enough to deal with interrupts and user input
bullInterrupts are special signals sent by hardware or software to the CPU
bullSome interrupts are masked--that is the operating system will ignore the interrupts from some sources so that a particular job can be finished as quickly as possible
bullSome interrupts are so important that they cant be ignored These non-maskable interrupts(NMIs) must be dealt with immediately regardless of the other tasks at hand
bullMulti-tasking allows several processes to be active at one time by switching between them using timer interrupts
bullAll of the information needed to keep track of a process when switching is kept in a data package called a process control block The process control block(PCB) typically contains
An ID number that identifies the process
Pointers to the locations in the program and its data where processing last occurred
Register contents States of various flags and switches
Pointers to the upper and lower bounds of the memory required for the process
A list of files opened by the process The priority of the process
The status of all IO devices needed bythe process
bullProcesses that are running often require an input from the user and whilst waiting is stopped ndashthis state is known as blocked or suspended
bullProblems can occur if the user tries to have too many processes functioning at the same time The operating system itself requires some CPU cycles to perform the saving and swapping of all the registers queues and stacks of the application processes
bullWhen too many processes are active the vast majority of its available CPU cycles are used to swap between processes rather than run processes ndashthrashing
bullOne way that operating-system designers reduce the chance of thrashing is by reducing the need for new processes to perform various tasks
bullSome operating systems allow for a process-lite called a thread that can deal with all the CPU-intensive work of a normal process but generally does not deal with the various types of IO and does not establish structures requiring the extensive process control block of a regular process
- Slide 1
- Slide 2
- Kernel Analogy to Chef Cooking a Dish
- Slide 4
- Slide 5
- System Calls
- Monolithic vs Microkernel Analogy
- Slide 8
- Slide 9
- Slide 10
- Slide 11
- Slide 12
-
bullHowever the advocates of monolithic kernels claim that in spite of their size such kernels are easier to design correctly
bullThe size of the compiled kernel is only a tiny fraction of that of the source code
bullContributing to the small size of the Linux kernel is its ability to dynamically load modules at runtime
bullLinux kernel can be made extremely small not only because of its ability to dynamically load modules but also because of its ease of customisationndasheg embedded linux
bullAlthough microkernels are very small by themselves in combination with all their required auxiliary code they are in fact often larger than monolithic kernels
bullThere are extremely few widely used operating systems today that utilise microkernels--mainly just AIX and QNX
Shells
bullThe shell is the outermost part of the operating system It is the part that interacts with the user
bullIn modern operating systems most users interact with the operating system through a Graphical User Interface(GUI)
bullThe basic unit of software that the operating system deals with in scheduling the work done by the processor is either a processor a thread depending on the operating system
bullA process is a program which is running ie the operating system has assigned the process memory it can use a stack priority status etc
bullThere are also numerous processes that run without giving you direct evidence that they ever exist For example Windows XP and UNIX can have dozens of background processes running to handle the network memory management disk management etc
bullThe operating system allows the application to begin running suspending the execution only long enough to deal with interrupts and user input
bullInterrupts are special signals sent by hardware or software to the CPU
bullSome interrupts are masked--that is the operating system will ignore the interrupts from some sources so that a particular job can be finished as quickly as possible
bullSome interrupts are so important that they cant be ignored These non-maskable interrupts(NMIs) must be dealt with immediately regardless of the other tasks at hand
bullMulti-tasking allows several processes to be active at one time by switching between them using timer interrupts
bullAll of the information needed to keep track of a process when switching is kept in a data package called a process control block The process control block(PCB) typically contains
An ID number that identifies the process
Pointers to the locations in the program and its data where processing last occurred
Register contents States of various flags and switches
Pointers to the upper and lower bounds of the memory required for the process
A list of files opened by the process The priority of the process
The status of all IO devices needed bythe process
bullProcesses that are running often require an input from the user and whilst waiting is stopped ndashthis state is known as blocked or suspended
bullProblems can occur if the user tries to have too many processes functioning at the same time The operating system itself requires some CPU cycles to perform the saving and swapping of all the registers queues and stacks of the application processes
bullWhen too many processes are active the vast majority of its available CPU cycles are used to swap between processes rather than run processes ndashthrashing
bullOne way that operating-system designers reduce the chance of thrashing is by reducing the need for new processes to perform various tasks
bullSome operating systems allow for a process-lite called a thread that can deal with all the CPU-intensive work of a normal process but generally does not deal with the various types of IO and does not establish structures requiring the extensive process control block of a regular process
- Slide 1
- Slide 2
- Kernel Analogy to Chef Cooking a Dish
- Slide 4
- Slide 5
- System Calls
- Monolithic vs Microkernel Analogy
- Slide 8
- Slide 9
- Slide 10
- Slide 11
- Slide 12
-
Shells
bullThe shell is the outermost part of the operating system It is the part that interacts with the user
bullIn modern operating systems most users interact with the operating system through a Graphical User Interface(GUI)
bullThe basic unit of software that the operating system deals with in scheduling the work done by the processor is either a processor a thread depending on the operating system
bullA process is a program which is running ie the operating system has assigned the process memory it can use a stack priority status etc
bullThere are also numerous processes that run without giving you direct evidence that they ever exist For example Windows XP and UNIX can have dozens of background processes running to handle the network memory management disk management etc
bullThe operating system allows the application to begin running suspending the execution only long enough to deal with interrupts and user input
bullInterrupts are special signals sent by hardware or software to the CPU
bullSome interrupts are masked--that is the operating system will ignore the interrupts from some sources so that a particular job can be finished as quickly as possible
bullSome interrupts are so important that they cant be ignored These non-maskable interrupts(NMIs) must be dealt with immediately regardless of the other tasks at hand
bullMulti-tasking allows several processes to be active at one time by switching between them using timer interrupts
bullAll of the information needed to keep track of a process when switching is kept in a data package called a process control block The process control block(PCB) typically contains
An ID number that identifies the process
Pointers to the locations in the program and its data where processing last occurred
Register contents States of various flags and switches
Pointers to the upper and lower bounds of the memory required for the process
A list of files opened by the process The priority of the process
The status of all IO devices needed bythe process
bullProcesses that are running often require an input from the user and whilst waiting is stopped ndashthis state is known as blocked or suspended
bullProblems can occur if the user tries to have too many processes functioning at the same time The operating system itself requires some CPU cycles to perform the saving and swapping of all the registers queues and stacks of the application processes
bullWhen too many processes are active the vast majority of its available CPU cycles are used to swap between processes rather than run processes ndashthrashing
bullOne way that operating-system designers reduce the chance of thrashing is by reducing the need for new processes to perform various tasks
bullSome operating systems allow for a process-lite called a thread that can deal with all the CPU-intensive work of a normal process but generally does not deal with the various types of IO and does not establish structures requiring the extensive process control block of a regular process
- Slide 1
- Slide 2
- Kernel Analogy to Chef Cooking a Dish
- Slide 4
- Slide 5
- System Calls
- Monolithic vs Microkernel Analogy
- Slide 8
- Slide 9
- Slide 10
- Slide 11
- Slide 12
-
bullSome interrupts are so important that they cant be ignored These non-maskable interrupts(NMIs) must be dealt with immediately regardless of the other tasks at hand
bullMulti-tasking allows several processes to be active at one time by switching between them using timer interrupts
bullAll of the information needed to keep track of a process when switching is kept in a data package called a process control block The process control block(PCB) typically contains
An ID number that identifies the process
Pointers to the locations in the program and its data where processing last occurred
Register contents States of various flags and switches
Pointers to the upper and lower bounds of the memory required for the process
A list of files opened by the process The priority of the process
The status of all IO devices needed bythe process
bullProcesses that are running often require an input from the user and whilst waiting is stopped ndashthis state is known as blocked or suspended
bullProblems can occur if the user tries to have too many processes functioning at the same time The operating system itself requires some CPU cycles to perform the saving and swapping of all the registers queues and stacks of the application processes
bullWhen too many processes are active the vast majority of its available CPU cycles are used to swap between processes rather than run processes ndashthrashing
bullOne way that operating-system designers reduce the chance of thrashing is by reducing the need for new processes to perform various tasks
bullSome operating systems allow for a process-lite called a thread that can deal with all the CPU-intensive work of a normal process but generally does not deal with the various types of IO and does not establish structures requiring the extensive process control block of a regular process
- Slide 1
- Slide 2
- Kernel Analogy to Chef Cooking a Dish
- Slide 4
- Slide 5
- System Calls
- Monolithic vs Microkernel Analogy
- Slide 8
- Slide 9
- Slide 10
- Slide 11
- Slide 12
-
bullProcesses that are running often require an input from the user and whilst waiting is stopped ndashthis state is known as blocked or suspended
bullProblems can occur if the user tries to have too many processes functioning at the same time The operating system itself requires some CPU cycles to perform the saving and swapping of all the registers queues and stacks of the application processes
bullWhen too many processes are active the vast majority of its available CPU cycles are used to swap between processes rather than run processes ndashthrashing
bullOne way that operating-system designers reduce the chance of thrashing is by reducing the need for new processes to perform various tasks
bullSome operating systems allow for a process-lite called a thread that can deal with all the CPU-intensive work of a normal process but generally does not deal with the various types of IO and does not establish structures requiring the extensive process control block of a regular process
- Slide 1
- Slide 2
- Kernel Analogy to Chef Cooking a Dish
- Slide 4
- Slide 5
- System Calls
- Monolithic vs Microkernel Analogy
- Slide 8
- Slide 9
- Slide 10
- Slide 11
- Slide 12
-