Operating System Structures Flashcards

0
Q

Describe 2 approaches to operating system user interfaces

A

1) Command line interface. Usually implemented as a special program running when user initiate it or on start. The command line may have all the code for handling all the possible commands as part of the program or alternatively look for program in search path when user input something. The latter is approach taken by unix and is more extensible.
2) GUI interface begins appearing in the 1980s and is the most prevalent way to interact with operating systems these days.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

Explain how we can view operating system as a service provider.

A
  • Operating system is basically a provider of environment where user applications can run. It’s needed because hardware by itself cannot do this.
  • As such, operating system must provide services such as user interface, a way for program to execute, to start i/o operations, etc.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Describe what system calls are

A
  • System calls are basically the interface to services provided by the operating system, such as printing to screen, reading input, and writing output.
  • System calls are typically implemented in C or assembly code, but application developers rarely access these system calls directly.
  • Instead, most programming languages provide an API that hide the complexity of these system calls. In addition, this has the benefit of allowing program to be written only once as long as different os provide the same API. Implementation of system calls can differ.
  • The way these API is implemented often involves first putting parameters. in registers, or main memory, or stack, before doing actual service calls. This way, cpu can actually access these parameters.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe various types of system calls provided by operating systems.

A
  • Process management. Os must allow applications to make system call to end or abort the program. In addition, applications should be able to create another process, change attributes on the new process, and terminate it. Application should also be able to make system call to wait for events from process it created or wait for periods of time before control returns.
  • File management. Allow applications to open, close, create, and delete files. Should also allow changing attributes on files.
  • I/O management. Very similar to file management. A lot of os actually make the two the same.
  • Information management. Allow applications to get information about the system like current time and date, dump memory, or amount of time spent on an instruction.
  • Communication. Allow process to talk to another process either by sending messages or by sharing certain areas of memory. Sending messages are easier with no contention problems but not as fast as sharing areas of memory.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Describe what system programs are

A
  • In computer hierarchy, we have hardware, then operating system on top of hardware, followed by system programs or system utilities
  • These are programs that come with operating system that provide convenient environment for program development, management and execution
  • Examples include programs to create file, edit file, get status, background service, etc.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Describe how operating systems can be structured.

A
  • Layered approach. Separate functions into layers with the upper layer only able to use the interface provided by layer right below it. This makes it easy to debug, since we can debug from bottom up making sure each layer does the right thing. Drawback is this tends to be bad for performance and sometimes hard to figure out which functions belong in which layer.
  • Microkernel approach. The kernel itself only has small amount of absolutely necessary functionalities like cpu scheduling, memory management, and message passing, everything else is created as system programs asking kernel to pass message to other system programs. This is easy to maintain and extend but bad for performance.
  • Modules approach. This is pretty similar to microkernel approach. Kernel has the smallest amount of necessary things but other modules can be dynamically linked in either at run time or when os loaded.
  • Hybrid. Most modern os takes a combination of these approaches.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Explain what operating system generation or sysgen is.

A
  • Operating systems are usually written to be generic, but it must run on variety of cpu, memory available, partitions, etc.
  • The process of making os specific is called sysgen and is usually done through one of the following:
    1) Compile the operating system to be specific to hardware
    2) Have operating system contain tables for modules specific to each hardware and link it in after getting user input on installation.
    3) Have operating system contain table at runtime and load at runtime.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly