How & When The Kernel Runs David Ferry, Chris Gill Department of Computer Science and Engineering Washington University, St. Louis MO

Slides:



Advertisements
Similar presentations
More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Advertisements

1 CS345 Operating Systems Φροντιστήριο Άσκησης 1.
Startup. Major phases  BIOS  MBR program  Boot loader (Partition boot program )  OS’s kernel Loader  CPU always starts running at x’FFFF0’=1,048,560.
Chapter 6 Limited Direct Execution
1 OS Structure, Processes & Process Management. 2 Recap OS functions  Coordinator  Protection  Communication  Resource management  Service provider.
CSC 501 Lecture 2: Processes. Von Neumann Model Both program and data reside in memory Execution stages in CPU: Fetch instruction Decode instruction Execute.
OS Fall ’ 02 Introduction Operating Systems Fall 2002.
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
Slide 6-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 6 Threads and Scheduling 6.
OS Spring’03 Introduction Operating Systems Spring 2003.
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
Operating Systems Lecture # 3. Recap Hardware Operating System Application System Call Trap Hardware Trap Processor.
Computer System Structures memory memory controller disk controller disk controller printer controller printer controller tape-drive controller tape-drive.
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
OS Spring’04 Introduction Operating Systems Spring 2004.
CSE 451: Operating Systems Autumn 2013 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
1 CS503: Operating Systems Part 1: OS Interface Dongyan Xu Department of Computer Science Purdue University.
Scheduling Basic scheduling policies, for OS schedulers (threads, tasks, processes) or thread library schedulers Review of Context Switching overheads.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Tami Meredith, Ph.D. CSCI  Devices need CPU access  E.g., NIC has a full buffer it needs to empty  These device needs are often asynchronous.
Background: Operating Systems Brad Karp UCL Computer Science CS GZ03 / M th November, 2008.
NT Kernel CS Spring Overview Interrupts and Exceptions: Trap Handler Interrupt Request Levels and IRT DPC’s, and APC’s System Service Dispatching.
Interrupt driven I/O. MIPS RISC Exception Mechanism The processor operates in The processor operates in user mode user mode kernel mode kernel mode Access.
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.
4300 Lines Added 1800 Lines Removed 1500 Lines Modified PER DAY DURING SUSE Lab.
Concurrency, Processes, and System calls Benefits and issues of concurrency The basic concept of process System calls.
1 A Seven-State Process Model. 2 CPU Switch From Process to Process Silberschatz, Galvin, and Gagne  1999.
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
OSes: 2. Structs 1 Operating Systems v Objective –to give a (selective) overview of computer system architectures Certificate Program in Software Development.
OS part I, , Part I Computer System Structures Department of Computer Engineering, PSUWannarat Suntiamorntut.
Managing Processors Jeff Chase Duke University. The story so far: protected CPU mode user mode kernel mode kernel “top half” kernel “bottom half” (interrupt.
Time Sources and Timing David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO
Kernel Structure and Infrastructure David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO
E81 CSE 532S: Advanced Multi-Paradigm Software Development Chris Gill Department of Computer Science and Engineering Washington University in St. Louis.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
Linux Boot Process on the Raspberry Pi 2 1 David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis,
Chapter 3 RTOS Concepts And Definitions Department of Computer Science Hsu Hao Chen Professor Hsung-Pin Chang.
Interrupts and Interrupt Handling David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO
Kernel Tracing David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO
Processes David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO
Threads prepared and instructed by Shmuel Wimer Eng. Faculty, Bar-Ilan University 1July 2016Processes.
Kernel Synchronization David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO
WORKING OF SCHEDULER IN OS
Introduction to Operating Systems Concepts
Introduction to Operating Systems
How & When The Kernel Runs
Midterm Review Chris Gill CSE 422S - Operating Systems Organization
OPERATING SYSTEMS CS3502 Fall 2017
Midterm Review David Ferry, Chris Gill
Protection of System Resources
Kernel Tracing David Ferry, Chris Gill
Processes David Ferry, Chris Gill
Time Sources and Timing
Semester Review Chris Gill CSE 422S - Operating Systems Organization
Interrupts and Interrupt Handling
Structure of Processes
CSE 451: Operating Systems Spring 2012 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
System Calls David Ferry CSCI 3500 – Operating Systems
Top Half / Bottom Half Processing
EE 472 – Embedded Systems Dr. Shwetak Patel.
Process Control B.Ramamurthy 2/22/2019 B.Ramamurthy.
Kernel Synchronization I
Midterm Review Brian Kocoloski
How & When The Kernel Runs
Processes David Ferry CSCI 3500 – Operating Systems
Unix Process Control B.Ramamurthy 4/11/2019 B.Ramamurthy.
Kernel Tracing David Ferry, Chris Gill, Brian Kocoloski
Process Description and Control in Unix
Interrupts and Interrupt Handling
Processes David Ferry, Chris Gill, Brian Kocoloski
Presentation transcript:

How & When The Kernel Runs David Ferry, Chris Gill Department of Computer Science and Engineering Washington University, St. Louis MO 1CSE 522S – Advanced Operating Systems

Traditional View of Process Execution However, the kernel is not traditional! CreationReadyRunning Waiting Terminate Blocked Preempted Scheduled Unblocked 2CSE 522S – Advanced Operating Systems

Kernel Execution: Boot System Boot Initialize System Idle Task (pid 0) Creates Init, which creates all other threads ksoftirq Init (pid 1) migration The kernel only runs deterministically at boot time. Otherwise, the kernel is entirely event driven. Power On Bootloader loads kernel Initial kernel never returns 3CSE 522S – Advanced Operating Systems Kernel threads are scheduled as any other process. Kernel entry point: start_kernel() in /init/main.c

Kernel Execution: Threads Kernel threads perform background operations, e.g. – [ksoftirq] does delayed interrupt handling – [migrate] does inter-processor load balancing – [kworker] handles misc. tasks Kernel threads are almost just like user threads: – are scheduled – can be preempted – runs in kernel context – has no process memory space CSE 522S – Advanced Operating Systems4

Kernel Execution: Event Driven Runs in syscall context Interrupt Handler Runs in interrupt context 5CSE 522S – Advanced Operating Systems Software/hardware Interrupt arrives Returns control Hardware interrupt Software interrupt Returns control Interrupt context is unpreemptible Syscall context is preemptible (though may disable preemption) Return path may return control to kernel, userspace, or call schedule() Kernel preemption

System Calls The syscall interface is a single integer 1.User loads syscall number into register 2.May load syscall arguments into other registers 3.Executes syscall trap (software exception) 4.Trap is caught by the kernel 5.Puts arguments on kernel stack (asmlinkage) 6.Kernel looks up syscall number in the interrupt vector 7.Jumps to syscall routine specified in interrupt table CSE 522S – Advanced Operating Systems6

System Calls on ARM The syscall interface is a single integer 1.User loads syscall number into register R7 2.May load syscall arguments into R0-R6 3.Executes SWI instruction(software exception) 4.Trap is caught by the kernel 5.Control jumps to function vector_swi() in arch/arm/kernel/entry-common.S 6.Control eventually jumps to a C function inside the kernel CSE 522S – Advanced Operating Systems7

Class Notes Please do studios in groups of 2 or 3 Meet in Urbauer 115 next time CSE 522S – Advanced Operating Systems8