Tutorial 2
1. Describe two general methods for passing parameters to the operating system.
Answer:
a. Passing parameters in registers
b. Registers pass starting addresses of blocks of parameters
c. Parameters can be placed, or pushed, onto the stack by the program, and popped off the stack by the operating system
2. States five major activities of an operating system with regard to file management.
Answer:
• The creation and deletion of files
• The creation and deletion of directories
• The support of primitives for manipulating files and directories
• The mapping of files onto secondary storage
• The backup of files on stable (nonvolatile) storage media
3. Discuss the advantages and disadvantages of using the same system call interface for manipulating both files and devices.
Answer:
Advantages
Each device can be accessed as though it was a file in the file system.
- Since most of the kernel deals with devices through this file interface, it is easy to add a new device driver by implementing the hardware-specific code to support this abstract file interface.
- This benefits the development of both :- a. User program code, which can be written to access devices and files in the same manner, and b. Device-driver code, which can be written to support a well-defined API.
Disadvantages
It might be difficult to capture the functionality of certain devices within the context of the file access API, thereby resulting in either:-
- Loss of functionality or a loss of performance.
- Some of this could be overcome by the use of the ioctl operation that provides a general-purpose interface for processes to invoke operations on devices.
4. Describe whether it is possible for the user to develop a new command interpreter using the system-call interface provided by the operating system. Explain your answer.
Answer:
It is possible
- The command interpreter allows a user to create and manage