Aar큀  P  p`P`0@ P HH $ @d HHHH̀̀̀ff@  d Footnote TableFootnote**.\t.\t/ - :;,.!?), cN ;dTOCHeading1Heading2   WEquationVariablesHt ;`<<=7=P=i=;B;D;F;H <$lastpagenum><$monthname> <$daynum>, <$year>"<$monthnum>/<$daynum>/<$shortyear>J<$hour>:<$minute00> <$ampm> on <$dayname>, <$monthname> <$daynum>, <$year>"<$monthnum>/<$daynum>/<$shortyear><$monthname> <$daynum>, <$year>"<$monthnum>/<$daynum>/<$shortyear> <$fullfilename> <$filename> <$paratext[Title]> <$paratext[Heading1]> <$curpagenum> <$marker1> <$marker2> (Continued)+ (Sheet <$tblsheetnum> of <$tblsheetcount>)Heading & Page <$paratext> on page<$pagenum>Pagepage<$pagenum>See Heading & Page%See <$paratext> on page<$pagenum>. Table All7Table<$paranumonly>, <$paratext>, on page<$pagenum>Table Number & Page'Table<$paranumonly> on page<$pagenum>Heading <$paratext> HTML Headings++A335579A<<>>@@A\;b;d;f;h;j;l;n;p;r;t;v;x;z;|;~;;;;;;;;;;;;;;;;;;;;;El@En;;;;;;;;;EA E;;;;;;;;;;;;;;;;;;;EAPE;;;;;;;;;<<<<<< < <<<<<<<<F(AF*<"<$<&<(<*<,<.<0<2<4<6<8<:<<F\AF^HH  W,eH* }H ;=?H  W-eN }H ;>@H  W.eN } H ;?A H  W/a }H(;@BH(  W0e P:Numbered }HH(;ACHH(( 2eP 1e Parent = OL A3e Depth = 0 }H(;BDH(  W4eN }H(;CEH(  W5eY } H(;DF H(  W6a }H ;EGH  W7e P:CellBody }HH ;FHHH  W8eP }H ;GIH  W9eN }H ;HJH  W:eN } H ;IK H  W;a }H ;JLH  W<eP:CellHeading }HH ;KMHH  W=eP }H ;LNH  W>eN }H ;MOH  W?eN } H ;NP H  W@a }H ;OQH  WAe P:Footnote }HH ;PRHH  WBeP }H ;QSH  WCeN }H ;RTH  WDeN } H ;SU H  WEa }H(;TVH( WFe P:Bulleted }HH(;UWHH((HeLI Ge Parent = UL AIe Depth = 0 }H(;VXH( WJeN }H(;WYH( WKeN } H(;XZ H( WLa }H ;Y[H WMe P:Heading2 }HH ;Z\HH WNeH* }H ;[]H WOeN }H ;\^H WPeN } H ;]_ H WQa }H;^`HgR% P:HeadingRuEnIn }HH;_aHH WSeP }H<`bH WTeN }H<acH WUeN } H<bd H WVa }7H <ce7H WWe P:Indented }H7H < dfH7H WXeP }7H < eg7H WYeN }7H < fh7H WZeN } 7H <gi 7H W[a }CH<hjCHg\% P:TableFootEnote }HCH<ikHCH W]eP }CH<jlCH W^eN }CH<kmCH W_eN } CH<ln CH W`a }]H(<mo]H( Wae P:TableTitle }H]H(<npH]H((ceLI be Parent = OL Ade Depth = 0 }]H( H "W4a }©H <=?©H #W5e P:BodyIndent }H©H <>@H©H #W6eP }©H <?A©H #W7eN }©H <@B©H #W8eN } ©H <A ©H #W9a }d <D`Fd F$W:aHTML Options Table }Dd <DDd F$W;a }d <Dd F$W<a }D <DCGD F%W=eControl }DH <DFHDH F%W>eValue }H <DGIH F%W?e Comments }D6<DHJD6 F&W@e Image Format }DH6<DIKDH66F&A2% 0001IMAGGIF p MACP0001GIEF }H6<DJLH6 F&WBa }D <DKMD F'WCeBanners }DH <DLNDH F'WDeN }H <DMOH F'WEa }D<DNPDF(F% Banner ReferPE ence Frame }DH<DOQDH F(WGe }H<DPRH F(WHa }D(<DQSD((F)I$% Copy Files  Imported by PE Rerefernce }DH(<DRTDH( F)WJe }H(<DSUH( F)WKa }&D(<DTV&D((F*L$% Copy Files  Imported by PE Reference }D&H(<DUWD&H( F*WMeN }&H(<DV&H( F*WNa }d <D[d F+WOaSystem Macros }?d <D?d F+WPa }d <Dd F+WQa }? <DX\? F,WRe Macro Name }?H <D[?H F,WSe Replace With }H <D^H F,WTe Comments }? =D]_? F-WUe StartOfDoc }?H =D^?H F-WVa }H =DaH F-WWa }? =D`b? F.WXe EndOfDoc }?H = DaX?H F.WYa }H = DXdH F.WZa }?= Dce?F/[% StartOfSubPEDoc }?H=DdY?H F/W\a }H=DYgH F/W]a }?=Dfh?F0^% EndOfSubPEDoc }?H=DgZ?H F0W_a }H=DZjH F0W`a }?=Dik?F1a% StartOfFirstPESubDoc }?H=Dj[?H F1Wba }H=D[mH F1Wca } ?=Dln ?F2d% EndOfFirstPESubDoc }? H=!Dm\? H F2Wea } H=#D\p H F2Wfa }$?=%Doq$?F3g% StartOfLastPESubDoc }?$H='Dp]?$H F3Wha }$H=)D]s$H F3Wia }>?=+Drt>?F4j% EndOfLastPESubDoc }?>H=-Ds^?>H F4Wka }>H=/D^y>H F4Wla }tH BDewtH F5Wme C:Emphasis }HtH BDvxHtH F5WneEM }tH BDw_tH F5WoeN }^d =8Du|^d F6WpaCross-Reference Macros }?^d =:D?^d F6Wqa }^d =<D^d F6Wra }n? =>Dy}n? F7Wse Macro Name }?nH =@D|~?nH F7Wte Replace With }nH =BD}nH F7Wue Comments }z?=DD~z? F8Wve See Also }?zH=FD?zHF8w% See Also: PE <$paratext> }zH=HDzH F8Wxa }d ?Dd F+Wye }H ?D\]H F,WzeHead }H @D_`H F-W{e }šd =QD šd F:WaGeneral Macros }?šd =SD?šd F:Wa }šd =UDšd F:Wa }šd =WDšd F:Wa }ª? =YD"ª? F;We Macro Name d= d= d l d= du  WBm }d = d  <W|aHeadings Table }Hd = Hd  <W}a }Hd = Hd  <W~a }H= H  =WeHeading Level }HH= HH =g%Paragraph ForEmat }H= H  =We Comments }H= H >W e2 }HH= HH  >We Heading1 }H= H  >Wa }KH = KH  ?We3 }HKH = HKH  ?We Heading2 }KH = KH  ?Wa }WH = WH  @We4 }HWH = HWH  @W e Lettereda }WH = WH  @W a }cH= cH  AW e1 }HcH= HcH AW  eTitle }cH= cH  AW a HHˆ>DHHˆ  X`"Organization of operating systems [`&monolithic: processes are subroutines ]u`/kernel: operating system calls are subroutines _`4process hierarchy: virtualize lower level resources a |object oriented: view system as collection of objects (processes, procedures, pages, devices, messages,  etc .) and J @ lQuestion: how do processes interact with the hardware of the computer? What does the program that mediates J@%this interaction (kernel) look like? tVY`The system kernel u`FHHˆ79 ld>G99 }?ªH =[D #?ªH F;We Replace With }ªH =]D"$ªH F;W eHead }ªH =_D#%ªH F;W!e Comments }¶? =aD$&¶? FCW"a }?¶H =cD%'?¶H FCW#a }¶H =eD&(¶H FCW$a }¶H =gD')¶H FCW%a }d =jD(.d FDW&aCharacter Macros HHˆ;"HHˆ+Ge HHˆ;$3HHˆ**l}?d =lD?d FDW'a }d =nDd FDW(a }? =pD)/? FEW)e Character }?H =rD.0?H FEW*e Replace With }H =tD/1H FEW+e Comments }? =vD0B? FFW,e HUV ;.HUV 3Ge HUV ;05+HUV 22l H$ ;1H$ 5Ge H$ ;33H$ 44l HHˆ;4HHˆj\//7 ` Beginnings of Operating Systems 0,`history of operating systems 2 oGoal: To look at the history of operating systems and see why they developed as they did; to se the basic funcI@'tions and designs of operating systems 5Ut` First Generation (vacuum tubes) 6`hardware only, open shop 7` Second Generation (transistors) 8`(separation of programmers and operators `'batching, satellite systems, buffering `Cdevice independence, resident loaders, first operating system, JCL :`5Atlas system: extracodes, interrupts, virtual memory ;*`'Third Generation (integrated circuits) <`+spooling, job scheduling, multiprogramming 1wg`Kprotection, traps, fence registers, privileges, system calls, time sharing ?`4virtual machines: levels of abstraction, THE system ` customer service, compatibility @0`Fourth Generation (VLSI) A`1minicomputers: rise of the UNIX operating system B`Imicrocomputers: workstations, personal computers, open operating systems C ]`!Networks and Distributed Systems D`,networked vs. distributed operating systems F1`Operating Systems Functions HC mGoal: To look at common operating system functions, see what a good operating system needs to do, desireable O@ features. K[Y`I/O Functions L`polling, interrupt-driven 3tD#`DMA, I/O controller M`Process Functions N` creation 4ݸ` deletion 9` scheduling =`synchronization, communication O*`Memory Functions P` allocation >wK` deallocation E` management Q`Secondary Storage Functions R`bringing data in and out G`address translation S]`User Interface Functions T`command interpreter I*t`job control language U6?`Desireable Features V` efficiency JOD ` reliability 1`maintainability A2` smallness HHˆ;6HHˆ 66 l HHˆ>H!HHˆƒ339 `MINIX Context Switch Routine ,` Introduction  pThis is the MINIX context switch routine; it is lines 63196345 of the MINIX operating system (see the text, p. I@&596). My comments follow the program. ! sThe basic idea is to execute any pending interrupts. If there are any, the process receiving the interrupt becomes ythe current task; otherwise, the current task is the one already chosen. Load the segment descriptors for the task to be |run, reset the interrupt vector so the next interrupt will cause the process state for the task to be saved properly, reset @,the registers, and return to the next task.  `Program  `V06319|*===========================================================================*  `V06320|* restart *  `V06321|*===========================================================================* `06322_restart: d`06323 e`'06324! Flush any held-up interrupts. n`R06325! This reenables interrupts, so the current interrupt handler may reenter. p`T06326! This does not matter, because the current handler is about to exit and no r`U06327! other handlers can reenter since flushing is done only when k_reenter == 0. `06328 w`I06329cmp(_held_head),0! do fast test to usually avoid function call y`06330jzover_call_unhold z`;06331call_unhold! this is rare so overhead acceptable |`06332over_call_unhold: `;06333movesp,(_proc_ptr)! will assume P_STACKBASE == 0 3`B06334lldtP_LDT_SEL(esp)! enable segment descriptors for task 4`=06335leaeax,P_STACKTOP(esp)! arrange for next interrupt 6`C06336mov(_tss+TSS3_S_SPO),eax! to save state in process table 7`06337restart1: 8`06338decb(_k_reenter) 9`06339 o16popgs :`06340 o16popfs ;`06341 o16popes <`06342 o16popds =`06343popad >`%06344addesp, 4! skip return adr ?`"06345iretd! continue process @` Comments A쪤 m06331If MINIX takes this call, it enters a routine that pulls the first process off the interrupt queue and `puts it into the ready position (see the routines  over_call_unhold  at 0739707419 and @!interrupt  at 0693507003).   n0633206345If the restoration of registers is interrupted, then the system will have to know which ones were @Schanged and which ones were not. This is not possible, so interrupts are ignored. $``0633306337These lines prepare interrupt addresses and task segments for the next task to run.  n06338The control is about to leave the kernel.  _k_reenter  is the number of times the kernel has re-0;mentered (invoked itself). If this variable is 1, the next task is not a kernel task. Otherwise, it is. While @7within the kernel, user-level interrupts are disabled. R r0633906343These restore all the registers of the process to be run except the return address, which must be han\@dled specially. i`'06344Here the stack pointer is reset.   k06345This returns control to the next task. It takes the return address from the stack (which is what the P€@Cprevious instruction sets up) and puts it in the program counter. HHˆ>J!HHˆ 88 l}? ? KG?  BWse d;;<@H$ ;<;>H$ == l H$ ;=;H$ <Wl7January 5, 2000ECS 150 Winter 2000Page 2  HUV ;>;<@HUV ?? l HUV ;?;HUV >Wl?Last modified at  9:58 pm on Monday, January 3, 2000  HHˆ;@;>HHˆAA l HHˆ;A;HHˆ@W` }?H =xD1C?H FFW-e¢ }H =zDBUH FFW.a d=~EEd=Dd FF l d=Dd $pQE$pkfavCFILORUX[^adgjmpsy| %).1UROLI:}?H ? :H?H  BWe... }H ? GH  BWe }? ? NJ?  GWe }?H ? IK?H  GWe- }H ? J:H  GWe }? ? M?  HWe }?H ? LN?H  HWe-- }H ? MIH  HWe }? ?DTP? FIWe }?H ?DOQ?H FIWe° }H ?DPH FIWe }? ?DWS? FJWe }?H ?DRT?H FJWe® }H ?DSOH FJWe }? ?DCV? FKWe }?H ?DUW?H FKWe© }H ?DVRH FKW e }H @DbcH F.W!e }H@DefH F/W"e }H@DhiH F0W#e }H@DklH F1W$e } H@ Dno H F2W%e }$H@ Dqr$H F3W&e }>H@Dtu>H F4W'e }tH BDx`tH F5W(eN } tH BD_C tH F5W)e }hH BDjbhH F9W*e C:Computer }HhH BDacHhH F9W+eEM }hH BDbdhH F9W,eN }hH BDcehH F9W-eN } hH BDdv hH F9W.e }NHBDogNHFL/%P:Section 2 tiPEtle }HNHBDfhHNH FLW0eP }NHBDgiNH FLW5eN }NHBDhjNH FLWBeN } NHBDia NH FLWCe }BH BDtlBH FMWDeP:Line }HBH BDkmHBH FMWEeP }BH BDlnBH FMWFeN }BH BDmoBH FMWGeN } BH BDnf BH FMWHe }6H BDq6H FNWIe P:Lettereda }H6H BDprH6H FNWJeH* }6H BDqs6H FNWKeN }6H BDrt6H FNWLeN } 6H BDsk 6H FNWMe }H(B~vH( OGNe P:Lettered }H(BuwH((O^eLI We Parent = OL AOe Depth = 0 }H(BvxH( OGPeN }H(BwyH( OGQeN }H(BxH( OGRe }HB{HPgS% P:CodeComEment }HBz|H PGTeP }HB{}H PGUeN }HB|~H PGVeN }HB}uH PGWe }H BBH QGXe P:CodeASM }H BH QGYeP }H BH QGZeN }H BH QG[eN }H CzH QG\e }hDCD hDFR_% CSS Export PE Encoding }DhHCDDhH FRW`e ISO-8859-1 }hHCDXhH FRWae }NDCDWNDFSb% Export EnPEcoding }DNHCD DNH FSWce ISO-8859-1 }NHCDNH FSWde dC dC d@LH LI:dC dE  l dLeftd;Rightd ReferenceddHTMLd DHTMLd Headingsd d!d HTML@@ XMapping Table Title. @@ XBody. @@ XMapping Table Cell. @@XMapping Table Cell. @@ XFooter. f@T X TableTitleT:Table : .  f@ XBody. @@ XHeader Double Line. f@ X CellFooting. f@ X CellHeading. f@ X CellBody. @@ XMapping Table Cell. @@1Mapping Table Cell. @@ 1Mapping Table Cell. @@ XMapping Table Cell. f@ XBody. f@ X BodySpaced. f@ X Bulleted\t. f@ X...Date. mf@ Xl. DateProject. @@ XHeader Double Line. f@T XHeading1Body. $f@L X$. Lettereda L:.. f@ X NumberedSpaced.\t. f@ X.Reading.  f@PXTitleBody. f@$X.Line Single Line. f@ XCellBody. f@ X CellHeading. f@ X Footnote. f@T XHeading2Body. f@T X HeadingRunInBody. f@ X Indented. f@ X TableFootnote. f@T X TableTitleT:Table : .   f@PXTitleBody.  f@T XHeading1Body. $f@L X$. LetteredL:.. f@NE X Numbered1 N:.Numbered. f@NE X Numbered1 N:.Numbered. $f@L X$. Lettereda L:.. $f@L X$. LetteredL:.. L̀Lf@N X Numbered N:.< =1>. L̀Lf@N X Numbered N:.< =1>. Hf@ XH.. CodeComment. f@   $.6.Z.u..CodeASM. f@ X BodyIndent. f@ X BodyIndent. f@   $.6.Z.u..CodeASM. Hf@ XH.. CodeComment.  X XX X 1 X ڝXXEmphasisXEquationVariables ڝX 1  BoldItalic XItalic XBold X1 XX X      Computer   ComputerZZThinMediumDoubleThick@ Very Thin HHHHHFormat AH Mapping Table HHHHHFormat BH Mapping Tableh65HHHHH$RDHH+4?HHH68?HH :C?HHHTDB?HH*< ? @ h( A B C D E h  F G H I J h  K L M N O h  P Q R S T h( UVWXYh Z[\]^h_`abc7h defghChijklm]h(nopqrh stuvwh xyz{|h(}~h h    h  h h h)h  !"#$5h%&'()Oh  *+,-.[h!/ 0 1 2 3 uh "4!5!6!7!8!h!#9":";"<"="©h "Q>#?#@#A#B#d %FC$D$E$ $&FF%G%H%6%'FI&J&K& &(FL'M'N'')FO(P(Q(((*FR)S)T)&()SFU*V*W*d ,FX+Y++Z+ +-F[,\,,], ,.F^-_--`- -/Fa.b.X.c..0Fd/e/Y/f//1Fg0h0Z0i002Fj1k1[1l1 13Fm2n2\2o2$24Fp3q3]3r3>3Fs4t4^4u4th 9Fv5w5x5_5`5^d 7Fy6z6{6n 68F|7}7~7z7F888hh L5Fa9b9c9d9e9šd ;F::::ª :CF ;";#;$; =  <<<<> ====? >>>K >@ ???W ?A @@@c@ AAA G :BGBHB¶ ;F%C&C'C(Cd EF)D,D-D DFF.E/E0E EKF1FBFCF HB IGJGKG IG LHMHNH JHFOIPIQI KIFRJSJTJ FJFUKVKWKNhM9FfLgLhLiLjLBh NLFkMlMmMnMoM6h OMFpNqNrNsNtNh(PNuOvOwOxOyOhQOzP{P|P}P~Ph #PQQQQQhSFRRRN*RFSS SComment ;C ;Gd BlackT!WhiteddARedddGreendd BluedCyandMagentad YellowHeader/Footer $1Header/Footer $1Header/Footer $2Header/Footer $2IndexIndexCommentCommentSubjectSubjectAuthorAuthorGlossaryGlossaryEquationEquation Hypertext Hypertext  Cross-Ref Cross-Ref Conditional TextConditional TextPositionFMPrivatePositionFMPrivateRangeEndFMPrivateRangeEndFMPrivate HTML Macro HTML Macro M.Times.P Times-Roman FrameRoman M.Times.B Times-Bold FrameRoman M.Helvetica.BHelvetica-Bold FrameRoman M.Courier.PCourier FrameRomanM.Helvetica.BIHelvetica-BoldOblique FrameRoman M.Times.I Times-Italic FrameRoman FrameRomanfCourier0 HelveticaWTimes"Regular$Roman MediumBoldRegular ObliqueItalicpưs2H".(T"3 fx;5n"c[<.E8?,Fa|{IS1DItCwi2UEo!FizY;݁Ie![N)b]y4)fuT}MQ3G17tSB1./-śCE}c1