/
😥
CS340-Chapter#2
Clone
Register
😥
CS340-Chapter#2
Flashcard Deck
Study
Program execution
The operating system gives users the ability to run applications and programs.
I/O operations
The applications and programs run by users require input and produce output, the operating system provides the environment for this.
File systems
Users and their software can create, delete, read, modify, rename, search, list, share, and protect files and directories, the operating system provides support for all of this.
Protection and security
Users need control over who can access their data, the operating system provides security and protection for files and executing programs.
Error detection and recovery
The operating system provides services for detecting and recovering from errors, such as when files get corrupted or programs crash.
Accounting
The operating system performs accounting to monitor disk usage, memory usage, networking traffic, and other system resources.
Resource management
The operating system manages resources, such as prioritizing certain programs or restricting access to certain file systems.
What is a command-line interface (CLI)?
A type of user interface where a user enters a command by entering plain text followed by a newline character.
What is a command-line interpreter?
A stand-alone program that can be used to interact with the operating system.
What is a shell?
In UNIX, a command line interpreter is called a shell. It is not just a command line interpreter, but a full-fledged programming language.
What is a text terminal?
A terminal that transmits data one character at a time and can only display characters.
How are commands in a CLI executed?
Commands in a CLI can be executed in either of two ways: as a built-in command within the shell or as a system program in a separate executable file.
What is a built-in command?
A built-in command is a command that is implemented within the shell itself.
Give an example of a built-in command in bash.
An example of a built-in command in bash is the 'cd' command.
Give an example of a built-in command in bash.
An example of a built-in command in bash is the 'read' command.
What is a system program?
A system program is a command that is implemented in a separate, executable file.
Give an example of a system program in Linux systems.
An example of a system program in Linux systems is the 'grep' command, which is located in the file '/bin/grep'.
Give an example of a system program in Linux systems.
An example of a system program in Linux systems is the 'date' command, which is located in the file '/bin/date'.
Are there commands that can be implemented both as a built-in command and as a system program?
Yes, there are commands that can be implemented both as a built-in command and as a system program.
Give examples of commands that can be implemented both as a built-in command and as a system program.
Examples of commands that can be implemented both as a built-in command and as a system program are 'echo', 'kill', and 'pwd'.
What is a system call?
A call to code inside the kernel of the operating system made via a software interrupt or trap.
What is the purpose of a system call?
To allow a user process to explicitly request a service from the kernel.
Do user programs directly invoke system calls?
No, user programs typically call wrapper functions that invoke system calls.
What is a wrapper function?
A function whose only purpose is to make a call to another function, often a system call.
Where does the wrapper function run?
In user mode as part of a user level library.
Where does the actual system call run?
In kernel mode inside the operating system's kernel.
What is an API?
An Application Programming Interface (API) is a definition or collection of definitions that specify how a program is to obtain the services provided by some other piece of software.
What is the API in the context of operating systems and the kernel?
In the context of operating systems and the kernel, an API is the set of specifications of functions for obtaining the services of the kernel.
Why do programming languages provide wrapper functions for system calls?
Programming language libraries usually provide wrapper functions for system calls to allow programs written in that language to obtain kernel services.
What is an example of a programming language library that contains wrapper functions for system calls in GNU Linux?
The GNU C library, glibc, contains wrapper functions for all of the system calls in GNU Linux.