Operating system organization (week 2) Flashcards
what does an operating system provide
provides an environment for the safe and secure execution of application programs while doing it in an efficient and fast manner.
operating systems are organized along 2 different lines which are ?
–> those that provide convenience for the user/program
–> those that ensure efficient operations of the system
what are the 6 services that provide convenience for user/program
–> user interface (Batch interface, CLI, GUI)
–> program execution (load, run & terminate the program)
–> Input/Output operation (file, cd/DVD, smartcard)
–> File system manipulation (create, read, write files and permission management)
–> Communications (Local/remote inter-process communication)
–> Error detection (able to detect error and take proper action)
what are the 3 services that provide
–> Resource allocation
–> Accounting
–> Protection and security
what is resource allocation
–> Resources to be allocated among multiple users fairly
–> Different algorithms are used to properly allocate different resources
what is accounting
–> Keep track of usage statistics eg CPU, Printer, Harddisk quota
–> Reconfigure system to improve computing services
what is protection and security
–> security of the system from outsiders
–> ensures that access to all system resources is controlled
–> audit trail must also exist so that people can find out what happened
what are the 4 core functions of the OS
–> device management
–> process, thread, and resource management
–> memory management
–> file management
Based on the four functions (device management, process, thread and resource management, memory management, and memory management ), the modern OS
implements________, which provides
__________ to the respective resource that they
manage.
4 major managers
abstractions
there is ___________ interaction between the 4 major managemers
close
what is device management?
–> it refers to the way the generic devices are handled
–> special management approaches for processor and memory
–> partitioning design simplifies adding and upgrading devices
what is process, thread and resource management
–> creates abstractions of processes, threads, and resources.
–> allocates processor resources equitably
–> allocates and tracks abstract resources such as queues, semaphores, and messages.
–> cooperates with the memory manager to administer the primary memory
what is memory management
–> administer and allocate primary memory
–> enforces resource isolation
–> enables sharing between processes
–> provides virtual memory extensions (abstract machine’s memory appears larger than physical memory)
what is memory management?
–> administer and allocate primary memory
–> enforces resource isolation
–> enables sharing between processes
–> provides virtual memory extensions (abstract machine’s memory appears larger than physical memory)
what is file management
–> creates abstractions of storage devices
–> range from byte stream files to indexed records
–> file system should also allow users to access local and remote files over the internet
how does OS manage resource sharing
–> time/space multiplex sharing (use this where appropriate)
–> Exclusive use of a resource (Allow processes to use a resource exclusively as required.)
–> Isolation (Allow a resource to save information without fear of it being modified or tampered with.)
–> managed sharing (sharing must be done in an orderly fashion according to the properties of the resource)
what are the 3 mechanisms to address isolation and sharing
–> processor modes
–> kernels
–> method of invoking system service
what are processor modes
–> processor modes help to distinguish between trusted and untrusted software
–> Determine execution capability and accessible
memory areas
what are 2 modes that modern processors provide
supervisor mode
user mode
what is supervisor mode (for OS)
–> it can execute all machine instructions
–> can reference all memory locations
what is user mode (for user programs)
–> can execute a subset of instructions
–> Can only reference a subset of memory locations
The processor in supervisor mode can execute all
instructions including __________ instructions
privileged
privileged instructions are also called ?
supervisor/protected instructions
Examples of privileged instructions are ?
–> I/O instructions
–> Memory-related instructions
–> Processor mode-change instructions
Processor in user mode can execute only __________ instructions.
nonprivileged
Processor in supervisor mode can access ______ and _______
memory locations
system and user space
what is system space
refers to the memory area used by the
OS
what is user space
refers to the memory area used by
application processes
processor in user mode can only access ______
user space
trusted os software executes in the ______
supervisor mode
All other software (including some parts of the
OS) executes in __________
user mode
what is concept
allows for OS to be able to control
access to resources
how does concept work
–> User programs have to ask the OS to execute
privileged instructions on their behalf.
–> Any particular configuration can isolate or
permit sharing or resources according to the
administrator’s policy
what is a kernel
–> part of the OS critical to correct
operation (trusted software)
how does a kernel work?
–> Implements the basic mechanisms that
assure secure operation of the entire OS
–> Executes in supervisor mode
–> The trap instruction is used to switch from
user to supervisor mode, entering the OS
what is a trap table
–> a reference table
–> user program will get permission from the kernel and indicate which trap instruction is needed to execute
what are routines
In order to execute privileged instructions,
user programs have to activate routines in
the kernel, which can then execute on the
user programs’ behalf.
what are 2 techniques to request services from os
system call
message passing
what is a system call
–> In a system call, the relevant function is activated via a
trap instruction.
–> OS provides a stub function which the user program
calls
–> Stub function will switch the processor to the supervisor
mode
–> It will execute the trap instruction by branching to a
trap table to the entry point of the system function to be
invoked
–> On completion, processor is switched back to user
mode and control returns to user process
–> Appears as ordinary function call to the application
programmer
what is message passing
–> In the message passing method, the user program
constructs a message that requests the desired
service.
–> Uses OS send() system call
–> OS kernel implements target function
–> Kernel process must be started or active i.e. must be in
supervisor mode, to receive message
–> User process waits for result with receive()
operation
–> Kernel sends message back to user process on
completion
In system call, the user process/thread gains
ability to execute ____________
privileged instructions
In the message-passing method, the system function is executed by the ________
kernel process/thread
why are System calls more efficient than message
passing.
–> Message passing has cost of message
formation/copying and process multiplexing
–> System calls just requires a trap command.
Most modern systems use _________
system calls
what is a modular os architecture
implements each manager in its own software module
Interaction among various managers via abstract data
type
what is monolithic kernel implementation
Four basic modules are combined into a single software module
what is the Microkernel approach
–> Employs a small kernel that implements only the essential and critical functions
–> Reminder functions are implemented outside the kernel, possibly in separate modules
disadvantage of modular os
Frequent calls incur performance penalty
Sacrifice modularity for performance
why I/O and memory instructions are privileged instructions.
The OS is solely responsible for managing the memory and IO devices.
User programs can only execute non-priveleged instructions. Thus, having I/O and memory instructions privileged ensures that user programs cannot directly manipulate the memory or the devices.
Suggest some reasons why UNIX is a monolithic kernel.
In the early days of computing, it is much more efficient to lump the code for the various managers together.
Combining the code does not require abstractions between the managers, thus reducing unnecessary code.
The various managers’ tasks require a high level of interaction among them. Coupling them into a single code enables that interaction to be done efficiently.
what is resource abstraction
hides the actual tasks needed to use the computer resources to use the computer resources by providing simpler commands for user programs
What are some of the factors that differentiate between the time to do a normal procedure call from an application program to one of its own procedures, compared to the time it takes to perform a system call to an OS procedure?
–> In normal procedure call, the ‘jump’ from the main program to the procedure is within the user space. The processor need NOT change mode. Thus, it is simpler and takes a shorter time.
–> A system call requires the processor to change mode. The processort also has to ‘jump’ from the user program to the relevant trap function. The trap table needs to be consulted to find the correct trap function to execute. All these functions involve more operations, hence is more complex and takes a longer time.
windows NT is a ________
microkernel implementation