Professional Documents
Culture Documents
Services of OS Services of OSProgram execution:The system must be able to load a program into
memory and to run that program. The program must be able to end its execution, either normally or
abnormally (indicating error).I/O Operations:A running program may require I/O, which may involve
a file or an I/O device.For specific devices, special functions may be desired (such as recording to a
CD or DVD drive). For efficiency and protection, users usually cannot control I/O devices directly.
File-system:The file system is of particular interest. Obviously, programs need to read and write files
and directories.They also need to create and delete them by name, search for a given file, and list
file information. Error detection:The operating system needs to be detecting and correcting errors
constantly. Errors may occur:in the CPU and memory hardware: such as a memory error or a power
failure. In I/O devices:such as a parity error on disk, a connection failure on a network, or lack of
paper in the printer. Resource allocation: When there are multiple users or multiple jobs running at
the same time, resources must be allocated to each of them. The operating system manages many
different types of resources. Some (such as CPU cycles, main memory, and file storage) may have
special allocation code. Accounting: We want to keep track of which users use how much and what
kinds of computer resources Protection and security: Protection: The owners of information stored
in a multiuser or networked computer system may want to control use of that information
Protection involves ensuring that all access to system resources is controlled. Security: Security of
the system from outsiders is also important. Such security starts with requiring each user to
authenticate himself or herself to the system, usually by means of a password, to gain access to
system resources. Command Interpreters Some operating systems include the command
interpreter in the kernel. Others, such as Windows and UNIX, treat the command interpreter as a
special program that is running when a job is initiated or when a user first logs on. On systems with
multiple command interpreters to choose from, the interpreters are known as shells Shell is an
environment in which we can run our commands, programs, and shell scripts. There are different
flavors of a shell, just as there are different flavors of operating systems. For example, on UNIX and
Linux systems, a user may choose among several different shells, including the Bourne shell, C-shell,
Bourne-Again shell, Korn shell, and others. Graphical User Interfaces Here, rather than entering
commands directly via a command-line interface, users employ a mouse-based window and menu
system characterized by a desktop metaphor. The user moves the mouse to position its pointer on
images, or icons, on the screen (the desktop) that represent programs, files, directories, and system
functions Command Line Commands (Activity) driverquery – Lists All Installed Drivers. systeminfo –
Shows Your PC's Details. ping – Shows a Website IP Address, Lets you Know How Long it Takes to
Transmit Data and a Get Response. color attr – Changes the Text Color of the Command Prompt Cls –
Clear Screen powercfg /batteryreport – Check the battery health. start website-address – Logs on to
a Website from the Command LineDifference between System Call and Interrupt: A system call is
call by software running on the OS to services provided by the OS. An interrupt is usually external
hardware component notifying the CPU/Microprocessor about an event that needs handling in
software (usually a driver). Routine: In computer programming, a routine is nothing but a sequence
of code, intended for the execution of user programs and input/output operations. It can range from
a subroutine, co-routine to a function. It is called repeatedly by other codes, during the execution of
a program. Process: The process is a program in execution and represents the basic unit of CPU
utilization. A process is an active entity that is created when an executable file gets loaded into the
main memory for execution.Scenario of System Call Writing a simple program to read data from one
file and copy them to another file. The first input that the program will need is the names of the two
files: the input file and the output file. These names can be specified in many ways, depending on
the operating-system design. One approach is for the program to ask the user for the names. In an
interactive system, this approach will require a sequence of system calls. First to write a prompting
message on the screen and then to read from the keyboard the characters that define the two files.
An application programming interface (API) is code that enables two software programs to
communicate. An API defines how a developer should request services from an operating system
(OS) or other application, and expose data within different contexts and across multiple channels.
Api 2 benefit One benefit concerns program portability. An application programmer designing a
program using an API can expect his/her program to compile and run on any system that supports
the same API Actual system calls can often be more detailed and difficult to work with than the API
available to an application programmer. The caller 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. Managed by run-time support library (set of functions
built into libraries included with compiler) Three general methods used to pass parameters to the
OS 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 Types of System Calls Process
Control A running program needs to be able to end its execution either normally (end()) or
abnormally (abort()). Process control system calls include end, abort load, execute create process,
File Management File management system calls include create file delete file Open Close Read
Device Management Device management system calls include request device release device read,
write, reposition get/set device attributes Information Maintenance Information maintenance
system calls include calls to get/set the time, date, system data, and process, file, or device
attributes. Communication Communication system calls create/delete communication connection
send/receive messages transfer status information Protection Protection provides mechanisms for
controlling which users / processes have access to which system resources. System calls allow the
access mechanisms to be adjusted as needed, and for non-priveleged users to be granted elevated
access permissions under carefully controlled temporary circumstances File modification &
Programming-language support File modification: Several text editors may be available to create
and modify the content of files stored on disk or other storage devices. There may also be special
commands to search contents of files or perform transformations of the text. Programming-
language support Compilers, assemblers, debuggers, and interpreters for common programming
languages (such as C, C++, Java, and PERL) are often provided with the operating system or available
as a separate download. Microkernels The basic idea behind micro kernels is to remove all non-
essential services from the kernel, and implement them as system applications instead, thereby
making the kernel as small and efficient as possible. Most microkernels provide basic process and
memory management, and message passing between other services, and not much more.