Operating Systems (OS)

Download Report

Transcript Operating Systems (OS)

LINUX
An Introduction
Wan Ahmad Tajuddin Wan Abdullah
Universiti Malaya
KL ACGRID-II 2009
Operating Systems (OS)
System software that abstracts the
interface to various resources provided
by low-level system hardware and
software; and that manages these
resources.
user
OS
machine
distinct resources can be shared effectively
 the programmer can use system resources easily
[user provided with a virtual machine]

* user interface
* process management and scheduling
* job and session management
* device management
* timing management
* memory management
* file management
* error handling
* reliability
* security
* monitoring
* accounting
* system management
OS: Processes
independent task units which are executed
e.g. a batch job, the shell of a login session, a program run
The execution of processes is controlled by the kernel and is
interlaced – this part of the kernel is known as the
despatcher or low-level scheduler
when a process ends, or
uses up its scheduled time, or
cannot be continued because an interrupt occurred or
the process is waiting for something or
the error trap suspends the execution of the process
while an error is handled
the despatcher executes the next process in the process queue
according to priority
OS: Kernel
most basic layer of operating system, which
communicates with hardware
provides environment where processes can exist:
handling of interrupts
 changing processor usage from process to process
 implements mechanisms for communication and

coordination between processes (semaphores, shared
memory, message passing, input/output redirection,
pipes,…), including deadlock avoidance and recovery
Thread – flow of control between processes; a process can spawn daughter
processes and so on
shares process resources
OS: File structure
Files are contained in directory and subdirectory (which is
also a kind of file) structure which is tree-like.
Uppermost directory – main file directory or root directory (‘/’ or ‘\’).
/
/C
/A
/A/a
/B
/A/b
/B/D/c
/B/D
/B/D/
e
/B/g
/B/D/f
/B/E
/C/h
Open Systems
implement open specifications adequately for interfaces, services, and support
formats which allow application software built appropriately to be ported onto
various types of systems with minimal change, to interoperate with other
applications on local and remote systems, and to interact with users in a style
which facilitates user mobility
portability, interoperability, non-dependency, flexibility, integrability
Open specification
a public specification maintained by an open public consensus process, to
include current new technology and which is consistent with standards.
increased consultation with respect to system and application provider due to
advantage from clear description of system needs
Example of open operating system: UNIX System V
Example of open specifications: POSIX (Portable Operating System Interface)
LINUX
UNIX-like OS initially for PCs

Open source – free, standards, community, modifiable

Monolithic kernel – single standard system calls

Distribution suites (Red Hat, Ubuntu, Scientific Linux, …)
- together with other open source (esp GNU) applications

CLI: shells (c-shell, Bourne again, ...)

GUI: based on X-Windows

Desktop environments (KDE, Gnome, ...)
Legacy of UNIX
• programmers environment
• simple user interface
• many, simple utilities that can be combined to perform powerful functions
• hierarchical file system
• simple interface to devices consistent with file format, supports I/O redirection
and piping
• multi-user, multi-process system
• architecture independent and transparent to the user.
•Written in C – close to C, portable
LINUX User Interface
Command Line Interface – shells (processes)
Line commands: command –flags arguments
Arguments can be e.g. filenames
stdin (standard input – keyboard), stdout
(standard output – monitor), device drivers (e.g.
/dev/lp) are treated like files
Graphics User Interface – based on X Windows
(processes)
LINUX File system
Hierachical tree-like structure of (sub)directories and files
Root directory: /
Subdirectories usually e.g.:
bin
Binary (executable) programs
home
Home directories of users
etc
Miscellaneous system files
dev
Special files for I/O devices
lib
Libraries
usr
User files
tmp
Temporary files
Filenames have extensions after a dot, usually describing
type of file e.g. prog.c, files.tar, files.tar.gz
File can be link to other file or (sub)directory
File protection mode: defines priviledges for owner,
group (of users where owner is in), (the rest of the)
world, e.g.
rwxr-x--x : owner can read, write, execute;
group can read, execute;
world can execute only
(binary: 111101001)
Superuser (root) have all priviledges to all files
Networking
Protocol: TCP/IP
Hosts: domain name address (host.domain), IP
address (number: xxx.xxx.xxx.xxx)
Services:
 Remote terminal – telnet, ssh
 File transfer – ftp, scp
 Web – http
 Mail – smtp
 etc
Hands on
o Introduction
o GUI, tools and scripts
o [System: processes and threads]
o [Network programming]