Chapter Objectives
- To describe the services and operating system provides to users, processes, and other systems.
- To discuss the various ways of structuring an OS.
- To ex explain how operating systems are installed and customised and how they boot.
It can be implemented via shared memory or through message passing.
Keep track of which users use how much and what kinds of computer resources.
System calls provide an interface to the services made available by an operating system.
Three of most common APIs for applications to use system calls:
Benefits from using API calls instead of direct system calls:
When parameters are more than registers, we have 2 ways:
Though Java is designed to run on platform-neutral systems, it is still able to make system call instead of being limited by JVM. This mechanism is called Java Native Interface(JNI). It, via declared native methods, can invoke C/C++ codes to invoke system calls. When the native method is used, the Java program is no longer considered as portable.
6 categories(roughly)
This question is related to the problem of whether the existing program is lost, saved, or allowed to continue execution concurrently with the new program.
Before the invocation
When new processes are created
We should able to control the newly-created process(es):
Waiting the processes finish
When multiple processes share data
we need to lock shared data preventing another process from accessing the data until the lock is removed
There are two common models of interprocess communication: the message-passing model and the shared-memory model.
message-passing model
the communicating processes exchange messages with one another to transfer information
Before communication can take place, a connection must be opened.
shared-memory model
Protection
Hardware->OS->System Programs->Application Programs
As is true in other systems, major performance improvements in operating systems are more likely to be the result of better data structures and algorithms than of excellent assembly-language code. In addition, although operating systems are large, only a small amount of the code is critical to high performance; the memory manager and the CPU scheduler are probably the most critical routines. After the system is written and is working correctly, bottleneck routines can be identified and can be replaced with assembly-language equivalents. (Bottlenecks are discussed further later in this chapter.)
A system can be made modular in many ways. One method is the layered approach, in which the operating system is broken into a number of layers (levels). The bottom layer (layer 0) is the hardware; the highest (layer N) is the user interface.
Advantages:
Difficulty
a function could be required in different layers
e.g.
The backing-store driver would normally be above the CPU scheduler, because the driver may need to wait for I/O and the CPU can be rescheduled during this time. However, on a large system, the CPU scheduler may have more information about all the active processes than can fit in memory. Therefore, this information may need to be swapped in and out of memory, requiring the backing-store driver routine to be below the CPU scheduler.
layered implementations tends to be less efficient than other types
Modularize the massive kernel into smaller one by moving nonessential components into user-level programs.
The main function of the microkernel is to provide a communication facility between the client program and the various services that are also running in user space.
Pros: ease of extending the OS. New services are added to user space and do not need the modification of the kernel.
Cons: Need to invoke message passing to communicate between kernel and user-level programs. Suffer from performance decreases due to increased system function overhead.
Perhaps the best current methodology for operating-system design involves using object-oriented programming techniques to create a modular kernel.
Structure:
Kernel with additional, dynamically loadable modules.
The overall result resembles a layered system in that each kernel section has defined, protected interfaces; but it is more flexible than a layered system in that any module can call any other module.
The approach is like the microkernel approach in that the primary module has only core functions and knowledge of how to load and communicate with other modules; but it is more efficient, because modules do not need to invoke message passing in order to communicate.
Abstracted layered structure that produce the illusion that the virtual machines have their own processors and memory.
The virtual machine runs in user mode on the physical machine. In the mean while, the virtual machine itself must have (virtual) kernel mode and (virtual) user mode.
We refer to it as a technology rather than just a programming language because it provides more than a conventional programming language. Java technology consists of two essential components:
- Programming-language specification
- Virtual-machine specification