1 pertemuan 24 sistem operasi unix matakuliah: t0316/sistem operasi tahun: 2005 versi/revisi: 5

Post on 19-Dec-2015

223 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

1

Pertemuan 24Sistem Operasi Unix

Matakuliah : T0316/sistem Operasi

Tahun : 2005

Versi/Revisi : 5

2

Learning Outcomes

Pada akhir pertemuan ini, diharapkan mahasiswa

akan mampu :• mendemonstrasikan sistem operasi Linux, dari

manajemen proses, memory, file sampai dengan I/O (C3)

3

Outline Materi

• Sejarah Unix• Overview Unix• Shell• Program Utiliti• Proses pada Unix• System Call• System memory dan I/O pada Unix

4

LINUX

• Sejarah Unix– Unics– PDP 11 Unix– Portable Unix– Barkeley Unix– Standar Unix– MINIX– LINUX

5

Overview of Unix

• UNIX Goals– UNIX is an interactive system designed to

handle multiple processes and multiple users at the same time.

– It was designed by programmers, for programmers, to use in an environment in which the majority of the users are relatively sophisticated and are engaged in software development projects

– Extensive facilities to work together

6

Interfaces to UNIX

The layers of a UNIX system.

7

UNIX Kernel

Approximate structure of generic UNIX kernel

8

Booting UNIX

The sequences of processes used to boot some systems

cp

9

SHELL

• Program Login

• Prompt

• Command

• Argument

• Redirect

• Pipe

• Shell Script

• Background process

10

Contoh

• cp src dest• head –20 file• ls x.c y.c z.c• sort < in > out• sort < in > temp; head –30 < temp; rm temp• sort < in | head –30• grep ter *.t | sort | head –20 | tail –5 > foo• wc –l < a > B &• sort < x | head &

11

Program Utiliti

• Manipulasi file dan direktori

• Filter

• Tool untuk pengembangan program

• Text processing

• Sistem administrator

• dll

12

UNIX Utility Programs

A few of the more common UNIX utility programs required by POSIX

13

Process pada Unix

• Sistem multiprogramming• Daemonds• Cron daemonds• System fork• Process parent• PID• Pohon process• signal• Group process• UID• Superuser (root)

14

System Calls for Process Management

s is an error code

pid is a process ID

residual is the remaining time from the previous alarm

15

POSIX Shell

A highly simplified shell

16

Implementasi Process

• Process Table (always in memory)– Parameter scheduling– Memory map– Signal– Etc

• User Structure (only in memory when the program is executed)– Machine registers– System call state– File descriptor table– Accounting– Stack kernel

17

Handling Memory

• Process A's virtual address space• Physical memory• Process B's virtual address space

Process A Process B

18

Sharing Files

Two processes can share a mapped file.

A new file mapped simultaneously into two processes

19

Implementation of memory management

• Swapping

Tiga hal yang menyebabkan swapping ke disk

1. Fork

2. BRK (request for memory)

3. Stack increase

20

Implementation (2)

Paging in UNIX•Page daemon•Core map information about the contents of page frame

The core map in 4BSD

21

Implementation (3)

• Page replacement algorithm Two handed clock – Two pointers– First, it clear the usage bit at the front end, and– Then, check the usage bit at the back hand

• If two hands are kept close together, then only very heavily used pages have their R-bit stay 1 (after being zero-ed by the front hand)

top related