Chapter 2 : Operating System Structure

OS Services

I/O operations

File system manipulation

Program execution

Communication

User interface

Error detection

  1. command line (CLI)

2.GUI

  1. touch screen

System Calls

Programming interface to services provided by the OS

high level language : C or C++

mostly accessed by programs via Application Programming Interface (API)

system call implimentation

need to obey API & understand what OS will do as the result

details of OS interface hidden from programmer by API

types of system calls

process control

file management

device management

create & terminate process,load,execute,wait for time etc

create & delete file,open close file,read write reposition

request & release device,read write reposition,logically attach or detach devices

information maintenance

communication

create delete comm connection

transfer status information

protection

OS structure

1.simple

2.complex

3.layered

4.microkernel

5.hybrid

6.traditional

6.monolithic-original UNIX

MS DOS

layer 0 : hardwares

layer N : user interface

divided into layers

moves from kernel into user space

example: Mac OS X kernel

benefits: easy to extend microkernel, more secure

combines multiple approaches to address performance,security,usability needs

System boot

power initialized on system,execution starts at a fixed memory location

piece of code

bootstrap loader,BIOS stored in ROM/EEPROM locates the kernel

BIOS

kernel loads & system is running

OS debugging

debug- find and fix errors. also performance tuning

OS generate log files containing error information

failure of an app can generate crash dump file containing kernel memory

beyond crashes,performance tuning can optimize syst performance

trace listing

profiling

collect data for specific event

tools

1.strace-trace system call invoke by a process

2.gdb-source level debugger

3.perf-collection of Linux performance tools

4.collects network packets

periodic sampling of instruction pointer to look for statistical trends

BCC

debug interactions btwn user&kernel code nearly impossible without toolset tht understands both & instrument their actions

BPF compliler collection

rich toolkit provide tracing for Linux

UNIX-limited by hardware functionality

systems of program

kernel

consist of everything below the syst call interface&above physical hardware

provide file system,CPU scheduling,memory management