DragonBasement(draft)1XEROXToFromDragonCore^RussAtkinsonCSLSubjectDateDragonBasementSeptember21,1984Releaseas??Camefrom/Indigo/Dragon/Doc/DragonBasement.tiogaLasteditedbyAtkinson,September21,19841:10:09pmPDTAbstractTheDragonBasementisaverylow-levelabstractmachinedesignedtosupportmultiplelanguagesonDragon.Thisabstractmachinerestsonthephysicalmachine,andprovidesthefollowingfacilities:processes,monitorlocks,conditionvariables,stackhandling,virtualmemory,andprimitiveI/Osupport.Mostbasicresourcesarevirtualized,soeachlanguagecandealwiththemachineasifitownsit.Thesebasicresourcesaretheterminal,mouse,keyboard,disk,Ethernet,andotherperipherals.Attributesdraft,technical,DragonTheDragonBasementOverviewTheDragonBasementprovidesabaselevelofabstractmachinethatisusedtovirtualizededicatedresourcesforDragon.WewanttosupportmultiplelanguageenvironmentsonDragon.Theseinclude,buarenotlimitedto,CedarMesa,InterLisp,andSmallTalk.Someoftheseenvironmentshaveverystrongideasabouttheirenvironments,withthecommonassumptionbeingthateachenvironmentcontrolsthemachine.Eachenvironmentdealswiththebasement,andnotwiththephysicalmachine.EnvironmentsCedar,Lisp,andSmallTalkwillhavedifferentconventionsformanagingruntimestructures.Althoughthereisacommoninstructionset,conventionsregardingcollectiblestorage,argumentpassing,andupperlevelsofprocessmanagementwilldifferamongtheenvironments.Eachenvironmentwillhaveitsownruntimedata.Thebasicstructureswillbeavailablethroughauxilliaryregisters.Otherfacilitieswillbeaccessiblethroughtrappinginstructions.pïfœî]î\î$qïfœîCNrïfýî{sïb î]ïb î2Pqï`cî] ï`cî2Pî6ï^»î2PsïTÊî]ïTÊî2PqïS"î]îžïS"î2Pî9Îî�ïD;î]îèîØîqî%+î,}î.Ðî5Pî8·î>�ïB”î]îìîî�î8î%‰î(hî.Vî0Òî7 î=& ï@ìî]î¥îÄî! î'œî+aî1²î5üî;ßî>¨ï?Eî]îîOîáî!Àî(˜î+! î2ˆî4‚î8î>ˆîA^ï=žî]î¯îgî‘îºî!2î"ªî&¸î)Eî-âî1ûî9 î;Ïî>‡ï;öî]îˆîaî Ýî'<î**î. sï8§î] qï8§îîý î#¿tï0aî]îî!]uï+jî]vï(î]îhîšî î%Îî'*î*wî-ðî/Üî5%î:Ýî=Ýî?|îBêï&sî] îƒîâî$î&mî+íî. î2%î3üî91î>Óï$Ëî] îÇî£î!,î%î*î+ûî.%î0qî4úî6× î>C ï#$î]îE îî î!þî%¸ î.|î1óî53î9‘î=?îARï!}î] î`î“î î%Ó î-)î1 î3òî7; î?bïÕî]î´îîp î%vî(ìî+þî.Vî4Åî7tî9áî<ôî?Kï.î]uïÞî] vïŽî]îëî{îPî"úî%Ãî)(î.ë î6Ÿî8úî?bïçî] îîŠî#cî%î&™î,™ î3Äî6Š î>pï@î] îíîî#;î(tî+8î/Hî3 î4æî9Æ îAîï˜î]î(î®î ïî]î îHî 'î#¢î%±î(éî.Uî2Ÿî5«î9S î?ÈîB¨ïuî]îZîÔ î# î)àî. î3¿î6¬î8ß î?aï Îî]îâ ñTVm$VDragonBasement(draft)2BasementProcessesandStacksDragonBasementprocessesarevirtualizedprocessors.Eachprocesshasitsownstackofframes,whereeachframecorresondstothecontrolanddataassociatedwithaprocedurecall.TheBasementprovidesforprocesscreation,termination,andscheduling.ProcessesAprocesscanonlyberunningonasingleprocessoratatime,butcanberunonanyprocessor.UnlikePrincOpsmachines,processescanberunningwithtrueconcurrencywhentherearemultipleprocessors.Theschedulerassociatesprocesseswithproecessors.Aprocessbecomesassociatedwithaprocessorwhenaprocessorisavailableandaprocessisready.Aprocessorbecomesavailablewhentheprocessitisexecutingwaitsforaconditionvariable,amonitorlock,apagefault,orwhenitstimesliceexpires.ThescheduleralsoturnsI/O(andtimer)interruptsintoconditionvariablenotifications.TheprocessmachineryturnsI/O(andtimer)interruptsintoconditionvariablenotifications.Eachprocesswillbeassociatedwithaparticularenvironment.Thebasepointersintotheenvironmentwillbeswitchedatprocessswitch.Whenaprocessorswitchesfromoneprocesstoanother,theformerprocessissaved,andthelatterprocessisrestored.ProcesssavinginvolvesstoringthestateintheEUstackregistersintomemory,andalsosavingsomeoftheconstantandauxiliiaryregisterstotheprocesscontrolblock.ProcessrestoringdoesnotincluderestoretheEUstack,sincethatwillhappendynamicallyastheprocessperformsprocedurereturns.Processrestoringdoesincluderestoringthoseconstantandauxilliaryregisterspreviouslysaved,andloadingthoseregistersassociatedwiththeenvironment.Asmallnumberofprioritylevelsareprovidedtodistinguishprocessesthataremoreimportantfromthosethatarelessimportant.Theschedulerrunshigherpriorityprocessesinpreferencetolowerpriorityprocesses.However,unlikePrincOps,thereisnoguaranteethatahighpriorityprocesswillpreemptalowpriorityprocess,evenwhenbothareequallyreadytorun.IfInterLispandSmallTalkretaintheircurrentnotionsofprocess,theywillbuildthierprocessesontopofBasementprocesses.MesaprocesseswillbeequivalenttoBasementprocesses.TheprimitivelockingfacilitieswillbeessentiallythesameasthoseinMesa.Thatis,thereareconditionvariablesandmonitorlocks,whereconditionvariablesareprotectedbymonitorlocks(exceptforthoseassociatedwithinterrupts).TheprimitiveswillbeEntryandExitformonitorlocks,andWait,Notify,andBroadcastforconditionvariables.Inaddition,thereisYield,whichwillforceentrytothescheduler(andcanbeusedtoyieldcyclestoadesignatedprocess).StacksThestackforeachprocessisconceptuallyalinkedlistofframes(a.k.a.activationrecords),withthemorerecentlycreatedframeslikedtothelessrecentlycreatedframes.Eachframeexistsintwoparts,volatileandstable.Thevolatilepartisstoredinregisterswhilethatframeismostrecentinthestackandtheprocessisrunning(associatedwithaprocessor),isstoredinresidentvirtualmemory(saveblocks)whentheprocessisnotrunningorwhenamorerecentframeforthatprocessisinmemory,andmaybeeitherinregistersorsaveblockswhentheprocesspïfœî]î\î$qïfœîCNuïb0î]î§îðî �vï^àî]îˆîòî#î%™ î,‰ î4Rî7ðî<ïî?�îA•ï]9î]î¿îfî(î/î"Oî&4 î,ýî.šî0èî5‰î8/î;# îA~ï[’î]î¾îxîLî \î&Òî,˜î/ î4î9é îAâïYêî] wïV›î]vïSLî]îùîÜîwî î î$çî&üî(6î,0î2Sî3ûî55î8Âî;Rî=íî?íîB“ïQ¥î]îE îÂî šî&ßî-‡î3Ëî6�î8Õî>SîAµïOýî] î îÕî ^î"²î(+ ïM‚î]îAîx î ­î&·î)Ý î2î3§î8†î>- ïKÛî]î~î¯îÉî…î µî&Ïî(Aî.î0Áî1ñî6Ìî8>î<òî>…ïJ3î]îþî¿î {î"áî'¼î)î*‹î0¼î4@î6„î7´î=ÚîCoïHŒî]î¢î÷î$înî"î#Îî'†î)dî,�î/ î55î8î>?îAïFåî]î˜î6îÈ î#‚î&Èî-Uî2ú î<î?ÅïE=î]îîŸîlî!�î%À î, î.äî5î:9 ïBÂî]îëîÛî¡î­ î%5î(kî)° î0 î9"î<î?LïAî]î+î€ î„î!%î# î(§î*5î.þî3ÿî8 î9,î?5ï?sî]î×î•î|î=î#³î&%î*Éî/¯î1.î5cî8-î: î>GîC-ï=Ìî]îÞîéî!Mî&Ðî+Žî.î1vî3Qî5Üî8“î<2îAÁï<%î]îîÊî�î Àî$Kî%ýî(Uî-¼î0l î6lî;Çî=mî?Åï:}î]î*îúîòî%Çî)î+¡î0šî5:î7´î:Yî>>îAËï8Öî]îçî± î ;î!Èî$î(¸î.sî4Õî:!î>Þï7/î]î¡î”îcî#î(˜î+c î1~î6õ î=«îAâï5‡î]îFîåîH î%´î(Ïî+/ ï3 î]îÕî_îwîî!ûî%±î'ðî-­î/G î6$î< î>ÇîAï1eî]îÞîeî$î"î$†î'; î.¸î1°î7ûî;5î?¤ï/½î]îHîä î—î!3î$ëî)Í î0‚î6¥î:ÌîAï.î]î»î´îñî²îÎî!çî&Îî+”î.2î3žî4ºî7Mî<4îASï,oî]îîNî¢îvî#@î$ïï)óî]îüîîëî"•î&žî*î.éî3äî5»î;î>1î@ùï(Lî]î¥î£îªî î Úî' î-õî1Ÿî7�î:Jî<; îBêï&¥î]îœ ï$)î]î>î.î î$uî')î)# î/¸î2 î5¦î7]î;î<»îARï"‚î]îHîøîsî¹î%›î(yî-âî1Þî6îNïŒî]î»îû î Ôî"Äî(¬î,Vî-ãî2î6Jî9î<µî@jîB9ïåî]îˆî¸îDî4î"pî$î'†î+}î-,î.U î5%wï–î]vïFî]îLîÖî*îrî"]î#ß î+ñî-1î1�î3Öî5¦î:7î>Y ïŸî]î,îqîúî ·î&î+ î/±î3Mî5%î7¯î:nî?Ïïøî]îî î¿î"œî$sî'Gî+0î0,î3 î8%î;%î@!îC-ïPî]îŸîlîíî Àî#­î'Âî)Mî,Èî1 î2×î5Uî8çî;½î>;îC-ï©î]îÈ îâî!0î"Ž î)§î+Gî/žî1�î6ìî;zîAï î]îTîBîÛî!èî#�î&<î+¬î-©î1—î2úî6Çî;$î?TîAËï Zî]îîxîîÆî!kî$]î&;î*î+°î1î2²î5¤î9Õî=xî?Å "TVm$zDragonBasement(draft)3isrunning,buttheframeisnotmostrecent.Thestablepartisalwaysinnormalvirtualmemory(notnecessarilyresident).Thecompilerisresponsibleforthedistinctionbetweenvolatileandstablepartsofaframe.ThestackmachineryincludestheprovisionofAllocandFreeforsaveblocksandthestablepartsofframes.TosupportstacktracingforCedargarbagecoollectionwewillalsobeabletoquicklyenumeratethesaveblocksandstablepartsofprocesses.BasementVirtualMemoryWeplantosupportasimplepagebasedvirtualmemorysimilartotheCedarVM.Someenvironmentsmayrequirecertainaddressranges.Wearecurrentlyassumingasingleaddressspace.Somespecialfeaturesmaybenecessaryforsupportingnon-Mesaenvironments,buttheyhavenotyetbeenidentified.TheCedarVMmodeldealsinintervalsofpages.Hereisapartialoverviewofitsoperations:Allocate:allocatesagivennumberofpages;optionsmayspecifyalignment,orrestrictallocationtocertainrangesofpages,orpreventintervalsfromcrossingcertainboundariesFree:freesagivenintervalTouch:causesthegivenintervaltobeswappedin(butnotpinned)Kill:causesthecontentsoftheintervaltobeunpredictable,thiscallcanreducepagetrafficbyindicatingpagesthatdonotneedtobeswappedoutPin/Unpin:forcesthegivenintervaltoberesident/swappableuntilthenextsuchcall,acountiskeptforthenumberoftimesapageispinnedMakeReadonly/MakeWritable:appliestoanintervalClean:writesdirtypagesintheintervaltothebackingstoreAge:makespagesintheintervalmoreliabletobeswappedoutBasementDiskAtthelowestleveltheBasementprovideslogicallyseparateregionsofthedisk,witheachenvironmentassumingcontrolofoneormoreregions.Operationsareprovidedtoreadandwriterunsofpagesto/fromvirtualmemory.Eachenvironmenthasitsownfilesystem.AlthoughitdoesnotnecessarilybelongtotheBasement,weshouldprovideaccesstotheCedarFSlevelforenvironmentsthatwanttosharefileswithCedar.Itisnotyetclearwhethertheavailablehardwarefordiskswillsupportlabels.Thiswillaffectthediskabstraction,butshouldnotgreatlyperturbprogramsabovethislevelofdisk.BasementEthernetSendingisnoproblem,justhandpacketstothedispatcher.Presumablythepacketreceivedcontainsenoughsocketinformationtorouteittotherighthandler.Therewillbesomecommonroutinestohandleroutingtables,statistics,andsoforth.Thisneedsmoredeignwork,particularlytohandlebroadcastandmulticastpackets.BasementTerminalpïfœî]î\î$qïfœîCNvïb2î]îÝî�îî‹î!–î#î% î)î.:î1&î5'î8 î9 î>î?Üï`‹î]îî¿îû î&" î-Iî0nî6vî8/ î?¯îB9ï^äî] îî†î"Yî%î(üî,dî.î/Gï\hî]îFîÊî”î$ î&yî,’î.\î2î4Þî8)î:xî=ŒîAâïZÁî]îÍîÊîCî î"…î$½î)Úî-^î2î4Nî8wî=© ïYî]îÍîÀîÕîîPî!Fî&nî-{î0"î3oî7ûî:ûî?/îBàïWrî] uïT#î]î§îNvïPÔî]îñîîÍîâîî#ƒî&Óî*¾î/"î4™î9'î:ßî=HîAjïO,î]î, î¸î µî%vî)öî.Ùî3öî6yî8Æî>œïM…î]îÇîòîî!.î%Dî*î/mî2±î4âî;5î=³ ïKÞî]îÈ î ³î#4î&Dî)‹î,î.Iî1¦ ïIbî]î<î[î:îzî"þî$³î*>î+þî0³î4-î5 î6Ñî;'î@þîB¾ïG»î] ïEÌîîÆî!=î"Zî&î+!î,Íî1|î6Nî9Eî=Õ ïD%î¢î’î P î&¼î(–î-Iî1Äî3©î7ùî9éî?ïB~î¢î î"Jî&Ñ ï@�îî¸î î3î!çï>¡îîÍîî!fî%î*î+Èî-¹î3_î5 î8î:|ï<³îî“îñî tî&î'äî*gî/‹î1]î3r î<™î?_îBï; î¢î î!=î%7î' î-lî1#î3Þî5Ñî82î;{î=î>óï9dî¢ï7vî îpî!iî#¿î'jî,`î.î/íî;öî?3îA‰ï5Ïî¢îÓî¶î àî$·î&"î)=î+zî-Úî3î4¿î8iî9“î<Ùî>Eï3áîî)Fî-îî/œî1Œï1òîîtîuî!Çî%’î'@î) î.Ÿî0Nî2­î7Îï0îî_î˜î!cî#î%pî*pî.î1Âî3qî5bî;uï,µî]î§vï)fî]îHî—îÀîöîEî%tî*óî0Pî5˜î:Pî;ùî>HîA~ï'¾î]ît îhî"Jî&âî(�î+î,»î04î5£ î<Žî>Çï&î]î î#îØîTîmî!%î$îî*.î.‡î4Ìî8> î@KîB¾ï$pî]îaîÊï!ôî]î„îâîî˜ î%yî*î+¾î.%î4Åî6õî;xî@‹ï Mî]î îkîƒî¶îüî!9 î)Ìî,šî/÷î1¥î5Dî82î;LïÑî]îÎî3î¡îãî.î!uî#Îî)‚î/„î1ºî5&î7Ëî<ÐîAï*î]îîéîSîL î$«î'6î+½î.<î2Íî7Íî=ëîA÷ï‚î]î£î\uï3î]î§vïäî]î³îî!îûî"šî&î*ôî, î.ý î6n î=àî@>ï<î]îÈî)î!î%< î,Ãî.oî2 î3^î5 î7gî:¶î@—ï•î]îøîÙî]îýî$:î%Øî*Oî/î3H î8ôî;œî=PîAïîî]î>îÑîœî q î'ºî)iî-ïî4î6Òî<¯uï žî]î§ÿ²TVm$µDragonBasement(draft)4TheBasementTerminalisavirtualizationofthedisplays(colorandB&W),mouse,andkeyboardfortheDragon.TheinitialassumptionisthattherewillonlybeonephysicalterminalforanygivenDragon,althoughextensiontomorephysicalterminalsisprobablyeasyenough.Wealsoassumethateachprogrammingenvironmentwillwantaseparatevirtualterminal,althoughitmaybepossibleforsomeenvironmentstousethedisplayfacilitiesprovidedbyotherenvironments.BasementJunkBasementjunkiseverythingthatdoesnotfitintheothercategories.TimeWeneedcommonsupportfortimeofday,conditionvariabletimeout,andhigh-precisionintervaltime.Theconditionvariabletimeoutinteractsintimatelywiththeprocessmachinery.Ideallyitisalsobasedonthehardwareprovidingtheintervaltimersowedonotneedtobaseitonthedisplayrefresh.FloatingpointOurbasicfloatingpointsupportis32-bitIEEstandard,withtheimplementationbeingperformedbyhardware.ThehardwareislikelytosupportdoubleprecisionIEEEfloatingpointoperationsaswell.AtleastweneedtosupportwhatisinReal.dfforalllanguages.Thisincludesconvertingbetweenrealnumbersandcharacters,commonmathematicalfunctions(trigonometric,exponential,andsoforth).TrapsThevariouslanguageswillhavedifferentmeansfordealingwithtraps.Thecommontraphandlerswillsimplydispatchthroughthetraphandlersspecifiedintheenvironmentdata.Inaddition,weneedameansforturningPCsintohandlersfordealingwithtrapsandsignals.ByexaminingthehighbytesofthePCandexamingatablekeptbytheloaderwecandeterminewhichprocedure(ormodule)isexecuting,andwecancallanexceptionhandlerassociatedwiththeprocedure(ormodule).Thisfacilityshouldbecommon,sincealloftheenvironmentsneedsomethingofthissort.RPCSomebaselevelsupportisnecessaryforsupportingtransportofRPCpacketsthroughthemachinewhenRPCisusedforcommunicatingbetweendifferentenvironments.ItislikelythatwewillhavetosupporttheoldformatsofRPCforMesaaswellas32-bitorientedformats.pïfœî]î\î$qïfœîCNvïb*î]î3îqî aî!Ëî"ó î+Bî,ùî/Wî4Œî8�î;7î?çï`ƒî]îîîSî°î$‡î']î+F î2‚î3ëî6·î:>î<çî?ÿîAíï^Ûî]îîÍîßî Uî#Þî) î.›î4Žî6î9yî>œï]4î]îÄî‘î‘î!Mî#Óî&›î+_î.)î1U î9ã îAîï[�î]î°îÏîîmî%4î*æî,2î/,î1î6Jî8}î< ïYåî]î î€îàî’ î!öî'Çî)Ãî-b uïV—î]î§vïSHî]îœîÍî9 î"ýî%Ëî(ûî+pî-@î.îî1Mî4ì wïOùî]vïL«î]î]î/îTî#Õî&‡î*!î,Pî/¾î6Rî;þîAâïKî] î9îî"êî%§î+«î0Çî5Ãî;" îA~ïI\î]îŸîV î°î$$î%]î&«î)Zî-î/î1Iî75î=Wî?™ïGµî]îîËîòîùînî Êî"yî%“î&éî(ðî+Oî0wïDfî]îÄvïAî]îgîî2î ÷î&*î'¼î+Úî.Ùî4óî84î:º ï?pî]î4îî î%î'ëî.î/wî3Bî4üî:î>¼ï=Éî]îLî‡îW î%5î'î+?î-jî0Àî3î6¦î8„î=ÁîAOîBëïéï0Žî]î§îžî°î"†î(]î-ûî0Áî4 î:î@%îB9ï.çî] îlï,lî]î:îîEî¯îçî$9î&„î+rî.Wî1>î6Ûî9&î>îA1ï*Äî]î%î‘î¾î"{î$ëî(!î+Æî-�î/ÿî2cî5+î:¿î;ùî?rîB�ï)î]î¹îîîî™î#î'"î-¡î/Úî5Pî6¸ î=6î?êîBï'vî]îûîþîFî!e î'äî+î-„î4î6jî<åî@ï%Îî]îÙîÊîÒî!Dî#4î$íî'M î/àî3=î9àî;™î>:wï"€î]vï1î]îîî&î î!Vî'Eî)^ î0 î5Ùî7mî:¦î?aïŠî]î¶î3îáî 7î!›î$Ñî' î0¨î6î;® ïâî]îÓî>îûîÈîîî˜î"Þî$‹î)–î+ôî.\î3[î5î8mî:ªî>Rî?þîBëï;î]îTîÃÿ(TVm$ÿ TIMESROMANþŸÿ TIMESROMANþŸÿ TIMESROMANþŸÿ HELVETICAý…ÿ HELVETICAþæÿLOGOý‡ÿ HELVETICAþŸÿ HELVETICAþ° ô ñj!j/$"�{:iÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ[]<>Dragon>DragonBasement.tioga&Friday, September 21, 1984 1:19 pm PDT