Operating Systems Structures

studied byStudied by 5 people
5.0(1)
learn
LearnA personalized and smart learning plan
exam
Practice TestTake a test on your terms and definitions
spaced repetition
Spaced RepetitionScientifically backed study method
heart puzzle
Matching GameHow quick can you match all your cards?
flashcards
FlashcardsStudy terms and definitions

1 / 67

flashcard set

Earn XP

Description and Tags

- What are the key services of an operating system? - What are the main approaches that users, processes and other systems use to access operating system services? - What are system calls? - What are system programs?

68 Terms

1
what is an operating system?
provides an environment which programs execute within
New cards
2
what does the operating system provide services for?
  • to programs → OS manages resources and executes programs

  • to users

New cards
3
what is the logical computational hierarchy in a system
hardware is lowest → then OS → system and application programs
hardware is lowest → then OS → system and application programs
New cards
4
what are operating system services?
services that the OS provides to either help users or improve efficiency

these are 9 common classes of OS services, even if specific services differ between OS to OS
New cards
5
out of the 9 OS services, which services help the individual user?
user interface (UI)

program execution

I/O operations

file system manipulation

communications

error detection

\
\[UP IF CE\]
New cards
6
out of the 9 OS services, which ensure the system operates efficiently?
resource allocation

accounting

protection and security
New cards
7
in what scenario are services needed to ensure the system operates efficiently?
systems with multiple users can share computer resources among the users to be more efficient
New cards
8
what is the user interface (UI) service?

almost all OS have a UI:

  • command line interface - text commands in specific format

  • batch interface (systems can communicate, instructions written in a file and the file is executed)

  • graphical user interface - a window system and I/O devices

systems can have both CLI and GUI - (FreeBSD only has command line interface- therefore has less file size overall compared to the Ubuntu devices)

New cards
9
what is the program execution service?

OS responsible for

  • loading program into memory

  • allocating memory

  • executing program

  • terminating program normally or abnormally (indicates error)

New cards
10
what is the I/O operations service?
  • process may need I/O which may involve a file or an I/O device (screen)

  • OS lets users control I/O since users can’t control them directly

New cards
11
what is the file system manipulation service?
  • programs need to

    • read and write files to directories

    • create and delete

    • search

    • move

    • view file info

  • some OS can include permissions to allow or deny access

New cards
12
what is the communications service?
  • OS can manage process communication (processes wanting to share information) if they are on the same computer or they are executing on different computers on the same network

  • communications can be implemented using

    • shared memory → 2 or more processes can read and write to a shared section of memory

    • message passing → packets in predefined formats are moved between the processes and the OS

New cards
13
what is the error detection service?
  • OS can detect and correct errors

  • errors can occur in

    • memory hardware - memory error or power failure

    • I/O devices - parity error on disk, connection failure in network, no paper in printer

    • user program - arithmetic overflow, access illegal memory location, too much CPU time

  • to correct the errors the OS can

    • halt the system

    • terminate the error causing process

    • return an error code to the process so the process can detect and self correct

New cards
14
what is the resource allocation service?
  • can have multiple users / processes running concurrently and resources need to be allocated to all

  • can be special allocation code (CPU cycles, main memory) or general allocation code (I/O devices) which consider different factors when allocating

    • e.g. CPU-scheduling routine which considers CPU speed, number of registers etc.

  • can be routines to allocate peripheral devices like printers

New cards
15
what is the accounting service?
  • track which user is active, what computer resources users access and use

  • useful if many users use the same machine

  • useful in cloud resources, accounting to bill users, gathering statistics

New cards
16
what is the protection and security service?
  • people who own information in multiuser/ networked systems want to control the information use

  • one process should not be able to interfere with the OS or other processes

  • protection = ensure all access to system resources is controlled + protection against external attacks (eg. DDOS)

  • security = protect the system from outsiders access via user authentication, defending I/O devices from invalid access attempt

New cards
17
what are the 3 main parts of the operating system?
kernel

shell

utilities
New cards
18
what is the kernel?
where the services run in the OS (and thus where system calls occur), users and programs can’t interact here directly
New cards
19
what is the shell?
around the kernel, where the command interpreter is and where users can access services from the kernel (user accesses services though shell and not directly). interprets the commands
New cards
20
what are utilities?
helps OS provide the services that it provides
New cards
21
what are the main ways users can access the operating system services?
  • command line interface (aka. command interpreter)

  • graphical user interface (GUI)

New cards
22
how does a command line interface work?

the command interpreter eg. windows CMD (CLI) exists on the UI and allows users to directly enter commands to be performed by OS

  • can be implemented in the kernel or via a special program

  • CLIs are also called shells

  • CLI function → get the user command, send it to OS and execute it e.g. manipulate files

  • commands be implemented in 2 ways

    • commands are built-in and the command interpreter goes to prewritten code and makes a system call

    • command interpreter identifies files or programs to run with the command name

  • can use shell scripting to produce useful OS programs called Batch Files

New cards
23
what are batch files?
collections of CLI commands that run together to do different tasks (different tasks exist for windows vs. Linux machines). don’t need to be compiled and executed as the command line can interpret them
New cards
24
how does a graphical user interface work?
  • is a user-friendly desktop metaphor based interface

  • has mouse, keyboard, monitor

  • icons to represent files, programs and actions

  • various mouse actions over the objects in the interface can do actions (eg. provide info, options, execution function)

  • could also be touchscreen interface for phones with gestures

New cards
25
how does a command line interface compare with a graphical user interface?
  • command line more efficient and more functionality, batch files can be created for efficiency

  • gui is user friendly

New cards
26
what is a system call?
  • a request by a process made via an interface for a service to be performed by the kernel.

  • system calls provide an interface to the OS services

  • structured like functions with parameters and return values written in C and C++

New cards
27
how are system calls used during program execution?

for a program to execute the OS needs to

  • load program into memory (disk space)

  • run the program

  • manage input and output

  • terminate execution normally or abnormally (indicating error)

all these things can be managed with heavy use of system calls

<p>for a program to execute the OS needs to</p><ul><li><p>load program into memory (disk space)</p></li><li><p>run the program</p></li><li><p>manage input and output</p></li><li><p>terminate execution normally or abnormally (indicating error)</p></li></ul><p>all these things can be managed with heavy use of system calls</p>
New cards
28
what tools does an application developer use when they want to access OS services?
application programming interface (API)

run-time support system

system calls
New cards
29
what is an application programming interface? (API)
interface that allows programmers to access the kernel and *invoke system calls* on behalf of the programmer instead of directly
New cards
30
how does an API work?
  • the API is accessed via a run-time support library of code

  • specifies the set of functions that are available to the application programmer including the expected parameters and return values

  • the functions that the API invokes are what actually make the system calls

  • eg. java, writing to a file, needs to access a service that the system provides

New cards
31
what are the most common APIs?

Three most common APIs are

  • Win32 API for Windows

  • POSIX API for POSIX-based systems (including virtually all versions of UNIX, Linux, and Mac OS X)

  • Java API for the Java virtual machine (JVM)

New cards
32
why is using an API better for programmers than calling system calls directly?
  • program portability → any system can compile and run the program as long as the same API is used

  • direct system calls are detailed and difficult to manage without an API

New cards
33
what is a run-time support system/ runtime environment?
  • a set of functions structured as libraries (e.g. standard c library) included with the compiler which provides a system call interface.

  • different programming languages each have their own run-time support systems

New cards
34
what is a system call interface?
acts as the link between the API and the system calls made available by the OS
New cards
35
how does the system call interface work?
  • the system call interface intercepts the API function calls and invokes the necessary system call for the operating system

  • the OS gives each system call a number and system call interface maintains a table containing the system calls and their number

  • SCI invokes the intended system call in the kernel and passes the needed parameters to the system call

  • SCI returns the system call status and any return values to API

New cards
36
what does the caller need to know about system calls?
  • doesn’t need to know HOW the system call is implemented as most OS interface are details are hidden by the API and are managed by the RTE

  • just needs to follow the API and understand what the OS will do as a result of the call

New cards
37
what is the relationship between user application - api - system call interface - os?

USER APP → API → SYSTEM CALL INTERFACE → KERNEL (containing OS services)

  1. user application contains the API

  2. API calls system call interface

  3. system call interface can make system calls to the kernal and request OS services

  4. OS can return the variables as needed back to system call interface and then to API

<p>USER APP → API → SYSTEM CALL INTERFACE → KERNEL (containing OS services)</p><p></p><ol><li><p>user application contains the API</p></li><li><p>API calls system call interface</p></li><li><p>system call interface can make system calls to the kernal and request OS services</p></li><li><p>OS can return the variables as needed back to system call interface and then to API</p></li></ol>
New cards
38
how much information is needed when making a system call?

more information may be needed for the system call to function and not just the name of the system call

e.g.

  • memory length

  • source

  • file variables

pass these to the OS as parameters

New cards
39
how are parameters passed to the operating system?
registers

block/ table/ stack memory
New cards
40
how are registers used to pass parameters to the OS?
each parameter is stored in a register

simplest approach, but sometimes there may be more parameters than registers available
New cards
41
how are block/table/stack memory used to pass parameters to the OS?
the block memory address is passed as a parameter into the register. parameters are pushed to a stack by the program and popped from stack by operating system.

better as does not restrict the number of parameters
the block memory address is passed as a parameter into the register. parameters are pushed to a stack by the program and popped from stack by operating system.

better as does not restrict the number of parameters
New cards
42
how to system calls differ depending on the computer?
  • the names of system calls can vary

  • different OS show different things/ act differently even with the same set of system calls (eg. macOS vs. Windows vs. Linux)

New cards
43
what are the 6 major types of system calls?
process control calls

file management/ manipulation calls

device management/ manipulation calls

information maintenance calls

communication calls

protection calls

\
pirates found drums in CP
New cards
44
what are process control calls?
  • create() + terminate() process

  • load() + execute() process

  • get + set process attributes - e.g, job priority, can be used to controll a new process

  • wait + signal event - waits until execution done,, can wait certain amount of time or for signalled event

  • allocate + free memory - processes can lock data if it’s being shared to ensure data integrity

New cards
45
in process control calls, how does the terminateProcess() system call work?
  • if terminated abnormally with error, process will memory dump and error message generated. memory dump is written to a log file and examined by a debugger - system program designed to find errors

  • when terminated, OS transfers control to the invoking command interpreter.

    • command line - command interpreter reads next command and the user can react

    • gui - error pop up displayed

    • batch system - terminate whole job and go to next one

  • sometimes there is special recovery when errors happen

  • error levels can be defined for error input

New cards
46
in process control calls, how does the loadProcess() and executeProcess() system call work?
  • allows the command interpreter to execute a program as requested by user/ another program. loading a new program can be done in 2 ways:

  • if control returns to the existing process after the loaded one has finished then memory needs to be stored about the existing one

  • if the 2 process can run concurrently then a new process must be multiprogrammed

New cards
47
what are file management calls?
  • create() + delete() file - system calls the file name or file attribute

  • open() + close() file

  • read() + write() + reposition() file

  • get() + set() file attributes - including name, size

  • these functions can be used to organise directories in directory structure

  • other systems have move() and copy() functions

New cards
48
what are device management calls?
  • processes need resources (called devices) to execute e.g., main memory, disk drives, can be physical or virtual. if available resources are allocated but if not available the process waits

  • request() + release() (to free up) device

  • read() + write() + reposition() device

  • get() + set device attributes

  • logically attach or detach devices

  • if 2 processes want to access the same device (monitor, keyboard) a system call will request this service and the OS will schedule time for the I/O device

  • some systems merge the system calls for device management and file management as they’re similar

New cards
49
what are information maintenance calls?
  • exist to transfer information between user and os

  • get + set date or time

  • get + set system data (number of users)

  • dump() memory for debugging

  • provides time profile - time that program executes at a certain location, done using tracing facility or regular timer inturrupts

  • get() + set() process attributes

  • important for synchronising everything (including stuff mentioned above)

  • eg. want to access internet wont work with wrong date and time

New cards
50
what are communication calls

2 models of interprocess communication -

  • message-parsing model - processes communicate by sending messages which can be passed directly or indirectly through a common mail box. better for small messages as conflicts avoided and easy to implement

  • shared memory model - processes both access regions of memory to communicate

both use different system calls

New cards
51
how do system calls work for message parsing?
  • create() + delete() communication connection - must be opened for communication to happen and name of other communicator must be known (by host name/ IP address/ process name. using get_hostid()

  • accept_connection()

  • daemon - special system program that wait for connection, one for client and server using waitforconnection()

  • send + receive messages()

New cards
52
how do system calls work for shared memory model
  • sharedmemorycreate() - sharedmemoryattatch() to access regions of memory

  • can read() and write() to same area but not write to same location simultaneously

New cards
53
what are protection calls?
  • for protecting the access of resources provided by os

  • get() + setfilepermissions()

New cards
54
what is another name for system programs?
system utilities
New cards
55
what are system programs?
programs that provide convenient environment to develop and execute programs
New cards
56
what are the different purposes of system programs?
  • system programs to provide a user interface to system calls

  • complex system programs eg. device drivers

New cards
57
how do system programs access OS services?
making system calls
New cards
58
what are application programs?
programs that solve common problems or perform common operations eg. web browsers, work processors, games

\
New cards
59
what is a user’s view of the operating system defined by?
  • defined by the system programs and the application programs and not the system calls.

  • user can have different view depending on type of UI (gui, command, batch) but the system calls that function are the same

New cards
60
what are the different types of system programs?
file management programs

file modification programs

status information programs

program language support programs

program loading and executing programs

communications programs

background services
New cards
61
what are file management programs?

programs that generally access and manipulate files and directories

  • create

  • delete

  • copy

  • rename

  • print

  • list

New cards
62
what are status information programs?
  • programs that request, format and print information. e.g. to the terminal/ output device/ file/ display in the GUI window

  • simple versions - programs that request the date, time, amount of available memory, disk space, or other status information

  • complex version - request detailed performance info, logging and debugging information

  • can also support a registry which is used to store and retrieve configuration information

New cards
63
what are file modification programs?
  • programs such as text editors that can create and modify file contents stored on a disk or other device

  • can contain special commands to search file content or perform text transformations

New cards
64
who are program language support programs?
  • Compilers, assemblers, debuggers, and interpreters for common programming languages (such as C, C++, Java, and PERL)

  • could be included in an OS or download separately

New cards
65
what are program loading and execution programs?
  • Once a program is assembled or compiled, it must be loaded into memory to be executed

  • can provide loaders, linkers, debuggers, etc.

New cards
66
what are communication programs?
  • programs that provide the mechanism for creating virtual connections between processes, users, and computer systems

  • allow users to send messages to one another’s screens, browse Web pages, send e-mail messages, log in remotely, or to transfer files from one machine to another.

New cards
67
what are background services?
  • don’t see them running but if we inspect the process that are running we can see them

  • includes methods to launch system-program processes at boot time

  • background services can terminate after a task finishes or continue to run until system is halted

  • includes daemons

New cards
68
what are daemons?

services/ subsystems/ daemons - system programs that are constantly running, eg. network daemon, process schedulers, print servers.

  • a system can have multiple daemons.

  • the system needs to listen to network connections to connect requests to correct daemon.

  • daemons can also run important activities in the user context instead of the kernel

New cards

Explore top notes

note Note
studied byStudied by 1 person
808 days ago
5.0(1)
note Note
studied byStudied by 16 people
847 days ago
5.0(1)
note Note
studied byStudied by 30 people
704 days ago
5.0(1)
note Note
studied byStudied by 54 people
185 days ago
5.0(1)
note Note
studied byStudied by 181 people
919 days ago
5.0(2)
note Note
studied byStudied by 35 people
243 days ago
5.0(1)
note Note
studied byStudied by 3 people
51 days ago
5.0(1)
note Note
studied byStudied by 21 people
612 days ago
5.0(1)

Explore top flashcards

flashcards Flashcard (59)
studied byStudied by 3 people
147 days ago
5.0(1)
flashcards Flashcard (35)
studied byStudied by 10 people
549 days ago
5.0(1)
flashcards Flashcard (415)
studied byStudied by 6 people
631 days ago
4.0(2)
flashcards Flashcard (30)
studied byStudied by 5 people
701 days ago
5.0(1)
flashcards Flashcard (104)
studied byStudied by 117 people
371 days ago
5.0(1)
flashcards Flashcard (30)
studied byStudied by 29 people
423 days ago
5.0(2)
flashcards Flashcard (57)
studied byStudied by 17 people
707 days ago
5.0(1)
flashcards Flashcard (40)
studied byStudied by 35 people
4 minutes ago
5.0(1)
robot