Operating System Services

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Which of the following is NOT a function provided by operating system services to help the user?

  • Program execution.
  • User interface.
  • File-system manipulation.
  • Resource allocation for system efficiency. (correct)

How do operating systems ensure that multiple processes do not interfere with each other's data?

  • By implementing protection mechanisms. (correct)
  • Through resource allocation.
  • By using shared memory.
  • By using message passing.

What is a key difference between a CLI and a GUI?

  • A CLI is exclusively implemented in the kernel.
  • A CLI allows direct command entry, while a GUI uses visual elements. (correct)
  • A CLI uses more system resources than a GUI.
  • A GUI is more suitable for batch processing.

If a new feature is added, what user interface requires no modification?

<p>Command Line Interface (C)</p> Signup and view all the answers

How do system calls relate to the Application Programming Interface (API)?

<p>APIs provide a high-level interface to system calls. (A)</p> Signup and view all the answers

What is the role of the system-call interface?

<p>To maintain a table indexed by system call numbers. (D)</p> Signup and view all the answers

Why is it important to obey the API when using system calls?

<p>To ensure that the OS performs the expected actions correctly. (A)</p> Signup and view all the answers

In system call parameter passing, what is one disadvantage of passing parameters in registers?

<p>The number of parameters may be limited. (B)</p> Signup and view all the answers

Which of the following methods is used to pass parameters in Linux and Solaris?

<p>Storing parameters in a block in memory, with the address passed in a register. (B)</p> Signup and view all the answers

Which type of system call is essential for inter-process communication?

<p>Communications. (C)</p> Signup and view all the answers

What role do 'locks' play as a type of system call?

<p>Data Access Management (D)</p> Signup and view all the answers

In the context of system calls for communications, what does the message passing model involve?

<p>Sending and receiving messages to a host name or process name. (C)</p> Signup and view all the answers

Which of the following is a system program that is used to store and retrieve configuration information?

<p>Registry. (C)</p> Signup and view all the answers

How do system programs relate to system calls from a user perspective?

<p>Users commonly interact with system programs, which in turn use system calls. (C)</p> Signup and view all the answers

Which of the following is NOT a type of system program?

<p>Kernel extensions. (B)</p> Signup and view all the answers

What are the main considerations when designing an operating system?

<p>Both user and system goals. (D)</p> Signup and view all the answers

What is the benefit of separating policy from mechanism in OS design?

<p>It allows greater flexibility if policy decisions need to be changed. (D)</p> Signup and view all the answers

What programming language is commonly used to write an operating system?

<p>C or C++. (D)</p> Signup and view all the answers

What does 'porting' refer to when discussing operating system implementation?

<p>Adapting the OS to run on different hardware. (B)</p> Signup and view all the answers

What is the main characteristic of a simple OS structure like MS-DOS?

<p>It provides maximum functionality in minimal space. (D)</p> Signup and view all the answers

In what way does the UNIX OS structure differ from the MS-DOS structure?

<p>UNIX consists of two separable parts: systems programs and the kernel. (D)</p> Signup and view all the answers

What is the key advantage of a layered OS structure?

<p>Simplified design and debugging due to modularity. (B)</p> Signup and view all the answers

How does message passing contribute to the function of a microkernel OS?

<p>It facilitates communication between user modules. (B)</p> Signup and view all the answers

How do modules compare to layers in operating system structure?

<p>Modules are similar to layers, but offer more flexibility. (A)</p> Signup and view all the answers

What characterizes a hybrid operating system?

<p>Combination of multiple architectural approaches. (B)</p> Signup and view all the answers

Which parts are included in the Mac OS X kernel environment?

<p>Mach microkernel, BSD Unix, and I/O Kit. (B)</p> Signup and view all the answers

Which API is used for developing apps in iOS?

<p>Cocoa Touch (B)</p> Signup and view all the answers

What is a key distinction of the Android OS?

<p>It uses a modified Linux kernel. (D)</p> Signup and view all the answers

What is the function of a core dump file in operating system debugging?

<p>Capturing memory of a process after a failure. (B)</p> Signup and view all the answers

When debugging, what does the use of 'trace listings' entail?

<p>Recording system activities for analysis. (B)</p> Signup and view all the answers

What is the primary goal of performance tuning in operating systems?

<p>To improve and optimize system performance. (A)</p> Signup and view all the answers

What is the use of Profiling in operating system debugging?

<p>Periodic Sampling of instruction pointer for statistical trend analysis. (C)</p> Signup and view all the answers

What is the purpose of SYSGEN in operating systems?

<p>To configure the system for a specific hardware setup. (B)</p> Signup and view all the answers

What is the first step that occurs when power is initialized on a system during system boot?

<p>Execution starts at a fixed memory location. (A)</p> Signup and view all the answers

What is the role of a 'bootstrap loader' during system boot?

<p>To load the kernel into memory. (B)</p> Signup and view all the answers

Which storage type typically holds the initial boot code?

<p>EEPROM (C)</p> Signup and view all the answers

What component allows for the selection of different kernels during system boot?

<p>GRUB (B)</p> Signup and view all the answers

What does it mean for the system to be running?

<p>Kernel loads, then the system is ready to use. (D)</p> Signup and view all the answers

Flashcards

Operating System Services

Environment for program execution, provides services to programs/users.

Command Line Interface

Allows users to interact directly by entering commands

Graphical User Interface (GUI)

User-friendly interface with visual elements like icons and menus.

System Call

Programming interface to OS-provided services.

Signup and view all the flashcards

System Programs

Functions that provide a convenient environment for program development.

Signup and view all the flashcards

Protection

Ensuring that all access to system resources is controlled.

Signup and view all the flashcards

Security

Defending the system from external I/O devices from invalid access attempts

Signup and view all the flashcards

System Call Interface

Interface indexed with numbers that maintains the tables.

Signup and view all the flashcards

Debugger

Used to determine bugs in a system.

Signup and view all the flashcards

Debugging

Find and fix errors in an OS.

Signup and view all the flashcards

SYSGEN

OS is built for a specific computer.

Signup and view all the flashcards

Bootstrap Loader

Small code piece that locates and loads the kernel into memory

Signup and view all the flashcards

Bootstrap Loader GRUB

GRUB allows selection of kernel from multiple disks, versions, kernel options

Signup and view all the flashcards

File-system Manipulation

The file system is of particular interest. Programs need to read and write files and directories, create and delete them, search them, list file Information, permission management

Signup and view all the flashcards

Program execution

The system must be able to load a program into memory and to run that program, end execution, either normally or abnormally (indicating error)

Signup and view all the flashcards

Study Notes

Operating System Services

  • Operating systems establish an environment to execute programs and services for programs and users.
  • One set of OS services provides helpful functions such as the user interface (UI). Varies between Command-Line (CLI), Graphics User Interface (GUI), Batch.
  • Program execution allows the system to load and run a program, ending execution normally or abnormally.
  • I/O operations enable running programs to perform I/O, involving files or I/O devices.
  • File-system manipulation allows programs to read and write files and directories, create and delete them, search them, list file information, and manage permissions.
  • Communication happens when processes exchange information on the same computer or between computers over a network, via shared memory or message passing.
  • Error detection includes the OS needing to be constantly aware of possible errors in CPU, Memory hardware, and I/O devices and the user program. OS should take appropriate action to ensure correct and consistent computing; debugging facilities greatly enhance the user's and programmer's abilities to efficiently use the system.
  • Another set of OS functions exists to ensure efficient operation via resource sharing.
  • Resource allocation gives multiple users or jobs the allocation of resources they need, such as CPU cycles, main memory, file storage, and I/O devices.
  • Accounting tracks which users use how much and what kind of computer resources.
  • Protection and security allows owners of information to control its use and ensures processes don't interfere with each other. Involves controlling access to system resources and security from outsiders, requires authentication, and defends external I/O devices from invalid access attempts.

User Operating System Interface

  • CLI or command interpreter allows direct command entry.
  • Sometime implementation in the kernel and other times it is implemented the system program.
  • Sometimes implemented multiple flavors referred to as the shells.
  • Primarily fetches a command from the user and executes it.
  • Sometimes commands are built-in or just names of programs. New features do not require shell modification if the latter.
  • GUI is a user-friendly desktop metaphor interface.
  • Mouse, keyboard, and monitor are usually used.
  • Icons represent files, programs, and actions.
  • Multiple mouse buttons over objects execute functions or open directories (folders).
  • Xerox PARC invented the GUI.
  • Many systems now include both CLI and GUI interfaces.
  • Microsoft Windows is GUI with CLI "command" shell, and UNIX kernel with shelves available.
  • Unix and Linux have CLI with optional GUI interfaces (CDE, KDE, GNOME)
  • Touchscreen devices require new interfaces different from the mouse, where actions and selection are based on gestures, and voice commands and virtual keyboards are used for text entry.

System Calls

  • System calls are the programming interface to OS services.
  • They are typically written in a high-level language (C or C++).
  • Programs mostly access the system via a high-level Application Programming Interface (API) rather than direct system call use.
  • The three most common APIs are Win32 API for Windows, POSIX API for POSIX-based systems (including virtually all versions of UNIX, Linux, and Mac OS X), and Java API for the Java virtual machine (JVM)
  • Note: system-call names used throughout this text are generic.
  • A system call sequence to copy contents from one file to another includes acquiring the input file name, writing prompt to screen, accepting input, acquiring output file name, opening the input file, createoutput, reading from input file, writing output file, closing output file, and ending normally.
  • In the UNIX environment standard APIs involve the programming language C.
  • System-call interface maintains a table indexed according to these numbers
  • The system call interface invokes the intended system call in OS kernel and returns status of the system call and any return values
  • API can be followed as a result call to understand what the OS will do.
  • Most details of OS interface is hidden from the programmer by API, and the managed by run-time support library consists of set of functions built into libraries included with compiler.
  • Three general methods are used to pass parameters to the OS. The simplest being, pass the parameters in registers. Other methods include parameters being stored in memory, and the stack.
  • Process control system calls include actions to create process, terminate process, end, abort, load, execute, get process attributes, set process attributes, wait for time, wait event, signal event, allocate and free memory, Dump memory if error, Debugger for determining bugs, single step execution and Locks for managing access to shared data between processes.
  • File management system calls include actions to create file, delete file, open, close file, read, write, reposition, and get and set file attributes.
  • Device managemtn system calls include actions to request device, release device, read, write, reposition, get device attributes, set device attributes, and to logically attach or detach devices
  • Information maintenance system calls get or set time or date, system data, and process / file / device attributes.
  • Communications system calls create or delete communication connections. They can send or receive messages if a message passing model to host name or process name is used as well as if client to server is being used. In Shared-memory model, they create and gain access to memory regions, transfer status information, attach and detach remote devices.
  • Protection system calls include controlling access to resources, setting permissions, and managing user access.

System Programs

  • System programs provide a convenient environment for program development and execution.
  • System programs include actions to manipulate files and programming language support. They can load programmes, initiate communication, act as background services, and run Application programs
  • File management includes actions to create, delete, copy, rename, print, dump, list, and generally manipulate files and directories.
  • Status information asks the system for info, dates, times, amount of available memory, disk space, number of users. It can also provide logging or debugger information, or format and print outout to terminal and devices.
  • A registry is used to store and retrieve configuration information.
  • File modification system programs include Text editors to create and modify files.
  • Programming-language support system programs include Compilers, assemblers, debuggers and interpreters that are sometimes provided.
  • Program loading and execution system programs incldue Absolute loaders, relocatable loaders, linkage editors, and overlay-loaders, debugging systems for higher-level and machine language.
  • Communications systems programs Provide the mechanism for creating virtual connections among processes, users, and computer systems. Allows 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.
  • Background Services launches at boot time, some for system startup, others that continues from boot to shut down. They Provide facilities like disk checking, process scheduling, error logging, printing and Run in user context not kernel context known as services, subsystems, daemons.
  • Application programs do not pertain to system, are run by users, arent considered apart of the OS, and is Launched by command line, mouse click, and finger poke.

Operating Systems Design and Implementation

  • Design and Implementation of OS not "solvable", but some approaches have proven successful
  • Internal structure of different Operating Systems can vary widely
  • Start the design by defining goals and specifications
  • Affected by choice of hardware, type of system
  • User goals and System goals
    • User goals – operating system should be convenient to use, easy to learn, reliable, safe, and fast
    • System goals – operating system should be easy to design, implement, and maintain, as well as flexible, reliable, error-free, and efficient
  • Policy: What will be done
  • Mechanism: How to do it?
  • The separation of policy from mechanism is a very important principle, it allows maximum flexibility if policy decisions are to be changed later (example – timer)
  • Specifying and designing an OS is highly creative task of software engineering

Implementation

  • Early OSes in assembly languages.
  • Than languages like Algol, PL/1, C, C++. Now a mix of languages. Lowest are assembly language. Main body is C. System programs in C, C++, scripting languages like PERL, Python, shell scripts.
  • High-level language easier to port to other hardware, but slower. Emulation can allow an OS to run on non-native hardware.

Operating System Structure

  • General-purpose OS is very large program
  • Various ways to structure OSes; simple (MS-DOS), complex (UNIX), layered (an abstraction), or microkernel (Mach).
  • MS-DOS – was written to provide the most functionality in the least space. It is not divided into modules and does not have well separated interfaces and layers.
  • UNIX – was limited by hardware functionality. The original UNIX operating system had limited structuring, operating in a two part system of system programs and the kernel.

Traditional UNIX system structure

  • A system that is beyond simple but not fully layered
  • (the users) shells and commands, compilers and interpreters, system libraries
  • System-call interface to the kernel; signals, terminals, handling, character I/O system, terminal devices.
  • File system, swapping block I/O system, disk and tape drivers
  • CPU scheduling, page replacement, demand paging, virtual memory
  • Kernel interface to the hardware; terminal controllers, terminals, device controllers, disks and tapes, memory controllers, physical memory
  • Layered Approach. The operating system is divided into a number of layers (levels), each built on top of lower layers. The bottom layer (layer 0), is the hardware; the highest (layer N) is the user interface.

Microkernel System Structure

  • Moves as much from the kernel into user space
  • Mach is an example of a microkernel
  • Mac OS X (Darwin) is partly based on Mach
  • Communication uses message passing between user modules Benefits:
  • They are easier to extend, port and are more secure. Drawbacks:
  • The Performance has overhead from the user space to the kernel space communication.
  • Many modern operating systems implement loadable kernel modules
  • Uses object-oriented approach: each core component is separate, each talks to the others over known interfaces, and each is loadable as needed within the kernel
  • Overall, similar to layers but with more flexible: Linux, Solaris, etc

Operating system Examples

  • Hybrid Systems Most modern operating systems are actually not one pure model - Hybrid combines multiple approaches to address performance, security, usability needs.

  • Linux and Solaris kernels - reside in the Kernel address space, are therefore monolithic, with modular dynamic load functionality.

  • Windows is monolithic, with some microkernel subsystems

  • Apple Mac OS X hybrid, layered, Aqua Ul plus Cocoa programming environment, kernel which contain Mach microkernel, BSD Unix, I/O kit dynamically loadable modules.

  • iOS

  • Apple mobile OS for iPhone, iPad

    • Structured on Mac OS X, added functionality
    • Does not run OS X applications natively, but runs on different CPU architecture (ARM vs. Intel)
      • Cocoa Touch Objective-C API for developing apps
      • Media services layer for graphics, audio, video
      • Core services cloud computing, databases
      • Core operating system Mac OS X kernel Android
  • Developed by Open Handset Alliance (mostly Google)

    • Open Source
    • Similar stack to IOS
    • Based on Linux kernel but modified -Provides process, memory, device-driver management
      • Adds power management
  • Runtime environment includes core set of libraries and Dalvik virtual machine - Apps developed in Java plus Android API -java class files compiled to java bytecode then translated to executable than runs in Dalvik VM Libraries include frameworks for web browser (webkit), database (SQLite), multimedia, smaller libc

Other Operating System Features

  • Debugging is finding and fixing errors, or bugs
  • OS generate log files containing error information
  • Failure of an application can generate core dump file capturing memory of the process -Operating system failure can generate crash dump file containing kernel memory -Beyond crashes, performance tuning can optimize system performance Performance Tuning
  • Improve performance by removing bottlenecks OS must provide means of computing and displaying measures of system behavior, such as the "top" program. Debugging is finding and fixing errors, or bugs
  • Beyond crashes, performance tuning can optimize system performance
  • Sometimes using trace listings of activities, recorded for analysis
  • Profiling is periodic sampling of instruction pointer to look for statistical trends
  • Kernighan's Law: “Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Operating System Generation
  • Operating systems are designed to run on any of a class of machines; the system must be configured for each specific computer site
    • SYSGEN program obtains information concerning the specific configuration of the hardware system -Used to build system-specific compiled kernel or system-tuned. System Boot When power initialized on system, execution starts at a fixed memory location Firmware ROM used to hold initial boot code system must be made available to Boot system Bootstrap loader, stored in boot block. Common bootstrap loader which allows to select a kernel from Multiple disks, versions, kernel options. Kernel loads and system is then running

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

More Like This

Operating System Role and Services
48 questions
Operating System Services
18 questions
Operating System Services
45 questions

Operating System Services

EruditeVorticism1110 avatar
EruditeVorticism1110
Use Quizgecko on...
Browser
Browser