New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here

Operating Systems

by: Roman McCullough

Operating Systems CMPSCI 377

Roman McCullough
GPA 3.57


Almost Ready


These notes were just uploaded, and will be ready to view shortly.

Purchase these notes here, or revisit this page.

Either way, we'll remind you when they're ready :)

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

Class Notes
25 ?




Popular in Course

Popular in ComputerScienence

This 4 page Class Notes was uploaded by Roman McCullough on Friday October 30, 2015. The Class Notes belongs to CMPSCI 377 at University of Massachusetts taught by Staff in Fall. Since its upload, it has received 8 views. For similar materials see /class/232269/cmpsci-377-university-of-massachusetts in ComputerScienence at University of Massachusetts.


Reviews for Operating Systems


Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 10/30/15
CMPSCI 377 Operating Systems Fall 2008 Lecture 4 September 11 Lecturer Pmshzmt Shenoy Scribe Shashz39 Singh 41 Processes A process is an instance of a computer program that is being sequentially executed by a computer system that has the ability to run several computer programs concurrently computer program itself is just a passive collection of instructions while a process is the actual execution of those instructions Several processes may be associated with the same program for example opening up several windows of the same program typically means more than one process is being executed 1n the computing world processes are formally de ned by the operating systemsOS running them and so may differ in detail from one OS to another A single computer processor executes one or more multiple instructions at a time per clock cycle one after the other To allow users to run several programs at once eg so that processor time is not wasted waiting for input from a resource singleprocessor computer systems can perform timesharing Timesharing allows processes to switch between being executed and waiting to continue to be executed In most cases this is done very rapidly providing the illusion that several processes are executing 7at oncel This is known as concurrency or multiprogramming The OS schedules and manages the processes The operating system keeps its processes separated and allocates the resources they need so that they are less likely to interfere with each other and cause system failures eg deadlock or thrashing The operating system may also provide 39 for 39 t p 39 39 to enable processes to interact in safe and predictable ways 411 Synchronization Example Alice and Bob open a shared bank account Their initial balance is 0 Each deposit 100 We would expect that the balance now be 200 Consider the following sequence of operations 1Alice reads Balance she reads 0 2Alice increments Balance Balance 100 new Balance is 100 3Bob reads Balance He also reads 100 as Alice has not yet written the new Balance 4Bob increments Balance Balance 100 new Balance is 100 5Alice writes Balance she writes 100 6Bob writes Balance he also writes 100 This sequence leads to the nal balance being 100 which is incorrect This example clearly illustrates the importance of synchronization between Alicels and Bob s processes In particular the following sequence if enforced would produce correct results 1Alice reads 2Alice increments 3Alice writes 4Bob reads 5Bob increments 6Bob writes There may be other sequences of reads and writes that would produce correct results 42 Memory and Secondary Storage Management Main memory is the only one directly accessible to the CPU The CPU continuously reads instructions stored there and executes them Any data actively operated on is also stored there in uniform manner Secondary storage differs from primary storage in that it is not directly accessible by the CPU The computer usually uses its inputoutput channels to access secondary storage and transfers desired data using intermediate 4 1 42 Lecture 4 September 11 area in primary storage Secondary storage does not lose the data when the device is powered downit is nonvolatile Per unit it is typically also an order of magnitude less expensive than primary storage Consequently modern computer systems typically have an order of magnitude more secondary storage than primary storage and data is kept for a longer time there OS is responsible for allocatingdeallocating memory space for processes It maintains the mappings from virtual to physical memory which are stored in page tables It also decides how much memory to allocate to each process and when a process should be removed from memory 43 File System File system is a method for storing and organizing computer les and the data they contain to make it easy to nd and access themi File systems may use a data storage device such as a hard disk or CD ROM and involve maintaining the physical location of the les The most familiar le systems make use of an underlying data storage device that offers access to an array of xedsize blocks sometimes called sectors generally a power of 2 in size 512 bytes or 1 2 or 4 KB are most common The 6 system software is responsible for organizing these sectors into les and directories and keeping track of which sectors belong to which le and which are not being used File systems typically have directories which associate le names with les usually by connecting the le name to an in ex in a le allocation table of some sort such as the FAT in a DOS le system or an inode in a Unixlike le systemi File system provides a standard interface to create delete and manipulate read write extend rename copy protect les and directories It also provides general services such as backups maintaining mapping information accounting and quotas 44 10 Systems It supports communication with external devices like terminal printer keyboard mouse etci It supports buffering and spooling of lOi Spooling refers to a process of transferring data by placing it in a temporary working area where another program may access it for processing at a later point in time This temporary working area could be a le or storage device but probably not a buffer The 10 system provides a general device driver interface hiding the differences among devices often mimicking the le system interface 45 Distributed Systems Distributed system deals with hardware and software systems containing more than one processing element or storage element concurrent processes or multiple programs running under a loosely or tightly controlled regime In distributed computing a program is split up into parts that run simultaneously on multiple computers communicating over a network Distributed programs often must deal with heterogeneous envi ronments network links of varying latencies and unpredictable failures in the network or the computers The OS can support a distributed le system on a distributed systemi There are many different types of distributed computing systems and many challenges to overcome in successfully designing one T 6 main goal of a distributed computing system is to connect users and resources in a transparent open and scalable wayi Ideally this arrangement is drastically more fault tolerant and more powerful than many combinations of standalone computer systems Lecture 4 September 11 43 46 System Calls A system call is the mechanism used by an application program to request service from the operating system Generally operating systems provide a library that sits between normal programs and the rest of the operating system usually an implementation of the C library libc such as glibc This library handles the lowlevel details of passing information to the kernel and switching to supervisor mode as well as any data processing and preparation which does not need to be done in privileged mode Ideally this reduces the coupling between the operating system and the application and increases portability On Unixbased and OSlX based systems popular system calls are open read write close wait exec fork exit and kill Many of today7s operating systems have hundreds of system calls For example Linux has 319 different system calls FreeBSD has about the same almost 330 System calls are mostly accessed by programs via a high level Application Program Interface API rather than direct system call use This is done to show up a clean interface to the user hiding details of the OS interface for system calls lmplementing system calls requires a control transfer which involves some sort of architecture speci c feature A typical way to implement this is to use a software interrupt or trap lnterrupts transfer control to the kernel so software simply needs to set up some register with the system call number they want and execute the software interrupt 461 Parameter Passing Three methods to pass the parameters lPass the parameters in registers this may prove insuf cient when there are more parameters than registers 2Store the parameters in a block or table in memory and pass the address of block as a parameter in a register This approach is used by Linux and Solaris 3Push the parameters onto a stack to be popped off by the OS 4 7 OS organizations 471 Monolithic kernel A monolithic kernel is a kernel architecture where the entire kernel is run in kernel space in supervisor mode In common with other architectures microkernel hybrid kernels the kernel de nes a highlevel virtual interface over computer hardware with a set of primitives or system calls to implement operating system services such as process management concurrency and memory management in one or more modules Even if every module servicing these operations is separate from the whole the code integration is very tight and dif cult to do correctly and since all the modules run in the same address space a bug in one module can bring down the whole system However when the implementation is complete and trustworthy the tight internal integration of components allows the lowlevel features of the underlying system to be effectively utilized making a good monolithic kernel highly ef cient In a monolithic kernel all the systems such as the lesystem management run in an area called the kernel mode The main problem with this organization is maintainability Examples Unixlike kernels Unix Linux MS DOS Mac OS 472 Layered architecture Layered architecture organizes the kernel into a hierarchy of layers Layer n 1 uses services exclusively supported by layer it Mostly it is very dif cult to modularize the whole OS into such layers Usually parts of the OS are separately layered This architecture is easier to extend and evolve Lecture 4 September 11 4 73 Microkernel A microkernel is a minimal computer operating system kernel which in its purest form provides no operating system services at all only the mechanisms needed to implement such services such as lowlevel address space t rea 39 p 39 39 l f the microkernel has a kernelmode usermode distinction the microkernel is the only part of the system executing in a kernel mode The actual operatingsystem services are provided by 77usermode77 servers These include device drivers protocol stacks le systems and userinterface code Though it is easier to maintain a microkernel as compared to a monolithic kernel not many implementations of it exist The reason is its inef ciency owing to more context switches between the user and kerne mode 474 Hybrid kernel Hybrid kernel is a kernel architecture based on combining aspects of microkernel and monolithic kernel architectures used in computer operating systems It packs more OS functionality into the kernel than a pure microkernel Example Mac OS X


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Steve Martinelli UC Los Angeles

"There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

Allison Fischer University of Alabama

"I signed up to be an Elite Notetaker with 2 of my sorority sisters this semester. We just posted our notes weekly and were each making over $600 per month. I LOVE StudySoup!"

Bentley McCaw University of Florida

"I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"

Parker Thompson 500 Startups

"It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.