Interrupts s01

Interrupts s01 - 08-1 08-1 Notes .6...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 08-1 08-1 InterruptsandExceptions Notes MaterialinthissetfromSection3.6. Thebookuses“exception”asageneraltermforallinterrupts ... ... inthesenotesinterruptisusedasthegeneralterm ... ... andanarrowerdefinitionisusedforexception. Thedefinitionsoftrap,interrupt,andexceptiongivenhere ... ... arenotexplicitlyprovidedinthetext ... ... butarewidelyused. 08-1 EE4720LectureTransparency.Formatted13:34,19February2001fromlsli08. 08-1 08-2 08-2 Interrupts Interrupt: Eventthatinterruptsnormalprogramflow. Operatingsystem“takesover”computer ... ... attendstowhatevercausedtheinterrupt ... ... and(mostofthetime)resumesinterruptedprogram. InterruptTerminology Handler: TheOSprogramthat“takesover”inresponsetointerrupt. PrivilegedMode: AstateinwhichtheCPUcontrollerandmemorysystem ... ... donotrestrictinstructionsthatcanbeexecuted ... ... ormemorythatcanbeaccessed. Processorswitchesintoprivilegedmodeinresponsetointerrupt ... ... andoutofprivilegedmodewhenresumingtheprogram. 08-2 EE4720LectureTransparency.Formatted13:34,19February2001fromlsli08. 08-2 08-3 08-3 ThreeTypesofInterrupts. • Trap: SortofasubroutinecalltoOS. • Exception: Somethingwentwrong,triggeredbyanexecutinginstruction. Exceptionhasbothageneralandthisspecificmeaning. • HardwareInterrupt: SomethingoutsidetheCPUistryingtogetthecomputer’sattention. Interrupthasbothageneralandthisspecificmeaning. 08-3 EE4720LectureTransparency.Formatted13:34,19February2001fromlsli08. 08-3 08-4 08-4 Traps Trap: (1)Aninstructionintendedforuserprogramsthattransferscontroltotheoperatingsystem (privilegedcode). (2)Theexecutionofsuchaninstruction. SortofasubroutinecalltoOS. TrapcausesbranchtoOScodeandaswitchto privilegedmode . PrivilegedMode: Aprocessormodeinwhichtherearefewerrestrictionsoninstructionexecution. Someinstructionscanonlybeexecutedinprivilegedmode. Wheninprivilegedmodea traphandler isexecutedtoservicerequest. TrapHandler: Aprogram,runninginprivilegedmodethatrespondstoatrap. TrapstypicallyusedforI/O,memoryallocation,etc. 08-4 EE4720LectureTransparency.Formatted13:34,19February2001fromlsli08. 08-4 08-5 08-5 Example,SPARCV8trapinstruction: ta ( rs1 ) , ( imm ) . ISAhasa trapbaseregister(TBR) thatisusedtoconstructthetrapaddress. Trapaddressisin traptable ,eachentryholdsfirstfourinstructionsoftraphandler. TrapAddressConstruction: OSinitializesTBRwithupper20bitsoftraptablebase. When,say, tar1,3 executed,bits4-10settolowsevenbitsof r1+3 . LowfourbitsofTBRalwayszero. 08-5 EE4720LectureTransparency.Formatted13:34,19February2001fromlsli08. 08-5 08-6 08-6 Example:UsingtrapforreadonSolaris(SunOS) SystemCalls read(2) NAME read,readv,pread-readfromfile SYNOPSIS #include<unistd.h> ssize_tread(intfildes,void*buf,size_tnbyte); DESCRIPTION Theread()functionattemptstoreadnbyte bytes...
View Full Document

{[ snackBarMessage ]}

Page1 / 22

Interrupts s01 - 08-1 08-1 Notes .6...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online