DOC PREVIEW
UNO CSCI 4500 - OS Concepts

This preview shows page 1-2-3 out of 10 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1CSCI 4500Operating Systems© 2008 Stanley A. Wileman, Jr. Operating Systems Slide 1Operating SystemsModule 2OS Concepts: Processes and File SystemsIn This Module…Operating System ConceptsIntroduction to Processes© 2008 Stanley A. Wileman, Jr. Operating Systems Slide 2Files and Data SetsName Binding, Catalogs and DirectoriesSystem Calls for Processes and TasksSample Programs Using ProcessesOperating System ConceptsRecall that we will study operating systems from two points of view. These are the views ofApplication writers, using the various system calls to achieve interaction with the system and its © 2008 Stanley A. Wileman, Jr. Operating Systems Slide 3resources.OS implementers, who must write the code for the operating system that implements the system calls.Let’s consider two major system call categories, those for processes and for file systems.Introduction to Processes (Tasks)A process, sometimes called a task, is essentially a packaged “unit of work” for a computer system. In many cases when you tddblliki© 2008 Stanley A. Wileman, Jr. Operating Systems Slide 4enter a command or double click on an icon, a command interpreter process (a “shell”) will create a new process to run the program.Processes will always havean address space in which they can execute, anda set of processor registers to hold data, next instruction address, and so forth.ProcessesIn a multiprogramming system, multiple processes (at least one per user) are being “virtually executed.” But it’s obvious only one process can be actually executed at a time on a single processor© 2008 Stanley A. Wileman, Jr. Operating Systems Slide 5single processor.Thus, the process currently being executed is occasionally “freeze dried” and another process is executed for a while. This is called a context switch, since the processor’s context changes.When a process is not being executed, salient details (e.g. CPU register contents and file pointers) are stored away in a process table.Process Example: The CPU executes some instructions from process “A”…© 2008 Stanley A. Wileman, Jr. Operating Systems Slide 6LOAD AADD BSTORE CDIV XADD ZSTORE Y…LOAD KDIV EMPY TSTORE NCMP LJNE LOOP…...Process AProcess B2…then saves process A’s context and executes some instructions from process “B”…© 2008 Stanley A. Wileman, Jr. Operating Systems Slide 7LOAD AADD BSTORE CDIV XADD ZSTORE Y…LOAD KDIV EMPY TSTORE NCMP LJNE LOOP…...Process AProcess B…then saves process B’s context, restores A’s context and executes some more instructions.© 2008 Stanley A. Wileman, Jr. Operating Systems Slide 8LOAD AADD BSTORE CDIV XADD ZSTORE Y…LOAD KDIV EMPY TSTORE NCMP LJNE LOOP…...Process AProcess BSystem Calls for ProcessesKey process-related system calls include those in the following categories:create or terminate a process;cause a process to wait, if necessary, until it can use a particular resource;© 2008 Stanley A. Wileman, Jr. Operating Systems Slide 9use a particular resource;manage the memory used by a process; andcontrol the handling of asynchronous signals sent to a process.We will later examine some of these system calls in detail, and use them in a program.Process TablesA process table has one entry for every process in the system.Each process table entry contains© 2008 Stanley A. Wileman, Jr. Operating Systems Slide 10Each process table entry contains information about process ownership, relation to other processes, process state, and statistical information.Process tables are frequently organized as static arrays.Process Identification and OwnershipEach process in a system must be uniquely identified. In UNIX systems, this identification is provided by an integer called the process ID.© 2008 Stanley A. Wileman, Jr. Operating Systems Slide 11pygpEach process is also owned by a particular user, identified by a user ID(uid).One uid, associated with the “super user,” imparts special privileges (e.g. shutdown the system, and read arbitrary files) to processes. (OS/390 UNIX allows multiple “super users.”)Files and Data SetsAnother major operating system function is to provide convenient access to information organized in files, or data sets. (The term data setis frequently used for files on mainframes.)Fildllti fif ti© 2008 Stanley A. Wileman, Jr. Operating Systems Slide 12Files are named collections of information, usually stored on disk or magnetic tape.Files can also be stored on other devices, including RAM disks and removable memory cards for use with portable devices (e.g. cameras and handheld computers).3File SystemsA file system is a storage structure (like a data structure, but normally tailored for a secondary storage device like a disk).© 2008 Stanley A. Wileman, Jr. Operating Systems Slide 13yg )There are many different types of file systems, even for the same operating system. Speed, reliability, media type, and other factors influence the design of a file system. For example, CD Rom file systems differ considerably from those for hard drives.System Calls for File ManipulationThe usual system calls for manipulating files include the following:open — prepare a file for input/outputread — copy data from file to memoryitdt f t fil© 2008 Stanley A. Wileman, Jr. Operating Systems Slide 14write —copy data from memory to fileclose — conclude I/O operations on a fileOther system calls may be provided for things like file locking, random positioning, concurrent I/O, tape positioning, communication functions, and so forth.We will later take a detailed look at a number of these system calls and use them in a program.Organizing FilesEven systems designed for use by a single user may have thousands of files. How are these files organized?© 2008 Stanley A. Wileman, Jr. Operating Systems Slide 15gMost systems use a hierarchical naming scheme for files. A particular file is accessed by giving first the name at the top level of the hierarchy, then the second level name, and so forth, finishing with the name of the desired file.Hierarchical Naming ExamplesA mainframe computer might use names like STANW.SAMPLE.JOBS and STANW.SAMPLE.CLIST for data sets tii diff tt f l d© 2008 Stanley A. Wileman, Jr. Operating Systems Slide 16containing different types of sample code.If these were stored in a UNIX file system, they might be /u/stanw/sample/jobs and /u/stanw/sample/clist.Note that the basic concepts are the same. It’s much like describing a path through a


View Full Document

UNO CSCI 4500 - OS Concepts

Download OS Concepts
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view OS Concepts and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view OS Concepts 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?