Virtual Window Systems
Total Page:16
File Type:pdf, Size:1020Kb
Virtual WindowSystems: A New Approachto SuppoitingConcurrent HeterogeneousWindowing Systems RitaPascale, Jeremy Epstein - TRW SystemsDivision ABSTRACT A "virtual window systeml' (VIWS)is a simple model of a window systemwhich can be used to host other more sophisticatedwindow systems. The VWS allows the window systemsto sharethe.phys_ical 9ppl.y in a controlledfashion. A VWS is analogousto the virtual machinemonitor (vMM) [MadnickT4]concept in operatingsystems, where a single ghysical compr¡ter-canrun multiple operatingsystems, each in itõ o-*n protectiondomain. Unlike the VMM concept, the window iysiems supportedby the VWS need close cooperationto perform'tasks,such as cut and pastebetween wináows of differentwindow systems. -- . This paperdescribes the VWS concept,discusses an architecturefor a VWS, describes limitations of the \l[VS concept, discusies some lessonslearned from the design and implementationof our prototype,and describesthe use of WVSs for various application domains. Introduction MacOS and X; X-under-NeXTstepfrom pencom which Userswant to run more than one window svs_ combinesNeXT and X; and Domain from combinesApollols native tem (WS) simultaneouslyon a single platiãi.. ínr f¡to,llo_which WS and X. somesystems which combine usersare a very diverseset whose-neeãsrange from 1Ti:-*. threewin- debuggingto together(i.e., X11/l.IeWSand téachingto running a variety oiuppn *Y,tlq "."lironments catiolL ihe systeni developerneeds an r¡f;ãii* but three seemsto be.the maximum. By beingfu.nvi3¡v), debuggingtool ior window syrte*s an¿ tfreir áppfi- limited to two or three environments,-many of of the vWS are possible. cationl. lhe instructor needéa flexible .yrì"iñ'ìà llt^ :jli,.ges .not The thesesystems fulfill js the teachin as many environmenrsas possiUié-;-;;; 1l_tjln"rigl ability to run machine.The everyday userneeds'to *" .ppfU: mixed applicationsand this hasbeen argued as not tions built for more than one window system,ä'tr.h- being a great advantage. niquewhich we call applications". "mixed Goals We proposea generalsolution to allow many as many of the variousneeds of the windowing eìvironnientsto run cooperativetyf-iä ,,-.^_^t^o.meet refer to iias the "virtual window system,'iVWSj group' we need a small, but flexible :1-1t::-.usersystem conceprt. A wVS is a simple model of . ìinàoí base. To avoid the temptationof buildÍngÏÎ1?: an entire systemwhich canbe usedto hostott *orr-.ootrjr- new windowsystem' the sizeis to "t and minimal,using as few primitives titated window systems.Tltr ñ;t;ñtt..r.d'W'ú :: fj:,:tttl Deslte this minimality, we wish to are considered"'guests" on the vws prærotit'åiã 1l_l,o_ttlblt'. may be referredîo as gue.t WS. The Vws'.ir"*. flexible.The set of primitivesmust provide i:T1iT functionality disparateWSs to shareúe physicaldisplay i" ;;;;: to accommodateany window system':::.T* trolled fashion and provideì ã mecnanismfor com- municationacross Vy'Ss. The primitivesbetween the guestWSs and the c.al be into connection When comparedto similar systems,the VWS is YYI-.^tyt"m .grouped much more veisatile. Hybrid ws ånuironrJni, startupinformation, input data, and output ilglt:lll '$ority combinetwo parricularsystäms and provide,ltr'.uii: of the primitives deal with chang- Í-1t:Jn: such as requests ity ro run apitications fiom the t*ó ;Ñifiä wö, lo map and unmãp 11åjÏ.^ditptav,update onty. nxampiesof thesehybrid systemi utr ñiriãn windows, and changethe window T1i1-?:t'stacking order. trom Visior¡Vare which óombinósf"ficro.ofi'.äi-n_ ',' Overall, there are fewer than 20 primitiveswhich.is dowsand X; MacX from Macintoshwhich co, '-' -significantlyless than the 120 @bytheDefense^--".irotocolrequestsi"tr'"î''*'i[Scheifler90]. ResearchProjects Agency under Contract No. MDA 972- 89-C0029. '92 - Summer USENIX June8-Junþ LZ, Lggz - SanAntonio. TX LL7 Virtual l{indow Systems Pascale,Epstein Detalls of the Problem all supportedWSs, and this is the most common form of datatransfer. There are a number of problemsinvolved in hostingmany environmentsand protocols on a single Method platform.The main areasto addressare randomdev- ice accessesand overcomingdifferent protocols. Our solution provides a mechanismto control device accessand regulate inter-environment(and Access to the keyboard,mouse, console and intra-environment)communication. The VWS per- framebuffermust be regulated. Allowing each WS forms theseactions through three logical servers:an all input at all times would result in massconfusion input manager,an ouÞut manager,and a control since eachWS interpretsdata differently. A mouse server.The input managerroutes the input click in one environmentmay pop up a menu,while to a sin- gle designatedwindow system.The output manager in anotherit may causean applicationto exit, and in displayseach window system'soutput the yet another,the data format may not evenbe valid. on screen while handling window overlapping Unlimited access to the screen will allow guest and clipping. The control serveris inactive,except for administra- WSs2 to cause chaos by drawing on top of one tive duties.Figure 1 showsthe interactions another's windows, creating a confusing mesh between of the VWS guest partial windows. and the WSs. Each guestWS must be modified to virtualize Another difficulty is cut and pasteacross WSs. its device access. Input is receivedfrom the input Each systemsupports a differentmechanism through managerinstead of readingthe devices different protocols. A primitive method must be directly and drawing is performedin a virtual developedthat can cut across these various plat- framebufferand then sent to the output managerfor display. forms. One drawbackof being genericis that unique These modificationsare necessarysince there data formats are not supported. For example,h X is no direct accessto the hardwaredevices. The guest must resource ids (instead of the actual WS [Scheifler90], also requestservices of the threeVWS serversusing data) can be cut and pasted;this id is only useful minimal primitives. A possibledrawback to the vi¡- within that particular instantiationof the X server tualizedouÞut is that there is no advantageof using and is not meaningfulto any other WS process.At intelligentgraphics boa¡ds unless they the very least,ASCII text can be transferredbetween can utilize the virtual framebuffers. In the WVS environment,there is always one 2By guestwindow system,we mean a window system active WS which receivesall input from the input environmentthat is supportedand hostedby the vi¡tual manager. Any other running system is passive, window system. meaningit can sendupdates to the screen,but does oaaaa Figure 1: VWS Interactions 118 Summer '92 USENIX - June 8-June 12,lgg2- San Antonio, TX Pascale,Epstein VÍrtual Window Systems not receiveany input. Interpretationof the input is pasted.At a minimum,guest WSs must supporta the responsibility of the active window system, canonicaltext format for interoperability.Additional meaningit is up to the guest\VS to sendthe input formats-maybe supported,but their interoperability eventsto the appropriateclients and processthem as is less.likely. This may be a disadvantagèto sys- dictated by its own internal protocol. The input tems that have unique data forms, such as resource manager'sonly interactionwith the input is scanning ids in X. for the attentionsequence which activátesthe control The primitives sent from the guest \VS to the server. The control server is activatedstrictlv on control server are connectionrequests, cut data certainkeyboard input, not clicking on an icon.'This and paste requests.The control server respondsto the is becausemouse position (at thelime of the click) pasterequests with the most recentcut is up to interpretationper guestWS. data that meetsthe criteria specifiedby the guestWS. The only primitives f¡om the guest WS to the With minimal changes,existing WSs can input managerare connectionrequeits and requests be modifiedto work within the VIVS environment.How to ring the bellr. lnput managerprimitives to the closelythe window system'simplementation is tied guest\ryS provide keyboard and mouseinput, initial- to the hardwaredictates the amountof chanee. ization data, and notification of X is selection and very modular and encapsulates deselectionby the user. its device-usage; therefore, it was quite simple to change. We The output server controls the mapping and modifiedthe MIT X11R4 serverfor Sun ha¡ãwarerc rffSs unmappingof windows from the various as acceptinput from the input serverand displayoutput well as handlingstacking order, screenupdates and throughthe outputmanager with a few hundiedlines cursor_imaging. Becauseno sophisticatedgraphics of code. Modifying the Macintosh WS would be operationsare provided,the outputmanager is much much more complicatedbecause of its closerelation- simpler than the output componentof ãn ordinary ship with its hardware,but we believethat even this windowsystem. Performance is the costof this sim- can be overcome. plicity, but having such base primitives makes the ouÞut .managermore adoptive of other WSs. A Details on Vl{S Uses disadvantageof this schemeis that the screenback- The VWS exhibitsgreat versatility in its ability ground is not for use by any guestwindow system. to handle a wide variety of needs in a minimãl A mechanismis provided to draw helping lines for 'and amountof code. WVS neither enhancesnor detracts placing, moving resizing windows, but other from the given graphicaluser interface;if the guest applicationsthat draw directly on the screen back- WS is poor, it will remain