This presentation is the property of its rightful owner.
Sponsored Links
1 / 98

第十章 UNIX 系统内核结构 PowerPoint PPT Presentation


  • 124 Views
  • Uploaded on
  • Presentation posted in: General

第十章 UNIX 系统内核结构. 第十章 UNIX 系统内核结构. 10.1 UNIX 系统概述 10.2 进程的描述和控制 10.3 进程的同步与通信 10.4 存储器管理 10.5 设备管理 10.6 文件管理. 10.1 UNIX 系统概述. 1. UNIX 系统的特征 1) 开放性 2) 多用户、多任务环境 3) 功能强大,实现高效 4) 提供了丰富的网络功能 5) 支持多处理器功能. 2. UNIX 系统的内核结构. 图 10-1 UNIX 核心的框图. 1) 进程控制子系统.

Download Presentation

第十章 UNIX 系统内核结构

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Unix

UNIX


Unix

UNIX

10.1 UNIX

10.2

10.3

10.4

10.5

10.6


10 1 unix

10.1 UNIX

1. UNIX

1)

2)

3)

4)

5)


Unix

2. UNIX

10-1 UNIX


Unix

1)

(1)

(2)

(3)

(4)


Unix

2)

(1)

(2)

(3)


Unix

10.2

10.2.1 PCB

UNIX

(1)

(2) U

(3)

(4)


1 process table entry

1. (Process Table Entry)

(1) (PID)

(2) (UID)

(3)

(4)

(5) U

(6)

(7)

(8)

(9) nice

(10) P-Link

(11) U


2 u u area

2. U(U Area)

(1)

(2) u-ruid(real user ID)

(3) u-euid(effective user ID)

(4)

(5)

(6)

(7) I/O

(8)

(9)

(10)

(11)


3 system region table

3. (System Region Table)

(1)

(2)

(3)

(4)

(5)


4 per process region table

4. (Per Process Region Table)

10-2


Unix


10 2 2

10.2.2

1.


Unix

2.

1)

2)

(1)

(2) (PSR)

(3)

(4)

3)

(1)

(2)


10 2 3

10.2.3

1. fork

(1)

(2)

(3)

(4)

(5)

(6)


2 exec

2. exec

10-5 exec


3 exit

3. exit

exitexit

  • (1)

  • (2)

  • (3)

  • (4)


4 wait

4. wait

wait waitwait


10 2 4

10.2.4

1.

UNIXrunrunwaitexitsleep


Unix

2.

()()


Unix

3.

UNIXI/O n+1 0n


Unix

4.

procnice0~40niceCPUCPU16.667 ms1CPUCPU


Unix

5.

OS


Unix

10.3

10.3.1 sleepwakeup

sleep

1. sleep


2 wakeup

2. wakeup


10 3 2 signal

10.3.2 (signal)

1.

1~19


Unix


Unix

2.

1

2)

(1) func=1 sig

(2) func=0 sig

(3) func0 1 func

3)


10 3 3

10.3.3

1.

1) (Unnamed Pipes)

2) (Named Pipes)


Unix

2.

1) pipe

2)

3)

4)


10 3 4

10.3.4

1.

1) (message)

10-6


Unix

2)

key


Unix

2.

1)

msgget( )


Unix

2)

(1)

(2)

(3)


Unix

3.

1)

msgsnd( )msgsnd( )(


Unix

2)

msgrcv( )msgrcv( ) msgtypmsgtyp=0msgtypmsgtypmsgtyp


10 3 5

10.3.5

1.

10-7


Unix

2.

1)

shmget( )keysizeshmid


Unix

2)

shmctl( )


Unix

3.

shmat( )shmaddrshmdt( )


10 3 6

10.3.6

1.

1)

UNIXwaitsignalUNIXwaitsignalsemop( )semget( )semctl( )


Unix

2)


Unix

2.

1)

semvalsempid


Unix

2)

10-8


Unix

3.

1) semget( )

semid


Unix

2) semop( )

semop semopsemopsemopsemop


Unix

10.4

10.4.1

1.

1)

10-9


Unix

2.

1)

1

2


Unix


Unix

2)

10-11


10 4 2

10.4.2

1.

012301231310


Unix

2.

(1)1

(2)

(3)


Unix

3.

64 KB1001


10 4 3

10.4.3

1.

2.

3.


Unix

10.5

10.5.1

1.

10-12


Unix

2.

I/Ogetcfbp6


Unix

3.

(1) getc

clist

(2) putc

C-1


Unix

(3) getcb

bp

(4) putcb

bpbp


10 5 2

10.5.2

1.

10-13


Unix

2.

10-14 ()


Unix

3.

(1) getblk( )

sleepbdwriteb-flagb[CD*2]busy1bp


Unix

(2) getblk(dev, blkno)

devblknogetblk( )


Unix

4.

brelseI/O()UNIX


10 5 3

10.5.3

1.

10-15


Unix

2.

10-16


Unix

3.

10-17


10 5 4

10.5.4

1. gdopen

UNIXgdopendevb-flagB-ONCE; gdtimer


Unix

2.

ctlI/O0I/OI/Ob-active1()gdstartegyI/O


3 gdintr

3. gdintr

I/OCPUgdintrctl


10 5 5

10.5.5

1)

UNIXbread()()breada


Unix

2)

bwrite

bawrite

I/Obdwrite


2 bread breada

2. breadbreada

  • bread

  • breada


3 bwrite bawrite bdwrite

3. bwrite bawritebdwrite

1) bwrite

bpbpI/Osleep I/Obrelse


Unix

2) bawrite

I/Obawritebwrite

3) bdwrite

brelsegetblk


Unix

10.6

10.6.1 UNIX

(1)

(2)

(3)

1. UNIX


Unix

2.

10-18 UNIX


Unix

3.

(1)

(2)

(3)

(1)

(2)

(3)


Unix


10 6 2

10.6.2

1.

(1)

(2)

(3)


Unix


Unix

2.

1)

2)

(1)

(2)

(3)


Unix


10 6 3

10.6.3

1. (Superblock)

(1)

(2)

(3)

(4) i

(5) i

(6)

(7) i

(8)

(9)


Unix

2.

1) ialloc

(1)

(2) i

(3) ii

(4) i

(5) i1


2 ifree

2) ifree

(1)

(2) i

(3) iii1

(4)


Unix

3.

1) iget

iii1 igetibreadii


Unix

2) iput

iputi10ii10i


10 6 4

10.6.4

1.


Unix

2.


Unix

3.

1)

allocsleep(95)(109)(211208)bread(109)


Unix

2)

freesleepbetblk


10 6 5

10.6.5

(1)

UNIXUfd(file discriptor)fdfd


Unix

(2) ufalloc

ufallocfdUNULL


Unix

2.

(1)

/


2 falloc

(2) falloc

fallocufallocNULL (fp) NULL


10 6 6

10.6.6

1.

2.

3.


Unix

The End


  • Login