11/12 11/6 OS作業

11/6 OS作業
1. Which situation is suitable to use message passing instead of shared-memory model for communication between processes? What are the pros and cons of using these two models?

(I)Message passing is useful when smaller numbers of data need to be exchanged,because no conflicts need to be avoided.

(II)The advantage of message passing is that it is easier to build massively parallel hardware. Message passing programming models tend to be more tolerant of higher communication latencies.

The disadvantage of message passing is requiring the explicit management of data and communication, the message passing paradigm has one intrinsic disadvantage that can be mitigated but not eliminated by good interface design: the presence of higher endpoint costs in message passing models as compared to shared memory.

The advantage of shared memory model is that the programming for IPC becomes simple in the sense that we simply write and read to an address pointer available in the our process address space. We need not use system calls like write and read. The updations to the kernel resident shared memory object is done by the kernel asynchronously. It saves lot of time compared to write and read because in write and read lot of switching should take place between user mode to kernel mode vice versa.

The disadvantages of shared memory for computer graphics include slower speeds and reduced availability of resources. This is used by the on-board video card in many computers as a way of lowering costs.

2. What is “system calls?” Please specify the functions and the purposes of a system call in a computer system.

(I)System calls provide an interface to the services made available by an operating system.These calls are generally available as routines written in C and C++,although certain low-level tasks(for example,task where hardware must be accessed directly) may have to be written using assembly-language instruction.

(II)System programs provide basic functioning to users so that they do not need to write their own environment for program development (editors, compilers) and program execution (shells). In some sense, they are bundles of useful system calls.System calls allow user-level processes to request services of the operating system.

3. Please specify different ways for using the hardware configuration during the system generation (SYSGEN). What are the major differences between these different ways?

(I)Hardware configuration information can be used in several ways:
Used to modify a copy of the source code of the OS and have it re-compiled.
Used to create tables and modules from a precompiled library. The needed modules are linked together to form the generated OS. Construct a system that is completely table driven. All the code is always part of the system, and selection occurs at execution time.

(II)The size and generality of the generated system and the ease of modification as the hardware configuration changes.