Machine Malfunctioning - Operating System - Exam, Exams of Operating Systems

Main points of this exam paper are: Machine Malfunctioning, Traditional Memory, Memory Object, Modern Memory, Traditional Approach, Access a File, Parameter to Subsequent

Typology: Exams

2012/2013

Uploaded on 04/07/2013

seshan_kim55
seshan_kim55 🇮🇳

4.7

(3)

54 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Operating Systems Comps
Spring 2001
There are five questions on this exam. Please answer all five questions. You have 90 minutes to
complete this exam. Good luck!
1. Traditional Unix address spaces have three user-level virtual memory regions: one for static
text and data, one for the heap, and one for the stack. These regions have well-defined
locations and are internally contiguous. Modern Unix implementations have much more
flexible virtual memory support in which memory regions have been generalized to memory
objects . Memory objects can be dynamically created, and can have arbitrary locations and
sizes in a process' virtual address space. Each traditional memory regions is implemented as
one or more memory object.
Briefly describe two advantages and one disadvantage of the modern memory object approach
to virtual address spaces compared with the traditional approach.
2. The interfaces of many file systems are similar to that of Unix, where, to access a file, it must
first be "opened", after which the program can issue a series of reads and writes. When done,
it is "closed". The OPEN system call is given a file name (and possibly other parameters),
and it generally returns a file handle, which is then supplied as a parameter to subsequent
READ and WRITE system calls to operate on that file (and also to the CLOSE system call to
close it). Consider an alternative "simplified" design, where there are no OPEN and CLOSE
calls; rather, the READ and WRITE system calls are called with the file name as a parameter
(along with other parameters, including any that were originally supplied to the OPEN system
call, as appropriate).
Describe as many advantages or disadvantages to the alternative scheme. Why do most file
systems require files to be opened before being read and written? What is the purpose of the
CLOSE system call?
3. Alice and Bob had the following conversation over a game of foosball:
Alice: "I learned from the Lampson paper that protection mechanisms are just different
ways of expression a sparse access control matrix."
Bob: "Really? I just took an algorithms class where we studied and implemented sparse
matrices. You're implementing a free Linux-like operating system (Alix), so why don't
you use my code? It has a very compact representation of sparse matrices, with a default
value of 0.0, and while you won't need the other efficient operations such as matrix add,
multiply etc, This code has been proven correct!"
If Alice were to take Bob's code and plug it into Alix, would it probably satisfy all of the
needs of an access control system? Give reasons why or why not.
pf2

Partial preview of the text

Download Machine Malfunctioning - Operating System - Exam and more Exams Operating Systems in PDF only on Docsity!

Operating Systems Comps

Spring 2001

There are five questions on this exam. Please answer all five questions. You have 90 minutes to complete this exam. Good luck!

  1. Traditional Unix address spaces have three user-level virtual memory regions: one for static text and data, one for the heap, and one for the stack. These regions have well-defined locations and are internally contiguous. Modern Unix implementations have much more flexible virtual memory support in which memory regions have been generalized to memory objects. Memory objects can be dynamically created, and can have arbitrary locations and sizes in a process' virtual address space. Each traditional memory regions is implemented as one or more memory object.

Briefly describe two advantages and one disadvantage of the modern memory object approach to virtual address spaces compared with the traditional approach.

  1. The interfaces of many file systems are similar to that of Unix, where, to access a file, it must first be "opened", after which the program can issue a series of reads and writes. When done, it is "closed". The OPEN system call is given a file name (and possibly other parameters), and it generally returns a file handle, which is then supplied as a parameter to subsequent READ and WRITE system calls to operate on that file (and also to the CLOSE system call to close it). Consider an alternative "simplified" design, where there are no OPEN and CLOSE calls; rather, the READ and WRITE system calls are called with the file name as a parameter (along with other parameters, including any that were originally supplied to the OPEN system call, as appropriate).

Describe as many advantages or disadvantages to the alternative scheme. Why do most file systems require files to be opened before being read and written? What is the purpose of the CLOSE system call?

  1. Alice and Bob had the following conversation over a game of foosball:

Alice: "I learned from the Lampson paper that protection mechanisms are just different ways of expression a sparse access control matrix."

Bob: "Really? I just took an algorithms class where we studied and implemented sparse matrices. You're implementing a free Linux-like operating system ( Alix ), so why don't you use my code? It has a very compact representation of sparse matrices, with a default value of 0.0, and while you won't need the other efficient operations such as matrix add, multiply etc, This code has been proven correct!"

If Alice were to take Bob's code and plug it into Alix , would it probably satisfy all of the needs of an access control system? Give reasons why or why not.

  1. In the THE operating system paper, Dijkstra introduced the notion of a layered architecture. He was motivated in part by fear. Quoting from the paper,

As captain of the crew I had had extensive experience (dating back to 1958) in making basic software dealing with real-time interrupts, and I knew by bitter experience that as a result of the irreproducibility of the interrupt moments a program error could present itself misleadingly like an occasional machine malfunctioning. As a result I was terribly afraid. Having fears regarding the possibility of debugging, we decided to be as careful as possible and, prevention being better than cure, to try to prevent nasty bugs from entering the construction.

What do we now call such a bug that "could present itself misleadingly like an occasional machine malfunctioning"? How did the layered architecture approach help prevent such bugs from entering the construction?

  1. Clark argued that structuring systems using upcalls , particularly for the receive path in networking stacks, can greatly increase performance. In the abstract ideal case, packets received by the network adapter could be delivered all the way to the application via upcalls. In a typical OS, however, this is not quite the case. When a network adapter receives a packet, it signals an interrupt and the OS reads the packet from the network adapter into a buffer, places the buffer on a queue, and signals a kernel thread or process to handle the packet. Doing so introduces a control flow switch in the receive path. Why is this control switch a good idea?