Week 2 on OS Flashcards
-provide an environment for execution of programs and services to programs and users.
operating systems
(operating system services)
-almost all operating systems have this…
-it varies between: command-line (CLI), Graphics User Interface (GUI), touch-screen, batch.
user interface
(operating system services)
-the system must be able to load a program into memory and to run that program, end execution, either normally or abnormally (indicating error).
program execution
(operating system services)
-a running porgram may require I/O, which may involve a file or an I/O device.
I/O Operations
(operating system services)
-the file system is of particular interest. Porgrams need to read and write files and directories, create and delete them, search them, list file information, permission management.
file-system manipulation
(operating system services)
-processes may exchange information, on the same computer or between computers over a network
-may be via shared memory or through message passing (packets moved by the OS).
communications
(operating system services)
-OS needs to be constantly aware of possible errors.
-may occur in the CPU and memory hardware, in I/O devices in user program
-for each type of error, OS should take the appropriate action to ensure correct and consistent computing.
error detection
(operating system services)
-when multiple users or multiple jobs running concurrently, resources must be allocated to each of them.
-many types of resources- CPU cycles, main memory, file storage, I/O devices.
resoruce allocation
(operating system services)
-to keep track of which users how much and what kinds of computer resources.
logging
(operating system services)
-the owners of information stored in a multiuser or networked computer system may want to control use of that information, concurrent processes should not interfere with each other
protection and security
(operating system services | protection and security)
-involves ensuring that all access to system resources is controlled.
protection
(operating system services | protection and security)
-_of the system from outsiders required user authentication, extends to defending external I/O devices from invalid access attempts.
security
-allows direct command entry
-sometimes implemented in kernel, sometimes by systems program.
-sometimes multiple flavors implemented -shells
-primarily fetches a command from user and executes it.
-sometimes commands built-in, sometimes just names of programs.
–if the latter, adding new features doesn’t require shell modification.
command line interpreter
(user operating system interface)
-usually mouse, keyboard, and monitor
-icons represent files, programs actions, etc.
-various mouse buttons over objects in the interface cause various actions (poivide information, options, execute function, open directory known as a folder).
user-friendly desktop (metaphor interface)
-mouse not possible or not desires
-actions and selection based on gestures
-virtual keyboard for text entry.
-voice commands.
touchscreen interfaces
-programming interface to the services provided by the OS
-typically written in a high-level language (C or C++).
-a number is associated with each of these
-mostly accessed by programs via a high-level Application Programming Interface (API) rather than direct system call use.
-three most common APIs are Windows, POSIX API for POSIX-based systems (including virtually all versions of UNIX, Linux and Mac OS), and Java API for the Java virtual machine (JVM).
system calls
-to copy the contents of one file to another file
system call sequence
a program that uses this function must include the unistd.h header file, as this file defined the ssize_t and size_t data types.
read ()
(parameters passed to read () | write)
-the file descriptor to be read
int fd
(parameters passed to read () | write)
-a buffer into which the data will be read
void *buf
(parameters passed to read () | write)
-the maximum number of bytes to be read into the buffer.
size_t count
-maintains a table indexed according to these numbers
-invokes the intended system call in OS kernel and returns status of the system call and any return values.
system call interface
-need know nothing about how the system call is implemented,
-just needs to obey API and understand what OS will do as a result call
-most details of OS interface hidden from programmer by API.
caller
-more information is required than simply identity of desired system call.
–exact type and amount of information vary accoridng to OS and call.
General Methods:
simplest: pass the parameters in registers
–in some cases, may be more parameters than registers.
parameters stored in a block, or table, in memory, and address of block passed as a parameter in a register.
–this approach taken by Linux and Solaris
-parameters placed, or pushed, onto the stack by the program and popped off the stack by the operating system.
-Block and stack methods do not limit the number or length of parameters being passed.
system call parameter passing
(types of system calls)
-create process, terminate process
-end, abort
-load, execute
-get process attribute, set process attributes
-wait for time
-wait event, signal event.
-allocate and free memory
-dump memory if error
-
process control
(types of system calls | process control)
-for determining bugs, single step execution
debugger
(types of system calls | process control)
-for managig access to shared data between processes
locks
(types of system calls)
-create file, delete file
-open, close file
-read, write, reposition
-get and set file attributes
file management
(types of system calls)
-request device, release device
-read, write, reposition
-get device attrivutes, set device attributes
-logically attach or detach devices
device management
(types of system calls)
-get time or date, set time or date
-get system data, set system data
-get and set process, file, or device attributes
information maintenance
(types of system calls)
-create, delete communication connection
-send, receive messages if message passing model to host name or process name
-from client to server
communications
(types of system calls | communications)
-create and gain access to memory regions
-transfer status information
-attach and detach remote devices
shared-memory model
(types of system calls)
-control access to resources
-get and ser permissions
-allow and deny user access
protection
-provides a portion of the system-call interface for many versions of UNIX and Linux.
standard C library
-single tasking
-no operating system
-programs (sketch) loaded via USB into flash memory
-single memory space
-boot loader loads program
-program exit -> shell reloaded
arduino
-unit variant
-multitasking
-user login -> invokde user’s choice of shell
-shell exectes fork () system call to create process
–executes exec () to load program into process
–shell waits for process to terminate or continues with user commands.
-process exits with
code=0 noerror
code> 0 error code
FreeBSD
-provide a convenient environment for program development and execution.
–file manipulation
–status information sometimes stored in a file
–programming language support
-program loading and execution
–communications
–background services
–application programs
system services
(system services)
-create, delete, copy, rename, print, dump, list and generally manipulate files and directories.
file management
(system services)
-some ask the system for infor - date, time. amount of available memory, disk space, number of users.
-other provide detailed performance, logging, and debugging information
-typically, these programs format and print the output to the terminal or other output devices.
-some systems implement a registry - used to store and retrieve configuration information.
status information
(system services)
-test editors to create and modifiy files
-special commands to search content of files or perform transformations of the text.
file modification
(system services)
-compilers, assemblers, debuggers and interpreters sometimes provided.
programming-language support
(system services)
-absolute loaders relocatablw loaders, linkage editors, and overlay-loaders, debugging systems for higher-level and machine language.
program loading and execution
(system services)
-provide the mechanisms for creating virtual connections among processes, users, and computer systems
–allow users to send messages to one another’s screens, browse web pages, send electronic-mail messages, log in remotely, tranfer files from one machine to another.
communications
(system services)
-launch at boot time
–some for system startup, then terminate
–some from system booth to shutdown.
-provide facilities like disk checking, process scheduling, error logging, printing.
-run in user conext not kernel context
-known as services, subsystems, daemons
background services
(system services)
-don’t pertain to system
-run by users
-not typically considered part of OS
-launched by command linne, mouse click, finger poke
application programs
source code compiled into object files designed to be loaded into any physical memory location
relocatable object file
combines these into single binary executable file
-also brings in libraries
linker
-programs must be brought into memory by this to be executed
loader
-assigns final addresses to program parts and adjusts code and data in porgram to match those addresses.
relocation
are loaded as needed, shared by all that use the same version of that same library (loaded once).
dynamically linked libraries
-compiled on one system usually not execuatable on other operating systems.
-can be multi-operating system
-written in interpreted langugae like Python, Ruby and interpreter available on multiple operating systems.
-wirtten in language that includes a VM containing the running app.
-use standard language (like C), compile separately on each operating system to run on each.
apps
-is architecture equivalent of API, defines how different components of binary code can interface gor a given operating system on a given architecture, CPU, etc.
application binary interface (ABI)
(design and implementation)
-operating system should be convenient to use, easy to learn, reliable, safe, and fast.
user goals
(design and implementation)
-operating system should be easy to desigm, implement, and maintain, as well as flexible, reliable, error- free, and efficient
system goals
-specifying and designing an OS is a highly creative task of…
software engineering
what needs to be done?
ex:interrupt after every 100 seconds
policy
-how to do something?
ex: timer
mechanism
-much variation
-actually usuallya mix of languages
-more high-level language easier to port to other hardware
implementation