Kernels & Processes The Structure of the Operating System

Similar documents
Lecture Topics. Announcements. Today: Operating System Overview (Stallings, chapter , ) Next: Processes (Stallings, chapter

Sistemi in Tempo Reale

Processes. Johan Montelius KTH

A process. the stack

Computer Labs The Minix 3 Operating System

CS 111. Operating Systems Peter Reiher

Lecture 4: Memory Management & The Programming Interface

OS lpr. www. nfsd gcc emacs ls 1/27/09. Process Management. CS 537 Lecture 3: Processes. Example OS in operation. Why Processes? Simplicity + Speed

by Marina Cholakyan, Hyduke Noshadi, Sepehr Sahba and Young Cha

OS lpr. www. nfsd gcc emacs ls 9/18/11. Process Management. CS 537 Lecture 4: Processes. The Process. Why Processes? Simplicity + Speed

CS 111. Operating Systems Peter Reiher

518 Lecture Notes Week 3

Introduction to OS Processes in Unix, Linux, and Windows MOS 2.1 Mahmoud El-Gayyar

CS 322 Operating Systems Practice Midterm Questions

CSE 153 Design of Operating Systems

Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras

www nfsd emacs lpr Process Management CS 537 Lecture 4: Processes Example OS in operation Why Processes? Simplicity + Speed

CS24: INTRODUCTION TO COMPUTING SYSTEMS. Spring 2015 Lecture 25

CSE 451: Operating Systems Winter Module 4 Processes. Mark Zbikowski Allen Center 476

4 Lecture: Operating System Structures

Process management. What s in a process? What is a process? The OS s process namespace. A process s address space (idealized)

CS 31: Intro to Systems Operating Systems Overview. Kevin Webb Swarthmore College November 8, 2018

Threads. CS-3013 Operating Systems Hugh C. Lauer. CS-3013, C-Term 2012 Threads 1

CSE 303: Concepts and Tools for Software Development

Classic Systems: Unix and THE. Presented by Hakim Weatherspoon

ELEC 377 Operating Systems. Week 1 Class 2

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

The Operating System Machine Level

CS 31: Intro to Systems Operating Systems Overview. Kevin Webb Swarthmore College March 31, 2015

Hardware OS & OS- Application interface

Introduction. CS3026 Operating Systems Lecture 01

csci3411: Operating Systems

CSE 153 Design of Operating Systems Fall 2018

Operating Systems. Spring Dongkun Shin, SKKU

Computer Labs: Processes

Operating System. Operating System Overview. Structure of a Computer System. Structure of a Computer System. Structure of a Computer System

The Life and Death of A Process

Process. Heechul Yun. Disclaimer: some slides are adopted from the book authors slides with permission

CS 31: Intro to Systems Pointers and Memory. Martin Gagne Swarthmore College February 16, 2016

OS Structure. Kevin Webb Swarthmore College January 25, Relevant xkcd:

The Process Abstraction. CMPU 334 Operating Systems Jason Waterman

CSCI 2132 Software Development. Lecture 2: Introduction to UNIX and Unix-like Operating Systems

ECE 550D Fundamentals of Computer Systems and Engineering. Fall 2017

The Kernel Abstraction. Chapter 2 OSPP Part I

CS 550 Operating Systems Spring Process II

Design Overview of the FreeBSD Kernel CIS 657

Design Overview of the FreeBSD Kernel. Organization of the Kernel. What Code is Machine Independent?

W4118: OS Overview. Junfeng Yang

Protection and System Calls. Otto J. Anshus

Operating Systems (2INC0) 2018/19. Introduction (01) Dr. Tanir Ozcelebi. Courtesy of Prof. Dr. Johan Lukkien. System Architecture and Networking Group

Lecture Topics. Announcements. Today: Threads (Stallings, chapter , 4.6) Next: Concurrency (Stallings, chapter , 5.

CS 261 Fall C Introduction. Variables, Memory Model, Pointers, and Debugging. Mike Lam, Professor

unsigned char memory[] STACK ¼ 0x xC of address space globals function KERNEL code local variables

Mon Sep 17, 2007 Lecture 3: Process Management

Processes. OS Structure. OS Structure. Modes of Execution. Typical Functions of an OS Kernel. Non-Kernel OS. COMP755 Advanced Operating Systems

Slide 6-1. Processes. Operating Systems: A Modern Perspective, Chapter 6. Copyright 2004 Pearson Education, Inc.

Last time: introduction. Networks and Operating Systems ( ) Chapter 2: Processes. This time. General OS structure. The kernel is a program!

W4118 Operating Systems. Junfeng Yang

Operating Systems. Fall Dongkun Shin, SKKU

Lecture 3: O/S Organization. plan: O/S organization processes isolation

Process. Heechul Yun. Disclaimer: some slides are adopted from the book authors slides with permission 1

Unix API Books. Linux Kernel Books. Assignments and Exams. Grading for CSC 256. Operating Systems 8/31/2018. CSC 256/456 Fall

CS 153 Design of Operating Systems

Operating System Structure

CS 326: Operating Systems. Process Execution. Lecture 5

Networks and Operating Systems Chapter 11: Introduction to Operating Systems

CSE 333 Lecture 2 - arrays, memory, pointers

Definition: An operating system is the software that manages resources

Templates what and why? Beware copying classes! Templates. A simple example:

What is a Process. Processes. Programs and Processes. System Classification 3/5/2013. Process: An execution stream and its associated state

CPS221 Lecture: Operating System Functions

15 Sharing Main Memory Segmentation and Paging

Programs in memory. The layout of memory is roughly:

16 Sharing Main Memory Segmentation and Paging

Operating System Structure

Lecture 4: Process Management

Computer Systems II. First Two Major Computer System Evolution Steps

TCSS 422: OPERATING SYSTEMS

EECS 3221 Operating System Fundamentals

EECS 3221 Operating System Fundamentals

Processes. CS439: Principles of Computer Systems January 24, 2018

CSE506: Operating Systems CSE 506: Operating Systems

628 Lecture Notes Week 4

C Introduction. Comparison w/ Java, Memory Model, and Pointers

CS 5460/6460 Operating Systems

Processes. Process Management Chapter 3. When does a process gets created? When does a process gets terminated?

Process Time. Steven M. Bellovin January 25,

Processes. CS439: Principles of Computer Systems January 30, 2019

The Operating System. Chapter 6

4. The Abstraction: The Process

Underlying computer system = hardware + software

CS420: Operating Systems

PROCESS VIRTUAL MEMORY PART 2. CS124 Operating Systems Winter , Lecture 19

Introduction to Operating Systems

Exceptions and Processes

The Operating System Machine Level

CSE 333 Lecture 9 - storage

Processes and Exceptions

CSE 410: Computer Systems Spring Processes. John Zahorjan Allen Center 534

When we start? 10/24/2013 Operating Systems, Beykent University 1

Transcription:

COMP 111: Operating Systems (Fall 2013) Kernels & Processes The Structure of the Operating System Noah Mendelsohn Tufts University Email: noah@cs.tufts.edu Web: http://www.cs.tufts.edu/~noah Based on a presentation by Professor Alva Couch Copyright 2013 Noah Mendelsohn

Today The Big Picture: How the OS is organized How good OS services are designed Process: the most important OS abstraction How the OS interacts with processes How processes use memory Next lecture: how processes are born, how they die, and how to control them while they re running 2

Today The Big Picture: How the OS is organized How good OS services are designed Process: the most important OS abstraction How the OS interacts with processes How processes use memory 3

Why do we need an OS anyway? (brief review) 4

Operating systems do two things for us: They make the computer easier to use The facilitate sharing of the computer by multiple programs and users Interestingly, some of the same abstractions that make things more convenient for one program are just what we need for sharing too. 5

actually, Unix & Linux have one more goal: To facilitate running the same program (and OS!) on different types of computer and guess what, those same abstractions are designed to help with that too! 6

Why have an operating system?

Why have an operating system? This computer is doing lots of things at once. We need to: Give each program a useful environment Give each program an isolated environment Protect the programs from each other Let some programs (browser) control others (flash plugin) Let the programs access & share system resources

Sharing the Computer 9

Sharing Memory All programs share memory Multiple Programs Running at once Angry Birds Play Video Browser OPERATING SYSTEM MAIN MEMORY CPU

Sharing the CPU Multiple Programs Running at once CPU is shared can only do one thing at a time* Angry Birds Play Video Browser OPERATING SYSTEM MAIN MEMORY CPU *Actually, modern CPUs can do a few things at a time, but for now assume a simple, traditional computer

Sharing Memory Multiple Programs Running at once Angry Birds Play Video Browser OPERATING SYSTEM MAIN MEMORY CPU

Protecting the OS Kernel 13

The protected OS Kernel Multiple Programs Running at once The operating system is a special, privileged program, with its own code and data. We call the protected, shared part of the OS the kernel. MAIN MEMORY Angry Birds Play Video Browser OPERATING SYSTEM KERNEL CPU

We need help from the hardware to protect the kernel! The hardware has memory mapping features that the OS can use to: Hide the kernel from other programs Hide programs from each other Convince each program it s got its own private memory starting at address zero MAIN MEMORY Angry Birds Play Video Browser OPERATING SYSTEM KERNEL CPU

We need help from the hardware to protect the kernel! The hardware has memory mapping features that the OS can use to: Hide the kernel from other programs Hide programs from each other Convince each program it s got its own private memory starting at address zero Q. What do you mean by Mapping Features? A. The kernel can tell the hardware to renumber blocks of memory to rearrange it and to hide blocks Angry the Birds program Play shouldn t Video see. Browser MAIN MEMORY OPERATING SYSTEM KERNEL CPU

We need help from the hardware to protect the kernel! The hardware has memory mapping features that the OS can use to: Hide the kernel from other programs Hide programs from each other Convince each program it s got its own private memory starting at address zero Q. What do you mean by Mapping Features? A. The kernel can tell the hardware to renumber blocks of memory to rearrange it and to hide blocks Angry the Birds program Play shouldn t Video see. Browser MAIN MEMORY Each program gets its own virtual memory. OPERATING SYSTEM KERNEL CPU

We need help from the hardware to protect the kernel! The hardware has memory mapping features that the OS can use to: Hide the kernel from other programs Hide programs from each other Convince each program it s got its own private memory starting at address zero Q. What do you mean by Mapping Features? A. The kernel can tell the hardware to renumber blocks of memory to rearrange it and to hide blocks Angry the Birds program Play shouldn t Video see. Browser MAIN MEMORY Each program gets its own virtual memory. OPERATING SYSTEM KERNEL Usually: the kernel memory is not mapped into the program s space. CPU

We need help from the hardware to protect the kernel! The hardware has memory mapping features that the OS can use to: Hide the kernel from other programs Hide programs from each other Convince each program it s got its own private memory starting at address zero Different computers do this differently (e.g. segments vs. paging) but all except the smallest embedded ones do it MAIN MEMORY Angry Birds Play Video Browser OPERATING SYSTEM KERNEL CPU

Privileged instructions only the OS can use The hardware has special instructions that only the kernel can use to: * Initiate I/O * Set clocks and timers * Control memory mapping The Kernel runs in privileged or kernel or supervisor Angry state. Birds Play Video Browser MAIN MEMORY OPERATING SYSTEM KERNEL CPU Ordinary programs run in user mode. If a user program tries a privileged operation, the hardware will tell the kernel!

Abstractions for Convenient, Portable, Shareable I/O 21

Convenient abstractions for I/O Angry Birds Play Video Browser OPERATING SYSTEM KERNEL MEMORY Keyboard, mouse,display CPU Disk Printer

Convenient abstractions for I/O Devices provide very primitive services (store a block, send network packet, signal a keypress) Angry Birds Play Video Browser OPERATING SYSTEM KERNEL MEMORY Keyboard, mouse,display CPU Disk Printer

Convenient abstractions for I/O The OS gives applications access through convenient, higher level abstractions Angry Birds Play Video Browser MEMORY Filesystem, Graphics System, Window system, OPERATING TCP/IP Networking, SYSTEM CODE etc., & etc. DATA CPU Keyboard, mouse,display Disk Printer

Disk data abstracted as files Angry Birds Play Video Browser Filesystem, Graphics System, Window system, TCP/IP Networking, etc., etc. OPERATING SYSTEM KERNEL MEMORY Keyboard, mouse,display CPU Disk Printer

Linux provides convenient abstractions for File access Network Audio / Video Process creation & control Timing Memory management Graphics / Windows Monitoring execution Thread management I/O access Inter-process communication Etc. 26

Sharing devices Programs need coordinated access to shared devices Angry Birds Play Video Browser OPERATING SYSTEM KERNEL CPU Keyboard, mouse,display Disk Printer

What gets shared? Angry Birds Play Video Browser QUESTION? Would I want to Filesystem, give the faculty Graphics access System, to disk Window block number system, 3752344 or to TCP/IP comp111.grades? Networking, etc., etc. OPERATING SYSTEM KERNEL MEMORY Keyboard, mouse,display CPU Disk Printer

What gets shared? Angry Birds Play Video Browser Filesystem, Graphics System, Window system, TCP/IP Networking, etc., etc. OPERATING SYSTEM KERNEL MEMORY Keyboard, mouse,display CPU Disk Printer

What gets shared? We re controlling access to a file!! Angry Birds Play Video Browser Files are the main abstraction for persistent data storage Files are the Filesystem, units of sharing Graphics and access System, control Window a system, Unix/Linux system TCP/IP Networking, etc., etc. chgrp faculty comp111.grades // give faculty access OPERATING SYSTEM // KERNEL to grades file MEMORY Keyboard, mouse,display CPU Disk Printer

and your point is? Many of the same abstractions that make things easier to use also are the ones we need to control sharing! 31

Abstraction and Information Hiding in Operating Systems 32

Abstractions hide unnecessary details The file abstraction hides: Where each file lives on disk The size of the disk, how many blocks it has, how to program it Whether it s a spinning disk, SSD, USB key, floppy disk, etc. The tty abstraction hides: What type of keyboard you have, whether you are on an actual character terminal or a simulated XTerm, The process memory abstraction hides Details of the computer s memory mapping hardware structure (lots of other stuff too) By hiding these things, we tend to make your programs portable We can use the same APIs for many different types of data and devices We also isolate the parts of the OS that must be changed in order to support new devices (USB key) or to run on a different CPU KEY POINT!! Hiding information can make your interfaces more powerful, easier to use and more portable 33

A bit of history Unix was designed by Ken Thompson & Dennis Ritchie in 1969 at Bell Labs and recoded in C as a portable system in 1973 It was the first serious attempt at a portable operating system Until that time, each family of hardware had its own OS You couldn t easily move programs across different brands of computer There were arguably two key innovations that led to success 34

A bit of history Unix was designed by Ken Thompson & Dennis Ritchie in 1969 at Bell Labs and recoded in C as a portable system in 1973 It was the first serious attempt at a portable operating system Until that time, each family of hardware had its own OS You couldn t easily move programs across different brands of computer There were arguably two key innovations that led to success The invention and use of C as a portable programming language for system use 35

A bit of history Unix was designed by Ken Thompson & Dennis Ritchie in 1969 at Bell Labs and recoded in C as a portable system in 1973 It was the first serious attempt at a portable operating system Until that time, each family of hardware had its own OS You couldn t easily move programs across different brands of computer There were arguably two key innovations that led to success The invention and use of C as a portable programming language for system use The brilliant choice of simple portable, abstractions for processes, file I/O etc. 36

A bit of history Unix was designed by Ken Thompson & Dennis Ritchie in 1969 at Bell Labs and recoded in C as a portable system in 1973 It was the first serious attempt at a portable operating system Until that time, each family of hardware had its own OS You couldn t easily move programs across different brands of computer There were arguably two key innovations that led to success The invention and use of C as a portable programming language for system use The brilliant choice of simple portable, abstractions for processes, file I/O etc. Almost all the file and process system calls we use today are the ones invented by Ritchie and Thompson around 1969 Dennis Ritchie paper on the history of Unix: http://cm.bell-labs.com/cm/cs/who/dmr/hist.html 37

PDP-7: the first Unix was written for this I couldn t find information about this PDP-7, but its replacement, a PDP-11 used for the next version of Unix had (quoting Ritchie): * 24K bytes of core memory (16K for the system, 8K for user programs) * A disk with 1K blocks (512K bytes). Each file was limited to 64K bytes. Isn t it astonishing that the abstractions they invented are the ones we are using in COMP 111 on machines that run at > 1 Ghz, have many gigabytes of memory, and disks that each hold terabytes of data??? 38

Avoiding Unnecessary Dependencies in the OS 39

The OS chooses not to depend on: The language in which a user program is written C?, C++?, Java?, Fortran?, Python? The types of variables in a compiled program The types of stack and dynamically allocated variables The function of a specific device driver The meaning of driver private data Which driver connects to which physical device Etc., etc. The less the OS constrains what goes on in a process or device driver, the more flexible it can be in supporting new programming languages, I/O devices, etc. However: we ll see in a minute that the OS has a few features to help common languages with procedure calls and shareable libraries run efficiently: 40

Summary: Information hiding and abstraction The core abstractions in Unix/Linux have been artfully chosen to support a very broad range of needs, and to evolve with changing hardware for decades. To enable this: The interface provided to processes abstract away non-essential details of the hardware and OS The OS avoids depending unnecessarily on details of the programs to be run or the languages in which they are written 41

Today The Big Picture: How the OS is organized How good OS services are designed Process: the most important OS abstraction How the OS interacts with processes How processes use memory 42

Processes The Fundamental Unit of Work 43

Processes There is one OS process for each running copy of a program Angry Birds Angry Birds Browser MEMORY Keyboard, mouse,display CPU Disk Printer

What is process? The fundamental unit of work: a running (or paused) copy of a program Processes have: A process ID (PID): a unique integer identifier Memory segments for code and datat (we ll discuss later) Machine-level execution state: program counter, registers, etc. Owner - a userid (a process has its owners access permisisons) Scheduling priority Current working directory (where files with relative names like xxx will open) Zero or more open files (e.g. stdin or files opened with open/fopen ) A parent process (maybe) child processes Accounting information: how much time used Etc., etc. If you understand what a process is and how it runs, you know a lot about how the OS works! 45

Today The Big Picture: How the OS is organized How good OS services are designed Process: the most important OS abstraction How the OS interacts with processes How processes use memory 46

How can your process call the kernel? What about an ordinary function call? Angry Birds Play Video Browser read(myfile.); Filesystem, Graphics System, Window system, TCP/IP Networking, etc., etc. OPERATING SYSTEM KERNEL That won t work your process isn t even allowed to access kernel memory! MEMORY Keyboard, mouse,display CPU Disk Printer

How can your process call the kernel? The answer: A small glue function (e.g. read()) prepares its arguments in registers or stack, then executes Angry Birds an Play Video Browser instruction that traps to the kernel. This is known as a system call. Filesystem, Graphics System, Window system, TCP/IP Networking, etc., etc. OPERATING SYSTEM KERNEL The kernel, running in MEMORY privileged mode, looks at your arguments, decides what service you want, and calls it. Keyboard, mouse,display When work is done, the kernel leaves result info in your registers and memory, and returns to the instruction after the trap, using HW mechanisms to return to user mode Disk Printer CPU

Linux provides system calls for Process creation & control File access Network Timing Memory management Monitoring execution Thread management I/O access Inter-process communication Etc. 49

Libraries vs. System Calls Library routines like sqrt & fread are ordinary functions provided with the system they run in user memory Some library routines use system calls Angry Birds Play Video Browser stdio library Filesystem, Graphics System, Window system, TCP/IP Networking, etc., etc. MEMORY OPERATING SYSTEM KERNEL CPU Keyboard, mouse,display Disk Printer

Today The Big Picture: How the OS is organized How good OS services are designed Process: the most important OS abstraction How the OS interacts with processes How processes use memory 51

Process Memory 52

The process memory illusion argv, environ Process thinks it's running in a private space Separated into segments, from address 0 Stack: memory for executing subroutines Heap: memory for malloc/new Global static variables Text segment: where program lives Loaded with your program Stack Heap (malloc d) Static uninitialized Static initialized Text (code) 0 53

The process memory illusion argv, environ char notinitialized[10000]; char initialized[] = I love COMP 111 ; Stack int main(int argc, char *argvp[]*) { float f; int i; } // yes, we should check return codes char *cp = malloc(10000); Heap (malloc d) Static uninitialized Loaded with your program Static initialized Text (code) 0 54

The process memory illusion argv, environ char notinitialized[10000]; char initialized[] = I love COMP 111 ; Stack int main(int argc, char *argvp[]*) { float f; int i; } // yes, we should check return codes char *cp = malloc(10000); Heap (malloc d) Static uninitialized Loaded with your program Static initialized Text (code) 0 55

The process memory illusion argv, environ char notinitialized[10000]; char initialized[] = I love COMP 111 ; Stack int main(int argc, char *argvp[]*) { float f; int i; } // yes, we should check return codes char *cp = malloc(10000); Heap (malloc d) Static uninitialized Loaded with your program Static initialized Text (code) 0 56

The process memory illusion argv, environ char notinitialized[10000]; char initialized[] = I love COMP 111 ; Stack int main(int argc, char *argv[]) { float f; int i; } // yes, we should check return codes char *cp = malloc(10000); Heap (malloc d) Static uninitialized Loaded with your program Static initialized Text (code) 0 57

The process memory illusion argv, environ char notinitialized[10000]; char initialized[] = I love COMP 111 ; Stack int main(int argc, char *argv[]) { float f; int i; } // yes, we should check return codes char *cp = malloc(10000); Heap (malloc d) Static uninitialized Loaded with your program Static initialized Text (code) 0 58

The process memory illusion argv, environ char notinitialized[10000]; char initialized[] = I love COMP 111 ; Stack int main(int argc, char *argv[], char *envp[]) { float f; int i; } // yes, we should check return codes char *cp = malloc(10000); Heap (malloc d) Static uninitialized Loaded with your program Static initialized Text (code) 0 59

The process memory illusion argv, environ Process thinks it's running in a private space Separated into segments, from address 0 Stack: memory for executing subroutines Heap: memory for malloc/new Global static variables malloc/free are library functions that run in user mode to allocate space within the heap. Text segment: where program lives when they run out of space to play with, they call the sbrk system call to ask the OS to grow the heap. Loaded with your program Stack Heap (malloc d) Static uninitialized Static initialized Text (code) 0 60

The process memory illusion argv, environ char notinitialized[10000]; char initialized[] = I love COMP 111 ; Stack int main(int argc, char *argvp[]*) { float f; int i; } // yes, we should check return codes char *cp = malloc(10000); Heap (malloc d) Static uninitialized Loaded with your program Static initialized Text (code) 0 61

The process memory illusion argv, environ char notinitialized[10000]; char initialized[] = I love COMP 111 ; Stack int main(int argc, char *argvp[]*) { float f; int i; } // yes, we should check return codes char *cp = malloc(10000); Heap (malloc d) Static uninitialized Loaded with your program Static initialized Text (code) 0 62

Of course, the stack enables recursion argv, environ int factorial(int n) { if (n == 0) return 1; else return n * factorial(n - 1); } Stack n=4 n=3 n=2 n=1 Heap (malloc d) Loaded with your program Static uninitialized Static initialized Text (code) 0 63

Of course, the stack enables recursion argv, environ int factorial(int n) { if (n == 0) return 1; else return n * factorial(n - 1); } Stack n=4 n=3 n=2 Heap (malloc d) Loaded with your program Static uninitialized Static initialized Text (code) 0 64

The process memory illusion argv, environ Process thinks it's running in a private space In Linux, there is a system call to grow the heap, but not the stack. When the system faults on an access to the next page below the end of the stack, the OS maps more memory automatically. Separated into segments, from address 0 Stack: memory for executing subroutines Heap: memory for malloc/new Global static variables (up to configurable limit). Text segment: where program lives Loaded with your program More on program calls and the stack can be found in Prof. Couch s notes at: http://www.cs.tufts.edu/comp/111/notes/the_visible_os.pdf Stack Heap (malloc d) Static uninitialized Static initialized Text (code) 0 65

The process memory illusion argv, environ Process thinks it's running in a private space. Separated into segments, from address 0: Text segment: where program lives. Global variables. Heap: memory for malloc/new. Memory between the stack and the heap is Stack: memory not for mapped executing by the subroutines. OS. As far as the process is concerned, it doesn t exist. Access causes a segfault. Stack Nothing here Heap (malloc d) Static uninitialized Static initialized Text (code) 66

The process memory illusion Kernel argv, environ Process thinks it's running in a private space. Separated into segments, from address 0: Text segment: where program lives. Global variables. Heap: memory for malloc/new. Surprisingly: the kernel actual lives in every process space at the top. Stack: memory for executing subroutines. The maps are set so ordinary user code segfaults on access, but when in the kernel executing a system call, the sytem can access its own kernel segments as well as the user s. Stack Heap (malloc d) Static uninitialized Static initialized Text (code) 67

Summary The Big Picture: How the OS is organized How good OS services are designed Process: the most important OS abstraction How the OS interacts with processes How processes use memory 68

Thank you! 69