More description of system call when a system call is

This preview shows page 26 - 30 out of 38 pages.

More description of system call: " When a system call is called, it is treated by the hardware as a software interrupt. " The mode bit is set to kernel mode. " Control passes through the interrupt vector to a service routine in the operating system. # The kernel examines the parameter of the interrupt to determine what type of service the user program is requesting. " The kernel verifies and executes the request. " And returns control to the instruction following the system call (user mode) . 52 Operating-System Operations: Timer ! Operating system must prevent a user program from running too long. " E.g., Getting stuck in an infinite loop. ! A timer can be set to prevent a user program from running too long. " Timer can be set to interrupt the computer after a period. " Before turning over control to the user (program) , operating system initializes a counter . " Every timer interrupt decrements the counter by 1. " When counter becomes negative, the operating system terminates program.
Image of page 26

Subscribe to view the full document.

Introduction to OS 27 53 Process Management ! Process : " A program in execution. # Program is a passive entity , process is an active entity . " A unit of work within the system. ! Process needs resources to accomplish its task. ! Process termination requires reclaim of any reusable resources. " CPU, memory, I/O, files. ! Single-threaded process has one program counter specifying location of next instruction to execute. ! Multi-threaded process has one program counter per thread. " Process executes instructions sequentially, one at a time, until completion. 54 Process Management (cont’d) ! Typically system has many processes, some user, some operating system running concurrently on one or more CPUs. ! The operating system is responsible for the following activities in connection with process management (chapters 3 ~ 6) : " Creating and deleting both user and system processes " Suspending and resuming processes. " Providing mechanisms for process synchronization. " Providing mechanisms for process communication. " Providing mechanisms for deadlock handling.
Image of page 27
Introduction to OS 28 55 Memory Management ! The main memory is generally the only large storage device that the CPU is able to address and access directly. " Main memory is a large array of words or bytes , ranging in size from hundreds of thousands to billions. " Each word or byte has its own (memory) address. ! Data must be in memory before and after processing. " For example, load data from disk into memory. ! All instructions must be in memory in order to execute. 56 Memory Management (cont’d) ! General-purpose computers must keep several programs in memory to improve the computer performance. " Creating a need for memory management (chapters 8 and 9) . ! Memory management activities: " Keeping track of which parts of memory are currently being used and by whom. " Deciding which processes (or parts thereof) and data to move into and out of memory. " Allocating and de-allocating memory space as needed.
Image of page 28

Subscribe to view the full document.

Introduction to OS 29 57 Storage Management ! The operating system provides uniform, logical view of physical storage media.
Image of page 29
Image of page 30
You've reached the end of this preview.
  • Spring '12
  • GwangS.Jung
  • OS, main memory

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern