Suggested Exercises 5.

Slides:



Advertisements
Similar presentations
Prashant Somashekar. What will we discuss? -Brief overview of a kernel -How a kernel fits into the hierarchy -Android versus Linux kernel -Building an.
Advertisements

Synchronization with Eventcounts and Sequencers
UNIX System Programming Installing OpenSolaris. 2/86 Contents How to setup a virtual machine guest How to install OpenSolaris as a guest How to update.
Chapter 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 6: Process Synchronization.
CIS238/DL1 Chapter 15 Rebuilding the Linux Kernel Preparing the Source Code Locating the Source Code Installing the Source Code Read the Documentation.
LINUX MINT A introduction to Linux Mint. Advantages Mint works straight out of the box: everything you need is already there in the distribution, meaning.
1 Concurrency: Mutual Exclusion and Synchronization Chapter 5.
Homework 6 Sarah Diesburg Operating Systems CS 3430.
Multi-Object Synchronization. Main Points Problems with synchronizing multiple objects Definition of deadlock – Circular waiting for resources Conditions.
1 Concurrency: Mutual Exclusion and Synchronization Chapter 5.
Contiki A Lightweight and Flexible Operating System for Tiny Networked Sensors Presented by: Jeremy Schiff.
The Banker’s Algorithm for A Single Resource
S.Ha.R.K. Workshop28/02/05 S.Ha.R.K. Installation HowTo Tullio Facchinetti University of Pavia - Italy.
Android Tablet SD Card Update P2 This document is the intellectual property of Acer Inc, and was created for demonstration purposes only.
Operating Systems Lab. (#2) University of Tehran – ECE Dept. Fall 2005 Reza Shokri
Renesas Technology America Inc. 1 M16C/Tiny SKP Tutorial 2 Creating A New Project Using HEW4.
9/8/2015cse synchronization-p1 © Perkins DW Johnson and University of Washington1 Synchronization Part 1 CSE 410, Spring 2008 Computer Systems.
Modifying Network Packet Buffering in Network Layer CS518 Final Presentation and Instruction Guide Li Zhang.
CIS 191 – Lesson 2 System Administration. CIS 191 – Lesson 2 System Architecture Component Architecture –The OS provides the simple components from which.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Operating Systems CMPSCI 377 Lecture.
Lab 11 Department of Computer Science and Information Engineering National Taiwan University Lab11 - Porting 2014/12/9/ 26 1.
10/1/2015 Chapter 2 Installing Windows XP Professional.
Please Note: Information contained in this document is considered LENOVO CONFIDENTIAL For Lenovo Internal Use Only Do Not Copy or Distribute!! For Lenovo.
09/21/081 Ho Chi Minh city University of Technology Linux kernel R.M. Introduction of building Linux kernel from source.
Critical Problem Revisit. Critical Sections Mutual exclusion Only one process can be in the critical section at a time Without mutual exclusion, results.
DB2 Universal Database Confidential | July 2012 | India Software Lab Click to add text © 2012 IBM Corporation An End to End Windows Automation Framework.
Chapter Two Exploring the UNIX File System and File Security.
Suggested Exercises 5. Question #1 Find a creative/funny example of synchronization that can demonstrate the difficulty of developing a monitor-based.
Concurrency: Mutual Exclusion and Synchronization Chapter 5.
Concurrency: Mutual Exclusion and Synchronization Chapter 5.
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee.
An OBSM method for Real Time Embedded Systems Veronica Eyo Sharvari Joshi.
VMWare Workstation Installation. Starting Vmware Workstation Go to the start menu and start the VMware Workstation program. *Note: The following instructions.
Andy Pavlo November 29, 2015November 29, 2015November 29, 2015 Testing H- Store.
General Comments about the Final The final will primarily focus on the material in the last part of the course Material from 1 through 6 that appear on.
Week 3 January 22, 2004 Adrienne Noble. Today CVS – a great tool to use with your groups Threads – basic thread operations Intro to synchronization Hand.
Nachos Project 3 Lecturer: Hao-Hua Chu TA: Chun-Po Wang (Artoo) Date: 2008/10/25.
COSC 3407: Operating Systems Lecture 9: Readers-Writers and Language Support for Synchronization.
LOGO Linux Installation. Linux Distribution Including shells, libraries, tools, compiler, servers, applications. Redhat, Fedora, Mandrake, SuSE, Debian,
Linux Operation System Computer Operation Manual.
1 Version 3.1 Module 5 Managing Cisco IOS Software.
Implementation of Embedded OS
Lab 5 Department of Computer Science and Information Engineering National Taiwan University Lab5 - OS Kernel 2014/10/21/ 16 1.
1 Setup and Compile Linux Kernel Speaker: Yi-Ji Jheng Date:
Spring 2007 Vmware and Linux kernel COMS W4118 Columbia University.
Bootstrap Tutorial Overview Objective Learn how to use the bootstrap for configuring the system. Requirements Installed Version of.
Rebuilding Linux Kernel Dedicated to penguin lovers everywhere 26 September 20161Rebuilding kernel by Visakh M R.
Linux Administration – Finding You Way on the Command Line The Linux File Directory or Tree.
6.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles 6.5 Semaphore Less complicated than the hardware-based solutions Semaphore S – integer.
Tech Level Cyber Security Lesson 7
Andrea Chierici Virtualization tutorial Catania 1-3 dicember 2010
Operating System Kernel Compilation
CS703 - Advanced Operating Systems
IM-pack: Software Installation Using Disk Images
linux and related thing
Monitors, Condition Variables, and Readers-Writers
Braindumps
Operating System Kernel Compilation
Concurrency: Mutual Exclusion and Synchronization
Kernel Synchronization II
IS3440 Linux Security Unit 7 Securing the Linux Kernel
Review and Q/A.
Semaphore Originally called P() and V() wait (S) { while S <= 0
COP 4343 Unix System Administration
Concurrency: Mutual Exclusion and Process Synchronization
Andy Wang Operating Systems COP 4610 / CGS 5765
Homework 4.
Linux Operation System
Operating System Kernel Compilation
Presentation transcript:

Suggested Exercises 5

Question #1 Find a creative/funny example of synchronization that can demonstrate the difficulty of developing a monitor-based solution (in pseudocode) similar to the “Readers-Writers.” Make sure that you vigorously discuss the correctness and pitfalls of your solution.

Gas Station Problem There is a common price for gas Consumers never modify the price – they just pump gas Owners read modify the price We want one owner at a time, but many consumers at the same time

Developing the Solution Global states: activeConsumers = 0; activeOwners = 0; waitingConsumers = 0; waitingOwners = 0; Condition okToPump = NULL; Condition okToChangePrice = NULL; Lock lock = FREE;

Sample Code Solution – up to you to prove correctness Consumer() { lock.Acquire(); while (activeOwners > 0 || waitingOwners > 0) { ++waitingConsumers; okToPump.Wait(&lock); --waitingConsumers; } ++activeConsumers; lock.Release(); // access price and pumps --activeConsumers; if (activeConsumers == 0 && waitingOwners > 0) { okToChangePrice.Signal(&lock); Writer() { lock.Acquire(); while (activeOwners > 0 || activeConsumers > 0) { ++waitingOwners; okToChangePrice.Wait(&lock); --waitingOwners; } ++activeOwners; lock.Release(); // access database --activeOwners; if (waitingOwners > 0) { okToChangePrice.Signal(&lock); } else if (waitingConsumers > 0) { okToPump.Broadcast(&lock);

Question #2 Find a creative/funny example of deadlock, and apply various deadlock prevention approaches to the live example. Describe the advantages and disadvantages of each approach.

A Tale of Two Fisherman Two fisherman are out fishing, but between them they only have one fishing pole and one bait. If one takes the pole, and the other takes the bait… They deadlock!

Solutions Infinite resources No sharing Buy more poles and bait No sharing They each have their own poles and bait, fish alone Allocate all resources at the beginning They each either get both things or none

Solutions Allocate all resources at the beginning They each either get both things or none semaphore pole= 1 semaphore bait= 1 lock = 1; fisher(int j) { while (TRUE) { P(s); P(pole); P(bait); // fish V(bait); V(pole); V(s); }

Solutions Make everyone use the same ordering Fisherman 1 goes first, then fisherman 2 (round robin)

Question #3 Please summarize the steps to configuring, compiling, and installing a kernel and its modules. Include the step of rebooting into the new kernel.

Kernel Steps Configuring a kernel Download kernel source Build new configuration Make the default configuration (smaller than the distro configuration) Issue ‘make defconfig’ Customize your kernel Issue ‘make menuconfig’ and select/de-select options as you see fit

Kernel Steps Compiling a kernel cd into kernel source, type ‘make’

Kernel Steps Installing a kernel Reboot! cd into kernel source Issue ‘make modules_install’ to copy the modules to installation location for new kernel Issue ‘make install’ to install the kernel executable to /boot Make an initrd image Issue ‘makeinitramfs –o [output file] [kernel version] Update the boot loader Issue ‘update-grub’, make sure grub finds both kernel image and initrd image Reboot!