CSC 4103 Chapter : Ch2
• OS Services
○ Provides an environment for program execution
○ Functions provided by os to help users
§ UI: cli vs gui
§ Program execution
○ File system manipulation
○ Communications
○ Error detection
○ Resource allocation
○ Accounting
○ Protection and security
• UI
○ Cli
§ Command interpreter allows direct command entry
□ Sometimes implemented in kernel, sometimes by system
programs
○ GUI
§ User-friendly desktop
□ Use mouse and keyboard and monitor
□ Icons
□ Invented at Xerox PARC
§ Many systems have gui and cli
• System calls
○ The interface for programs to use the computer
○ Usually, the OS groups useful tasks at a high level via API rather
than direct sys-calls
○ Three most common APIs
§ Win32
§ POSIX for UNIX/Linux/Mac
§ Java API for the JVM
○ API's are simpler and more portable than system calls
○ Implementation
§ Typically, each call is associated with a number
□ System-call interface maintains a table indexed according
to these numbers
○ Parameter passing
§ Three general methods to pass parameters to OS
□ Register: simply pass the parameters in registers
□ Memory Block: pass the address of the memory block
□ Stack: parameters pushed onto the stack by programs
○ Types
§ Process control
□ Create and terminate processes
□ End, abort
□ Load, execute
□ Get process attributes, set process attributes
□ Wait for time
□ Wait for event, signal event
□ Allocate and free memory
□ Dump memory if error
□ Debugger for determining bugs, single step execution
□ Locks for managing access to shared data between
processes
§ Protection
§ Information management
§ Communication
• System Programs
○ Provide a convenient environment for program development
○ Utilities
Document Summary
Functions provided by os to help users. Sometimes implemented in kernel, sometimes by system. Many systems have gui and cli: system calls. The interface for programs to use the computer. Usually, the os groups useful tasks at a high level via api rather than direct sys-calls. Api"s are simpler and more portable than system calls. Typically, each call is associated with a number. System-call interface maintains a table indexed according to these numbers. Three general methods to pass parameters to os. Register: simply pass the parameters in registers. Memory block: pass the address of the memory block. Stack: parameters pushed onto the stack by programs. Debugger for determining bugs, single step execution. Locks for managing access to shared data between processes. Provide a convenient environment for program development. Application programs: os design & implementation. User goals: os should be convenient to use, easy to learn, reliable safe and fast maintain, as well as flexible, reliable, error-free, and efficient.