Linux Kernel introduction COSC 513 Xiaoping Yang.

Slides:



Advertisements
Similar presentations
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Advertisements

EEE 435 Principles of Operating Systems Operating System Concepts (Modern Operating Systems 1.5)
Review: Chapters 1 – Chapter 1: OS is a layer between user and hardware to make life easier for user and use hardware efficiently Control program.
Chapter 5 Processes and Threads Copyright © 2008.
Process Description and Control
Page 1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
Introduction to Operating Systems – Windows process and thread management In this lecture we will cover Threads and processes in Windows Thread priority.
Ceng Operating Systems Chapter 2.1 : Processes Process concept Process scheduling Interprocess communication Deadlocks Threads.
CS-502 Fall 2006Processes in Unix, Linux, & Windows 1 Processes in Unix, Linux, and Windows CS502 Operating Systems.
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
Introduction Operating Systems’ Concepts and Structure Lecture 1 ~ Spring, 2008 ~ Spring, 2008TUCN. Operating Systems. Lecture 1.
Process Description and Control A process is sometimes called a task, it is a program in execution.
Processes in Unix, Linux, and Windows CS-502 Fall Processes in Unix, Linux, and Windows CS502 Operating Systems (Slides include materials from Operating.
Chapter 51 Threads Chapter 5. 2 Process Characteristics  Concept of Process has two facets.  A Process is: A Unit of resource ownership:  a virtual.
Process Description and Control Chapter 3. Major Requirements of an OS Interleave the execution of several processes to maximize processor utilization.
Operating System A program that controls the execution of application programs An interface between applications and hardware 1.
Process Management. Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication.
Implementing Processes and Process Management Brian Bershad.
Chapter 41 Processes Chapter 4. 2 Processes  Multiprogramming operating systems are built around the concept of process (also called task).  A process.
What is an Operating System? The OS is a program – Permit easy access, control hardware, communicate between user and software, user and hardware, software.
Processes and Threads CS550 Operating Systems. Processes and Threads These exist only at execution time They have fast state changes -> in memory and.
Operating Systems CMPSC 473 Processes (4) September Lecture 10 Instructor: Bhuvan Urgaonkar.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
CE Operating Systems Lecture 11 Windows – Object manager and process management.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
1 Chapter 2.1 : Processes Process concept Process concept Process scheduling Process scheduling Interprocess communication Interprocess communication Threads.
REVIEW OF COMMONLY USED DATA STRUCTURES IN OS. NEEDS FOR EFFICIENT DATA STRUCTURE Storage complexity & Computation complexity matter Consider the problem.
Multiprogramming. Readings r Silberschatz, Galvin, Gagne, “Operating System Concepts”, 8 th edition: Chapter 3.1, 3.2.
Threads G.Anuradha (Reference : William Stallings)
Chapter 2 Processes Processes Topics Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication.
Chapter 2 Processes and Threads Introduction 2.2 Processes A Process is the execution of a Program More specifically… – A process is a program.
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
4300 Lines Added 1800 Lines Removed 1500 Lines Modified PER DAY DURING SUSE Lab.
1 Unix Architecture. 2 Operating Systems Concepts 1. Process 2. Memory management 3. Information protection & security 4. Scheduling and resource management.
OBJECTIVE: To learn about the various system calls. To perform the various CPU scheduling algorithms. To understand the concept of memory management schemes.
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
Process Description and Control Chapter 3. Source Modified slides from Missouri U. of Science and Tech.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
What is an Operating System? Various systems and their pros and cons –E.g. multi-tasking vs. Batch OS definitions –Resource allocator –Control program.
1 Process Description and Control Chapter 3. 2 Process A program in execution An instance of a program running on a computer The entity that can be assigned.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 2: The Linux System Part 3.
What is a Process ? A program in execution.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 3: Processes Process Concept Process Scheduling Operations.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
Advanced Operating Systems CS6025 Spring 2016 Processes and Threads (Chapter 2)
Multiprogramming. Readings r Chapter 2.1 of the textbook.
Introduction to Operating Systems Concepts
Processes and threads.
OPERATING SYSTEMS CS3502 Fall 2017
Chapter 3: Processes Source & Copyright: Operating System Concepts, Silberschatz, Galvin and Gagne.
Structure of Processes
CS 143A Quiz 1 Solution.
Mid Term review CSC345.
Chapter 2: The Linux System Part 3
Process Description and Control
Process Description and Control
Process Description and Control
Processes and Process Management
Process Control B.Ramamurthy 2/22/2019 B.Ramamurthy.
Process Description and Control
Process Description and Control
Process Description and Control
Process Description and Control
Interrupt handling Explain how interrupts are used to obtain processor time and how processing of interrupted jobs may later be resumed, (typical.
Chapter 3: Processes.
Unix Process Control B.Ramamurthy 4/11/2019 B.Ramamurthy.
Processes in Unix and Windows
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
Linux Process State Scheduling information Identifiers
Presentation transcript:

Linux Kernel introduction COSC 513 Xiaoping Yang

What is Linux  A clone of Unix operating system  Provides for the efficient management of system resources:  Linux is almost a freeware  First developed for 32-bit x86-based PCs (386 or higher).  Three major components:  Kernel  Shell Environment  File structure

What is the Linux Kernel?  The Heart of the Linux Operating System  Provides for the efficient management of system resources:  CPU  Interprocess Communication  Memory  Devices:  Disks  Terminals  Networks  Printers

What inside Linux Kernel Linux kernel Kernel contains:  System Call interface  Memory Manager  File System  Network support Linux Kernel is a monolithic kernel

Linux Processes and Tasks Linux Process = Executing Program Linux Task is a generalization of a Thread  Single threaded process is represented as a task  Multi-threaded process is multiple tasks  Only visible to the programmer and the kernel. The Scheduler decides which task(s) gets to use the CPU(s)Scheduler

Linux Scheduler  Multi-level queue scheduler  Three queues SCHED_FIFO - standard priority.  Highest priority.  No time-slice  "supervisor" processes only SCHED_RR - priority round robin.  Highest priority RR runs for 1 time slice.  "supervisor" processes only SCHED_OTHER - time-sharing  All Linux user processes

Process Tree  There is a tree like relationship among processes: Given the following: $ netscape & $ emacs & $ xfig &  bash is the parent process  netscape, emacs and xfig are children of bash and are siblings  netscape is the oldest sibling  xfig is the youngest sibling  Linux stores this structure as linked lists  Linux will show you the tree (using ps f )

Process Tree (cont.)

Task Tree For every task the kernel maintains a task_struct task_struct contains all relevant information about a task.  General:  PID,Program name  Parent, youngest child, next sibling, previous sibling  Process Times ( start_time, utime, stime, cutime, cstime)  Scheduling algorithm, priority, nice value, errno  Process state  Owner:  UID  GID

Task tree (Cont.)  Files:  Information on all files opened by the process.  Stored in the fs_struct sub-structure fs_struct  Memory:  Information about the memory used by a process.memory  IPC / Synchronization:  Pointers to acquired Semaphores  Bitmask of received Signals and associated Signal handlersSignals  Some other stuff... Linux stores all task_structs in a doubly linked list.

Linux Process State

Interrupts and System Calls  An interrupt is a request from the hardware for immediate attention.  Two types of interrupts in Linux:  Fast Interrupts Fast Interrupts  Suspend current task, process interrupt, resume task  All other interrupts are generally disabled  Keyboard interrupt  Mouse interrupt

 Slow Interrupts Slow Interrupts  All registers are saved.  Only interrupts of same type are disabled.  Scheduler is called when ISR exits.  Timer interrupt  Disk Drive interrupt  System calls Interrupts and System Calls (cont.)

 Suspend current task  Save CPU registers that might be altered  Switch CPU to kernel (system/supervisor/etc...) mode  Block all interrupts  Call Interrupt Service Routine (ISR)  Unblock interrupts  Switch CPU to user mode  Resume suspended task  Restore saved CPU Registers Fast Interrupts in Linux

END