11/12 11/6 OS作業

名稱
11/6 OS作業
日期
11/12
課程名稱
作業系統
指導教師
劉艾華
心得
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?

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

(2)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.

(1)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.

(2)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?

(1)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.

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