Transcript
Page 1: COP 4600 /EEL 4882 Project 4

COP 4600 /EEL 4882Project 4

Page 2: COP 4600 /EEL 4882 Project 4

Task

I/O Request processing– SIO– WIO

Process state– Active (only one)– Ready (multiple)– Block– Done

University of Central Florida

Page 3: COP 4600 /EEL 4882 Project 4

University of Central Florida

Input

Input files are the same

This time we need actually run instructions inside program script

Simulation of SIO, WIO instruction

Page 4: COP 4600 /EEL 4882 Project 4

Instruction “SIO” and “WIO”

ReviewSIO 40DSK2 10 -- Start Dsk2, requesting 10 bytes……WIO 0REQ [1,1] -- See if I/O request at [1,1] has finished, if not, block

How do we handle that?– Whenever we execute SIO, generate EIO event in a future time– When WIO occur first:

– Check if I/O request still there, if so, block– When EIO occur first:

– Remove I/O request

University of Central Florida

Page 5: COP 4600 /EEL 4882 Project 4

Interrupt

University of Central Florida

Interrupt() Interrupt_Handler()

Scheduler() Dispatcher()

Obj1.c: Get EVENT from event queue:

LOGONSTARTIOWAITIOENDIO

PGMEND

Simulator.c: Call event handler:

Logon_ServiceSio_ServiceWio_ServiceEio_ServiceEnd_Service

Page 6: COP 4600 /EEL 4882 Project 4

Events

Logon– Generated by Obj1.c: Load_events()

– When read logon.dat

SIO/WIO/PGMEND– Generated by Obj2.c:Cpu()– When execute SIO/WIO/END instruction

EIO– Generated by Obj4.c:Sio_Service()

University of Central Florida

Page 7: COP 4600 /EEL 4882 Project 4

Scheduler

University of Central Florida

Interrupt() Interrupt_Handler()

Scheduler() Dispatcher()

Select process to run

P2 ‘B’ P5 ‘B’

P4 ‘R’ P1 ‘R’ P3 ‘R’Ready Queue

Which Process to run: FCFS

Page 8: COP 4600 /EEL 4882 Project 4

Dispatcher

University of Central Florida

Interrupt() Interrupt_Handler()

Scheduler() Dispatcher()

Obj2.c: XPGM()

Obj2.c: Cpu()

Run one or several instructions (one cpu burst)

Page 9: COP 4600 /EEL 4882 Project 4

Event Flow

University of Central Florida

Interrupt() Interrupt_Handler()

Scheduler() Dispatcher()

Event Queue:

Logon Logon Logon Logon

Editor Editor LogoffScript:

P1:SIO 23PRNT 100SIO 32DISK 300WIO 0REQ [0,1]END 17

Obj3:Logon_Service

Obj3: Next_pgm

SIO

Page 10: COP 4600 /EEL 4882 Project 4

Event Flow

University of Central Florida

Event Queue:

Logon SIO Logon

Interrupt() Interrupt_Handler()

Scheduler() Dispatcher()

Printer LogoffScript:

P2:SIO 27DISK 3000SIO 15PRNT 100END 30

P1:SIO 23PRNT 100SIO 32DISK 300WIO 0REQ [0,1]END 17

SIO

Page 11: COP 4600 /EEL 4882 Project 4

Event Flow

University of Central Florida

Event Queue:

SIO Logon SIO

Interrupt() Interrupt_Handler()

Scheduler() Dispatcher()

Obj4:SIO_Service

EIO

P1:SIO 23PRNT 100SIO 32DISK 300WIO 0REQ [0,1]END 17

WIO

Page 12: COP 4600 /EEL 4882 Project 4

Event Flow

University of Central Florida

Event Queue:

Logon SIOWIO

Interrupt() Interrupt_Handler()

Scheduler() Dispatcher()

I/O have not finished

P1:SIO 23PRNT 100SIO 32DISK 300WIO 0REQ [0,1]END 17

Block

P2:SIO 27DISK 3000SIO 15PRNT 100END 30

Obj4:WIO_Service

EIO

PRNT P1

Page 13: COP 4600 /EEL 4882 Project 4

Event Flow

University of Central Florida

Event Queue:

Logon SIO

Interrupt() Interrupt_Handler()

Scheduler() Dispatcher()

EIO

Obj4:EIO_Service

PRNT P1

P1:SIO 23PRNT 100SIO 32DISK 300WIO 0REQ [0,1]END 17

Ready

P2:SIO 27DISK 3000SIO 15PRNT 100END 30

Ready

Active

WIO

Page 14: COP 4600 /EEL 4882 Project 4

Event Flow

University of Central Florida

Event Queue:

SIO WIO

Interrupt() Interrupt_Handler()

Scheduler() Dispatcher()

Logon

Printer LogoffScript: Editor

P3:SIO 10DISK 1000WIO 0REQ [0,1]END 37

P1:SIO 23PRNT 100SIO 32DISK 300WIO 0REQ [0,1]END 17

Ready queue:

P2

P3

PGMEND

Page 15: COP 4600 /EEL 4882 Project 4

Event Flow

University of Central Florida

Event Queue:

SIO WIO

Interrupt() Interrupt_Handler()

Scheduler() Dispatcher()

PGMEND

Obj3: End_Service

P1:SIO 23PRNT 100SIO 32DISK 300WIO 0REQ [0,3]END 17

Editor Editor LogoffScript:

Obj3: Next_pgm P4:SIO 18PRNT 200SIO 5PRNT 200WIO 19REQ [0,1]END 13

Ready Queue P2 P3 P4

Page 16: COP 4600 /EEL 4882 Project 4

Device List

University of Central Florida

DSK2

DSK1

PRNT

R1 R5

R3

R7

R6

SIO(R5) SIO(R7) EIO(R1)

Page 17: COP 4600 /EEL 4882 Project 4

Deadline

Deadline is Arp 4 (Friday) midnight

Late assignments are accepted five days after the due date with a penalty of 20 % off. After five days, assignments will not be accepted. The grade for those assignments will be zero.

University of Central Florida