Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Operating-System Structures
Chapter 2: Operating-System Structures
– Error Detection
• OS needs to be constantly aware of possible errors
– may occur in the CPU and memory, in I/O devices, in user program
• For each type of error, OS should take the appropriate action
to ensure correct and consistent computing
• Debugging facilities can greatly enhance the user’s and
programmer’s abilities to efficiently use the system
Operating System Services
• Another set of OS functions exists for ensuring the
efficient operation of the system itself via resource
sharing
– Resource allocation
• When multiple users or multiple jobs running concurrently,
resources must be allocated to each of them
• Many types of resources
– Some (such as CPU cycles, main memory, and file storage) may have
special allocation code.
– Others (such as I/O devices) may have general request and release
code.
– Accounting
• To keep track of which users use how much and what kinds of
computer resources
• Accumulating usage statistics
• Usage statistics may be a valuable tool for researchers who
wish to reconfigure the system to improve computing services.
Operating System Services
• Another set of OS functions exists for ensuring the
efficient operation of the system itself via resource
sharing
• Because a mouse is
impractical for most mobile
systems, smartphones and
handheld tablet computers
typically use a touchscreen
interface.
• Touchscreen devices
require new interfaces
Virtual keyboard for text entry
Choice of interface
• The choice of whether to use a command-line or GUI
interface is mostly one of personal preference.
• System administrators who manage computers and
power users who have deep knowledge of a system
frequently use the command-line interface.
– Further, command line interfaces usually make repetitive
tasks easier, in part because they have their own
programmability. For example, if a frequent task requires a
set of command-line steps, those steps can be recorded
into a file, and that file can be run just like a program.
2.3 System Calls
The only way that a process communicate with OS
scanf(outfile)
fopen(“r”);
fopen(“w”);
fgetc();
fputc();
fclose(infile);
fclose(outfile);
exit();
System Calls
• Mostly accessed by programs via a high-level Application
Program Interface (API) rather than direct system call use
– Each API consists of one or more systems calls.
– APIs are OS specific.
• File management
– create file, delete file
– open, close
– read, write, reposition (move, rename, etc.)
Types of System Calls
• Device management
– request device, release device
– read, write, reposition
– get device attributes, set device attributes
– logically attach or detach devices
• Information maintenance
– get time or date, set time or date
– get system data, set system data
– get process, file, or device attributes
– set process, file, or device attributes
Types of System Calls
• Communications
– Create, delete communication connection
– send, receive messages
– transfer status information
– attach or detach remote devices
• Protection provides a mechanism for
controlling access to the resources provided
by a computer system.
Examples of Windows and
Unix System Calls
Chapter 2
• Status information
– Some programs ask the system for info.
• date, time, amount of available memory, disk space, number of users.
• detailed performance, logging, and debugging information.
• Programming-language support
– Compilers, assemblers, debuggers and
interpreters sometimes provided
System Programs (cont’d)
• Program loading and execution
– Once a program is compiled, it must be loaded into
memory to be executed.
– loaders, debugging systems
• Communications
– provide the mechanism 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, transfer files from one machine to another
Chapter 2