Miscellenia

As-of-yet unorganized information from lecture.

Deadlock (?)

Example: Terminating a stuck process

Suppose we have a process that is infinitely looping.

To prevent a deadlock, the computer can set a timer to interrupt the computer after some time n.

Remember: One of the goals is to distribute resources equally.

Services

We want system calls for stuff like

User Interfaces

User Interface: Almost all OSes have a user interface (UI)

Program Execution: System must be able to load a program into memory, run that program, and end (normally or abnormally).

I/O: A running program may require I/O, which may involve a file or an I/O device.

II.

File System Manipulation: Read/write, create/delete, ls, permissions.

Communication: Exchange info on same computer or between computers.

Error Detection: OS should take appropriate action to ensure corret and consistent computing

Resource Allocation

Functions for resource sharing.

Resource Sharing: When multiple users/jobs run concurrently.

Accounting: Keep track of which users use how much and what kinds of resources.

Protection and Security:

CLI

Command Interpreter: Allows direct command entry.

Example: Built-in and not built-in commands
  1. Some commands may be implemented in the OS, translating straight into system calls.
write(...)
  # implementation here
read(...)
  # implementation here
  1. (More popularly), we modularize the definition, and the OS only provides an interface.
write(...)
  # interface
read(...)
  # interface

GUI

You know what a GUI is.

System Call Implementation

TODO Add this to previous

System calls can be:

  1. defined in the main body of the kernel, or
  2. loaded in main memory

Typically a number is associated with each system call.

System-Call Interface: