Download presentation
Presentation is loading. Please wait.
1
Operating Systems Introduction Moti Geva geva.biu@gmail.com
2
Administration Course site www.cs.biu.ac.il/~gevamo/os2008 Exercises 3 – 5 exercises. Done individualy. Signed in using submitweb. 40% of the grade (!) Where can you program 604 Linux labs. At home – any linux distro runnig kernel >= 2.6 (Ubuntu 8.10 recommeded).
3
Goals for the recitation Acquaintance with the Linux OS. Howto communicate with the OS. Binding theory and practice.
4
Course syllabus Introduction. Files. Processes. Memory Management. Inter Process Communication(IPC). Threads Miscellaneous.
5
Introduction What is an OS? What is the purpose of an OS? What designate the OS from other applications?
6
General OS structure Shell/Applications Kernel Hardware
7
UNIX Ken Thompson and Dennis Ritchie started development at Bell-Labs in 1969 1971 – First Edition C was developed at Bell Laboratories in 1972 by Dennis Ritchie mainly in order to develop UNIX
8
UNIX(2) 1973, rewritten in C 2 Flavors of UNIX BSD System V What about Linux?
9
Linux Linux is a free Unix-type operating system Originally created by Linus Torvalds in 1991 Developed under GNU General Public License Free code Can be downloaded from the Internet
10
Linux Linux is a multi-user OS many users can log on simultaneously Linux is a multi-processing OS Many programs execute in parallel
11
Getting help UNIX and Linux have help mechanism called man pages (manual pages). Man pages are split into sections. Usage: man [-section#] e.g.: man ls man -2 bind Can also be found online e.g. www.die.netwww.die.net
12
Man pages sections Section 1 – commands Section 2 – system calls Section 3 – C library function Section 4 – special files Section 5 – file formats Section 6 – games Section 7 – miscellaneous Section 8 – system management Section 9 – kernel routines
13
Some Linux commands ls cp cat cd chmod clear find kill less/more man mkdir/rmdir ps gcc editors kate/gedit/nano Programming IDE kdevelop/eclipse
14
Compiling under linux gcc [-o output_file] source_files E.g. gcc -o exmple example.c If no output_file is specified a.out is the default You may also use –Wall option for warnings gcc is GNU C Compiler
15
C vs. C++ Similar systax. Functional vs. object oriented struct, union, [class] Use of `typdef` Overloading, polymorphism Templates More reading can be found on the internet.
16
Object and functions
17
System modes In Linux the CPU runs in one of two modes User mode Privileged mode Each process running in user mode is limited in it’s capabilities It can’t perform many actions such as: Accessing I/O directly Allocating Memory Inter-Communicating with other processes Forking new processes …
18
Privileged Mode In privileged mode the full power of the CPU is at the program’s hand Program running in privileged mode can manipulate the memory, control I/O, change other user’s data… Therefore, only one program runs in privileged mode – the kernel Privileged mode is also known as kernel mode
19
System Calls (or OS services) Processes must get access to the privileged resources They can’t do it directly... The kernel can access the privileged resources The kernel has an API traditionally called “System calls” In Windows systems, system calls are reffered to as “Win32API”
20
System Calls (or OS services) (2) A system call is performed using software interrupt (on x86 machines) Upon system call the CPU switches into kernel mode Interrupts are handled with similarity to function calls The main difference is the that the process might not get the control right away
21
System Calls vs. Library Functions What’s are C-Library functions? What’s the difference between System Call and C-Library functions?
22
System Call vs. C Library Function e.g. open fopen close fclose read fscanf write fprintf
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.