CGS 3763 Operating Systems Concepts Spring 2013 Dan

  • Slides: 10
Download presentation
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office

CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: 30 - 12: 30 AM

Lecture 5 – Wednesday, January 16, 2013 n Last time: ¨ Operating Systems: n

Lecture 5 – Wednesday, January 16, 2013 n Last time: ¨ Operating Systems: n n n State and events; Event-driven-software Discussion of problems from the textbook Today: The kernel of an OS ¨ Protection – user and kernel mode execution ¨ OS services ¨ n Next time System calls ¨ Kernel data structures ¨ n Reading assignments: Chapter 2 of the text book ¨ The computer architecture material ¨ 6/10/2021 2

The main functions of a computer n n n Transform in formation the interpreter

The main functions of a computer n n n Transform in formation the interpreter Store information memory hierarchy Communicate communication links 6/10/2021 3

The basic operation of an interpreter 6/10/2021 4

The basic operation of an interpreter 6/10/2021 4

Privileged and non-privileged instructions n n To manage the resources of a system the

Privileged and non-privileged instructions n n To manage the resources of a system the kernel has to operate with a higher level of privileges. Two modes of operation Kernel mode ¨ User mode ¨ n Two types of instructions: Privileged instructions can only be executed in kernel mode ¨ Non-privileged instructions can be executed in kernel and in user mode ¨ n System calls ¨ 6/10/2021 Allow a user to communicate with the kernel and request operations that can only be carried out by the kernel. 5

Tight coupling between interpreter and storage n n n We need a memory enforcement

Tight coupling between interpreter and storage n n n We need a memory enforcement mechanism; to prevent a thread running the code of one module from overwriting the data of another module. Address space the range of memory addresses a thread is allowed to access. Close relationship between a thread an address space. Lecture 15 6

Virtualization of storage - Virtual memory n n Address space the storage a thread

Virtualization of storage - Virtual memory n n Address space the storage a thread is allowed to access. Virtual address space – an address space of a standard size regardless of the amount of physical memory. ¨ ¨ n The physical memory may be too small to fit an application; otherwise each application would need to manage its own memory. The size of the address space is a function of the number of bits in an address. For example, 32 bits addresses allow an address space of 232 (4 Gbytes), 64 bit addresses allow 264 Virtual Memory - a scheme to allow each thread to access only its own virtual address space (collection of virtual addresses). Lecture 15 7

Memory map of a process Lecture 15 8

Memory map of a process Lecture 15 8

Questions n n n What do we mean by a memory hierarchy? Why do

Questions n n n What do we mean by a memory hierarchy? Why do we need a hierarchy of memory? What is virtualization? What is virtual memory? What is an interrupt? What types of interrupts can you identify? 6/10/2021 9

Kernel functions n Program execution: n Interrupt handling: n Error handling: n Job sequencing:

Kernel functions n Program execution: n Interrupt handling: n Error handling: n Job sequencing: n Input/Output operations: n File system manipulation: n Scheduling: n Resource Allocation: n Accounting of computer resources: n Protection: 6/10/2021 10