COS3721-101 2018 3 B PDF
COS3721-101 2018 3 B PDF
Semesters 1 and 2
School of Computing
BARCODE
Open Rubric
CONTENTS
Page
1 INTRODUCTION .......................................................................................................................... 3
2 PURPOSE AND OUTCOMES ...................................................................................................... 3
2.1 Purpose ........................................................................................................................................ 3
2.2 Outcomes ..................................................................................................................................... 3
3 LECTURER(S) AND CONTACT DETAILS................................................................................... 4
3.1 Lecturer(s) .................................................................................................................................... 4
3.2 Department ................................................................................................................................... 4
3.3 University ...................................................................................................................................... 4
4 RESOURCES ............................................................................................................................... 4
4.1 Prescribed books .......................................................................................................................... 4
4.2 Recommended books ................................................................................................................... 4
4.3 Electronic reserves (e-reserves) ................................................................................................... 4
4.4 Library services and resources information ................................................................................... 5
5 STUDENT SUPPORT SERVICES ................................................................................................ 6
6 STUDY PLAN ............................................................................................................................... 8
7 PRACTICAL WORK AND WORK-INTEGRATED LEARNING..................................................... 8
8 ASSESSMENT ............................................................................................................................. 8
8.1 Assessment criteria....................................................................................................................... 8
8.2 Assessment plan .......................................................................................................................... 9
8.3 Assignment numbers .................................................................................................................... 9
8.3.1 General assignment numbers........................................................................................................ 9
8.3.2 Unique assignment numbers ......................................................................................................... 9
8.4 Assignment due dates .................................................................................................................. 9
8.5 Submission of assignments .......................................................................................................... 9
8.6 The assignments ........................................................................................................................ 10
8.7 Other assessment methods ........................................................................................................ 18
8.8 The examination ......................................................................................................................... 18
9 FREQUENTLY ASKED QUESTIONS ........................................................................................ 18
10 SOURCES CONSULTED ........................................................................................................... 18
2
COS3721/101/3/2018
1 INTRODUCTION
Dear Student
Greetings to you and welcome to COS3721, in this module we will study the basic principles and
concepts of operating systems.
The user communicates with the computer via the operating system, which is therefore an
extremely important software component of the computer system. Furthermore, techniques
developed for operating systems influence many other areas of computer science, including
computer architecture, programming languages, compilers, databases, computer networks and
mobile agents.
This module assumes a background in general assembly language programming and computer
organisation (COS2621).
For this module, there are several outcomes that we hope you will be able to accomplish by the
end of the course:
3
3 LECTURER(S) AND CONTACT DETAILS
3.1 Lecturer(s)
Please see the COSALL tutorial letters for the telephone numbers of the lecturers on this module.
You may also get lecturers’ details from the welcome page of this module (COS3721-18-S1 or
COS3721-18-S2) on myUnisa.
When you contact the Lecturer, please do not forget to always include your student number. This will help
the Lecturers to assist you.
Please note that this module is an online module. We would like you to make use of the
discussions forums as much as possible for queries.
3.2 Department
The School of Computing can be contacted as follows:
Telephone number: +27 11 670 9200
E-mail: [email protected]
3.3 University
To contact the University, you should follow the instructions in the Study @ Unisa brochure.
Remember to have your student number available when you contact the University.
You may also try one of the following options:
4 RESOURCES
4.1 Prescribed books
Prescribed book for COS3721 is:
SILBERSCHATZ A., GALVIN P. & GAGNE G. Operating Systems Concepts, 9th Edition, John
Wiley & Sons Inc., 2014.ISBN 978-11180-9375-7.
Please consult the list of official booksellers and their addresses in Studies @ Unisa.
4
COS3721/101/3/2018
• LANE M. & MOONEY J. A Practical Approach to Operating Systems. Boyd & Fraser, 1988.
A similar concept to Tanenbaum's book; the practical work is less ambitious and more
accessible.
• HUSAIN, K. Red Hat Linux unleashed. Indianapolis, Ind. Sams Pub., 2nd edition, 1996.
This book covers the popular unix-type operating system called linux
for ibm pc's. the book is also accompanied by a cd, with linux on it.
• address changes
• cancellations
• examination admission
• examination venues
• exemptions
• financial questions
• prescribed books
• study material
• study methods
Should you feel the need to form a study group in your particular area, you can add your name,
contact details and the area in which you want to start the group to the forum topic related to
6
COS3721/101/3/2018
study groups on the Discussion Forum to the left of this screen. Don’t just sit back and expect
other students to contact you to form the group; be an active participant and be willing to take
the first step by contacting them.
The myUnisa website will serve as your class room. You must reflect on your studies using the
Blog, ask relevant questions using the Discussion Forum, test your knowledge with the Self
Assessments, study by referring to the Learning Units.
E-Tutors
Please be informed that, Unisa offers online tutorials (e-tutoring) to students registered for
modules at NQF level 5,6 and 7, this means qualifying undergraduate modules.
Students registered for this module will be allocated to a group of students with whom you will
be interacting during the tuition period as well as an e-tutor who will be your tutorial facilitator.
Once you have been allocated to a group you will receive an sms informing you about your
group, the name of your e-tutor and instructions on how to log onto MyUnisa in order to receive
further information on the e-tutoring process.
Online tutorials are conducted by qualified E-Tutors who are appointed by Unisa and are offered
free of charge. All you need to be able to participate in e-tutoring is a computer with internet
connection. If you live close to a Unisa regional Centre or a Telecentre contracted with Unisa,
please feel free to visit any of these to access the internet. E-tutoring takes place on MyUnisa
where you are expected to connect with other students in your allocated group. It is the role of
the e-tutor to guide you through your study material during this interaction process. For your to
get the most out of online tutoring, you need to participate in the online discussions that the e-
tutor will be facilitating.
There are modules which students have been found to repeatedly fail, these modules are
allocated face-to-face tutors and tutorials for these modules take place at the Unisa regional
centres. These tutorials are also offered free of charge, however, it is important for you to
register at your nearest Unisa Regional Centre to secure attendance of these classes.
7
6 STUDY PLAN
6 Do assignment 1
7 Chapter 7: Deadlocks
8 Chapter 8: Memory-Management Strategies
9 Chapter 9: Virtual-Memory Management
10 Chapter 10: File System
10 Chapter 11: Implementing File System
11 Chapter 14: System Protection
11 Chapter 15: System Security
12 Chapter 16: The Linux System
12 Do assignment 2
8 ASSESSMENT
8.1 Assessment criteria
The assignments and examination in this module will test your understanding of the following
areas of Operating systems and Architecture:
• Overview and Introduction to Operating Systems,
• Process Management,
• Process Coordination,
• Memory Management,
• Storage Management,
• Protection and Security, and
• Distributed Systems.
8
COS3721/101/3/2018
Semester 1 Semester 2
Assignment 1 675514 896708
Assignment 2 848128 597179
Semester 1 Semester 2
Assignment 1 12 March 2018 27 August 2018
Assignment 2 16 April 2018 25 September 2018
• Your assignments must have precisely the same number as those specified in this
tutorial letter.
• Solutions of assignments 1 and 2 will be available for download on myUnisa after the
due date of the assignment.
9
8.6 The assignments
Assignment 1 – Semester 1
1.1 Some early computers protected the operating system by placing it in a memory partition
that could not be modified by either the user job or the operating system itself. Describe
two difficulties that you think
could arise with such a scheme.
1.2 Distinguish between the client–server and peer-to-peer models of Distributed systems.
1.3 In a multiprogramming and time-sharing environment, several users share the system
simultaneously. This situation can result in various security problems.
2.1 Why do some systems store the operating system in firmware, while others store it on
disk?
2.2 What are the five major activities of an operating system with regard to file management?
3.1 Original versions of Apple’s mobile iOS operating system provided no means of
concurrent processing. Discuss three major complications that concurrent processing
adds to an operating system.
3.2 Describe the differences among short-term, medium-term, and long term scheduling.
41. Under what circumstances does a multithreaded solution using multiple kernel threads
provide better performance than a single-threaded solution on a single-processor
system?
4.2 Which of the following components of program state are shared across threads in a
multithreaded process?
10
COS3721/101/3/2018
a. Register values
b. Heap memory
c. Global variables
d. Stack memory
5.1 Explain why interrupts are not appropriate for implementing synchronization primitives in
multiprocessor systems.
5.2 The Linux kernel has a policy that a process cannot hold a spinlock while attempting to
acquire a semaphore. Explain why this policy is in place.
6.1 Why is it important for the scheduler to distinguish I/O-bound programs from CPU-bound
programs?
6.2 Consider the following set of processes, with the length of the CPU burst given in
milliseconds:
The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0.
a. Draw four Gantt charts that illustrate the execution of these processes using the
following scheduling algorithms: FCFS, SJF, nonpreemptive priority (a larger priority
number implies a higher priority), and RR (quantum = 2).
b. What is the turnaround time of each process for each of the scheduling algorithms in
part a?
c. What is the waiting time of each process for each of these scheduling algorithms?
d. Which of the algorithms results in the minimum average waiting time (over all
processes)?
11
6.3 Which of the following scheduling algorithms could result in starvation?
a. First-come, first-served
b. Shortest job first
c. Round robin
d. Priority
Assignment 2 – Semester 1
2.1 Explain why mobile operating systems such as iOS and Android do not support
swapping.
2.2 Program binaries in many systems are typically structured as follows. Code is stored
starting with a small, fixed virtual address, such as 0. The code segment is followed by
the data segment that is used for storing the program variables. When the program starts
executing, the stack is allocated at the other end of the virtual address space and is
12
COS3721/101/3/2018
allowed to grow toward lower virtual addresses. What is the significance of this structure
for the following schemes?
1, 2, 3, 4, 2, 1, 5, 6, 2, 1, 2, 3, 7, 6, 3, 2, 1, 2, 3, 6.
How many page faults would occur for the following replacement algorithms, assuming
one, two, three, four, five, six, and seven frames? Remember that all frames are initially
empty, so your first unique pages will cost one fault each.
• LRU replacement
• FIFO replacement
• Optimal replacement
3.2 Assume that we have a demand-paged memory. The page table is held in registers. It
takes 8 milliseconds to service a page fault if an empty frame is available or if the
replaced page is not modified and 20 milliseconds if the replaced page is modified.
Memory-access time is 100 nanoseconds. Assume that the page to be replaced is
modified 70 percent of the time. What is the maximum acceptable page-fault rate for an
effective access time of no more than 200 nanoseconds?
4.1 Is disk scheduling, other than FCFS scheduling, useful in a single-user environment?
Explain your answer.
4.2 Explain why SSTF scheduling tends to favor middle cylinders over the innermost and
outermost cylinders.
5.1 Consider a file system in which a file can be deleted and its disk space reclaimed while
links to that file still exist. What problems may occur if a new file is created in the same
storage area or with the same absolute path name? How can these problems be
avoided?
5.2 What are the advantages and disadvantages of providing mandatory locks instead of
advisory locks whose use is left to users’ discretion?
13
Question 6 - Based on Chapter 14 of SGG
6.1 The access-control matrix can be used to determine whether a process can switch from,
say, domain A to domain B and enjoy the access privileges of domain B. Is this approach
equivalent to including the access privileges of domain B in those of domain A?
6.2 Consider a computer system in which computer games can be played by students only
between 10 P.M. and 6 A.M., by faculty members between 5 P.M. and 8 A.M., and by the
computer center staff at all times. Suggest a scheme for implementing this policy
efficiently.
Assignment 1 – Semester 2
1.1 What is the purpose of interrupts? How does an interrupt differ from a trap? Can traps be
generated intentionally by a user program? If so, for what purpose?
1.2 Describe some of the challenges of designing operating systems for mobile devices
compared with designing operating systems for traditional PCs.
2.1 What are the two models of inter process communication? What are the strengths and
weaknesses of the two approaches?
2.2 Explain why Java programs running on Android systems do not use the standard Java
API and virtual machine.
3.1 Give an example of a situation in which ordinary pipes are more suitable than named
pipes and an example of a situation in which named pipes are more suitable than
ordinary pipes.
14
COS3721/101/3/2018
3.2 What are the benefits and the disadvantages of each of the following?
Consider both the system level and the programmer level.
4.1 Can a multithreaded solution using multiple user-level threads achieve better
performance on a multiprocessor system than on a single processor system? Explain.
4.2 In Chapter 3, we discussed Google’s Chrome browser and its practice of opening each
new website in a separate process. Would the same benefits have been achieved if
instead Chrome had been designed to
open each new website in a separate thread? Explain.
5.1 Describe two kernel data structures in which race conditions are possible.
Be sure to include a description of how a race condition can occur.
6.1 Discuss how the following pairs of scheduling criteria conflict in certain settings.
6.2 The following processes are being scheduled using a preemptive, round robin scheduling
algorithm. Each process is assigned a numerical priority, with a higher number indicating
a higher relative priority. In addition to the processes listed below, the system also has an
idle task (which consumes no CPU resources and is identified as Pidle ). This task has
priority 0 and is scheduled whenever the system has no other available processes to run.
The length of a time quantum is 10 units. If a process is preempted by a higher-priority
process, the preempted process is placed at the end of the queue.
15
a. Show the scheduling order of the processes using a Gantt chart.
b. What is the turnaround time for each process?
c. What is the waiting time for each process?
d. What is the CPU utilization rate?
a. First-come, first-served
b. Shortest job first
c. Round robin
d. Priority
Assignment 2 – Semester 2
16
COS3721/101/3/2018
a. Illustrate that the system is in a safe state by demonstrating an order in which the
processes may complete.
b. If a request from process P1 arrives for (1, 1, 0, 0), can the request be granted
immediately?
c. If a request from process P4 arrives for (0, 0, 2, 0), can the request be granted
immediately?
1.2 What is the optimistic assumption made in the deadlock-detection algorithm? How can
this assumption be violated?
1.1 Although Android does not support swapping on its boot disk, it is possible to set up a
swap space using a separate SD nonvolatile memory card. Why would Android disallow
swapping on its boot disk yet allow it on a secondary disk?
1.2 Assuming a 1-KB page size, what are the page numbers and offsets for
the following address references (provided as decimal numbers):
a. 3085
b. 42095
c. 215201
d. 650000
e. 2000001
7, 2, 3, 1, 2, 5, 3, 4, 6, 7, 7, 1, 0, 5, 4, 6, 2, 3, 0, 1.
Assuming demand paging with three frames, how many page faults would occur for the
following replacement algorithms?
• LRU replacement
• FIFO replacement
• Optimal replacement
3.2 When a page fault occurs, the process requesting the page must block while waiting for
the page to be brought from disk into physical memory. Assume that there exists a
process with five user-level threads and that the mapping of user threads to kernel
threads is one to one. If one user thread incurs a page fault while accessing its stack,
would the other user threads belonging to the same process also be affected by the page
fault—that is, would they also have to wait for the faulting page to be brought into
memory? Explain.
17
Question 4 - Based on Chapter 10 of SGG
4.1 Why is it important to balance file-system I/O among the disks and controllers on a
system in a multitasking environment?
4.2 What are the tradeoffs involved in rereading code pages from the file system versus
using swap space to store them?
5.1 The open-file table is used to maintain information about files that are currently open.
Should the operating system maintain a separate table for each user or maintain just one
table that contains references to files that are currently being accessed by all users? If
the same file is being accessed by two different programs or users, should there be
separate entries in the open-file table? Explain.
5.2 Provide examples of applications that typically access files according to the following
methods:
• Sequential
• Random
6.1 What hardware features does a computer system need for efficient capability
manipulation? Can these features be used for memory protection?
10 SOURCES CONSULTED
SILBERSCHATZ A., GALVIN P. & GAGNE G. Operating Systems Concepts, 9th Edition, John
Wiley & Sons Inc., 2014.ISBN 978-11180-9375-7.
©UNISA 2018
18