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

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


  • 149 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

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)

(1)

(2)

(3)

(4)


2)

(1)

(2)

(3)


10.2

10.2.1 PCB

UNIX

(1)

(2) U

(3)

(4)


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)

(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)

(1)

(2)

(3)

(4)

(5)


4. (Per Process Region Table)

10-2



10.2.2

1.


2.

1)

2)

(1)

(2) (PSR)

(3)

(4)

3)

(1)

(2)


10.2.3

1. fork

(1)

(2)

(3)

(4)

(5)

(6)


2. exec

10-5 exec


3. exit

exitexit

  • (1)

  • (2)

  • (3)

  • (4)


4. wait

wait waitwait


10.2.4

1.

UNIXrunrunwaitexitsleep


2.

()()


3.

UNIXI/O n+1 0n


4.

procnice0~40niceCPUCPU16.667 ms1CPUCPU


5.

OS


10.3

10.3.1 sleepwakeup

sleep

1. sleep


2. wakeup


10.3.2 (signal)

1.

1~19



2.

1

2)

(1) func=1 sig

(2) func=0 sig

(3) func0 1 func

3)


10.3.3

1.

1) (Unnamed Pipes)

2) (Named Pipes)


2.

1) pipe

2)

3)

4)


10.3.4

1.

1) (message)

10-6


2)

key


2.

1)

msgget( )


2)

(1)

(2)

(3)


3.

1)

msgsnd( )msgsnd( )(


2)

msgrcv( )msgrcv( ) msgtypmsgtyp=0msgtypmsgtypmsgtyp


10.3.5

1.

10-7


2.

1)

shmget( )keysizeshmid


2)

shmctl( )


3.

shmat( )shmaddrshmdt( )


10.3.6

1.

1)

UNIXwaitsignalUNIXwaitsignalsemop( )semget( )semctl( )


2)


2.

1)

semvalsempid


2)

10-8


3.

1) semget( )

semid


2) semop( )

semop semopsemopsemopsemop


10.4

10.4.1

1.

1)

10-9


2.

1)

1

2



2)

10-11


10.4.2

1.

012301231310


2.

(1)1

(2)

(3)


3.

64 KB1001


10.4.3

1.

2.

3.


10.5

10.5.1

1.

10-12


2.

I/Ogetcfbp6


3.

(1) getc

clist

(2) putc

C-1


(3) getcb

bp

(4) putcb

bpbp


10.5.2

1.

10-13


2.

10-14 ()


3.

(1) getblk( )

sleepbdwriteb-flagb[CD*2]busy1bp


(2) getblk(dev, blkno)

devblknogetblk( )


4.

brelseI/O()UNIX


10.5.3

1.

10-15


2.

10-16


3.

10-17


10.5.4

1. gdopen

UNIXgdopendevb-flagB-ONCE; gdtimer


2.

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


3. gdintr

I/OCPUgdintrctl


10.5.5

1)

UNIXbread()()breada


2)

bwrite

bawrite

I/Obdwrite


2. breadbreada

  • bread

  • breada


3. bwrite bawritebdwrite

1) bwrite

bpbpI/Osleep I/Obrelse


2) bawrite

I/Obawritebwrite

3) bdwrite

brelsegetblk


10.6

10.6.1 UNIX

(1)

(2)

(3)

1. UNIX


2.

10-18 UNIX


3.

(1)

(2)

(3)

(1)

(2)

(3)



10.6.2

1.

(1)

(2)

(3)



2.

1)

2)

(1)

(2)

(3)



10.6.3

1. (Superblock)

(1)

(2)

(3)

(4) i

(5) i

(6)

(7) i

(8)

(9)


2.

1) ialloc

(1)

(2) i

(3) ii

(4) i

(5) i1


2) ifree

(1)

(2) i

(3) iii1

(4)


3.

1) iget

iii1 igetibreadii


2) iput

iputi10ii10i


10.6.4

1.


2.


3.

1)

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


2)

freesleepbetblk


10.6.5

(1)

UNIXUfd(file discriptor)fdfd


(2) ufalloc

ufallocfdUNULL


2.

(1)

/


(2) falloc

fallocufallocNULL (fp) NULL


10.6.6

1.

2.

3.


The End


  • Login