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.pf]\$qfCNrf{sb ]b 2Pq`c] `c2P6^2PsT]T2PqS"]S"2P9D;]q%+,}.5P8>B]8%(h.V07 =& @]! '+a15;>?E]O!(+! 248>A^=]g!2"&)E-19 ;>;]a '<**. s8] q8 #t0a]!]u+j]v(]h %'**w-/5%:=?|B&s] $&m+.2%391>$] !,%*+.%0q46 >C #$]E  !% .|1539=?AR!}] ` % -)1 37; ?b]p %v(+.V47t9<?K.]u] v]{P"%)(. 68?b] #c%&, 36 >p@] #;(t+8/H3 49 A]( ] H '#%(.U259S ?Bu]Z # ). 368 ?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,andmaybeeitherinregistersorsaveblockswhentheprocesspf]\$qfCNub0] v^]#% , 4R7<?A]9]f(/"O&4 ,.058/;# A~[]xL \&,/ 49 AY] wV]vSL]w$&(6,02S3558;R=?BQ]E  &-368>SAO]   ^"(+ M]Ax &) 238>- K]~ &(A.0168><>J3] {"')*04@67=CoH]$n"#')d,/558>?AF]6 #&-U2 <?E=]l!% , .5:9 B] %5(k) 0 9"<?LA]+ !%# (*5.38 9,?5?s]|=#&%*/1.5c8-:>GC-=]!M&+.1v3Q58<2A<%] $K%(U-0l 6l;=m?:}]*%)+05:7:Y>>A8] ;!$(.s4:!>7/]c#(+c 1~6 =A5]FH %(+/ 3 ]_w!%'-/G 6$< >A1e]e$"$'; .17;5?/]H !3$) 06:A.]!&+.2347M<4AS,o]Nv#@$)]"&*.35;>1@(L]  ' -17:J<; B&] $)]>. $u'))# /2 57];<AR"]Hs%(y-16N] "(,V-26J9<@jB9]D4"p$'+}-,.U 5%w]vF]L*r"]# +-1135:7>Y ],q &+ /3M5%7:n?]"$s'G+00,3 8%;%@!C-P]l #')M,1 25U8;>;C-] !0" )+G/16;zA ]TB!#&<+-126;$?TA Z]x!k$]&;*+1259=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.BasementTerminalpf]\$qfCNvb2]!#%).:1&5'8 9>?`] &" -I0n6v8/ ?B9^] "Y%(,d./G\h]F$ &y,.\248):x=AZ]C "$)-^24N8w= Y]P!F&n-{0"3o7:?/BWr] uT#]NvP]#&*/"49':=HAjO,],  %v).36y8>M]!.%D*/m24;5= K] #4&D),.I1 Ib]<[:z"$*>+04-56;'@BG] E!="Z&+!,1|6N9E= D% P &(-I1379?B~ "J& @ 3!>!f%*+-3_5 8:|< t&'*g/1]3r <?_B;  !=%7' -l1#3582;{=>9d7v p!i#'j,`./;?3A5 $&")=+z-348i9<>E3)F-/11tu!%'@).0N270_!c#%p*p.13q5b;u,]v)f]HE%t*0P5:P;>HA~']t h"J&(+,045 <>&] #Tm!%$*..48> @KB$p]a!] %y*+.%46;x@ M] k!9 ),/15D82;L]3.!u#)/15&7<A*]SL $'6+.<27=A]\u3]v]!"&*,. 6n =@><])!%< ,.o2 3^5 7g:@]]$:%*O/3H 8;=PA]> q ')i-46<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.pf]\$qfCNvb*]3q a!" +B,/W48;7?`]S$']+F 236:><?A^] U#) .469y>]4]!M#&+_.)1U 9 A[]m%4*,2/,16J8}< Y]  !')-b uV]vSH]9 "%(+p-@.1M4 wO]vL]]/T#&*!,P/6R;AK] 9"%+05;" A~I\]V $$%]&)Z-/1I75=W?G]n "y%&(+O0wDf]vA]g2 &*'+.484: ?p]4 %'./w3B4:>=]LW %5'+?-j0368=AOB0]"(]-04 :@%B9.] l,l]:E$9&+r.W1>69&>A1*]%"{$(!+-/2c5+:;?rB)]#'"-/5P6 =6?B'v]F!e '+-46j<@%]!D#4$'M /3=9;>:w"]v1]& !V'E)^ 0 57m:?a]3 7!$' 06; ]>"$)+.\3[58m:>R?B;]T(TVm$ TIMESROMAN TIMESROMAN TIMESROMAN HELVETICA HELVETICALOGO HELVETICA HELVETICA  j!j/$"{:i[]<>Dragon>DragonBasement.tioga&Friday, September 21, 1984 1:19 pm PDT