Fine–Grained Integration of Oberon Into Windows Using Pluggable Objects Emil Johann Zeller °C Emil Johann Zeller, 2002 Diss
Total Page:16
File Type:pdf, Size:1020Kb
Fine{grained Integration of Oberon into Windows using Pluggable Objects Emil Johann Zeller °c Emil Johann Zeller, 2002 Diss. ETH No 14877 Fine{grained Integration of Oberon into Windows using Pluggable Objects A dissertation submitted to the Swiss Federal Institute of Technology ZuricÄ h for the degree of Doctor of Technical Sciences presented by Emil Johann Zeller Dipl. Informatik{Ing. ETH born January 14, 1969 citizen of Appenzell, AI accepted on the recommendation of Prof. Dr. JurgÄ Gutknecht, examiner Prof. Dr. Thomas Stricker, co{examiner Prof. Dr. Clemens Szyperski, co{examiner 2002 iv Acknowledgements First and foremost, I would like to thank Prof. JurgÄ Gutknecht, for the opportunity to work in his research group, and for his patient and liberal supervision. I am also very grateful to Prof. Thomas Stricker and Prof. Clemens Szyperski. Both readily agreed to co{supervise this thesis and provided valuable suggestions which helped to enhance the structure of this book. Special thanks go to Andr¶e Fischer, JÄorg Rentsch, and Wolfgang Bock for proofreading the ¯rst draft of the manuscript and helping me improve my writing. I want as well to thank all my colleagues at the Institut of Com- puter Systems for contributing to the lively and inspiring working at- mosphere. Last but not least, my deepest gratitude goes to my friends and family. I simply can not imagine having done my studies and research without their encouragement and support. vi Contents Abstract xi Kurzfassung xii 1 Introduction 1 1.1 Motivation . 1 1.2 Overview . 1 1.3 Component Software . 2 1.3.1 Java Beans . 4 1.3.2 COM . 6 1.3.3 .NET Framework . 8 1.4 The ETH Oberon System . 13 1.5 Related Work . 21 1.5.1 Juice / Gazelle . 21 1.5.2 BlackBox Component Builder . 23 1.5.3 Java Beans Tools for ActiveX . 25 1.5.4 VMWare, Virtual PC . 26 2 Emulating a System on Top of Another 29 2.1 Bootstrapping the System . 30 2.2 Automatic Memory Management . 30 2.3 IO and CPU Utilization . 31 2.4 Filesystem . 32 2.5 Display System . 33 vii viii 3 A new Oberon Display System 35 3.1 Introduction . 35 3.2 A new Display Scheme . 36 3.3 A new Desktop Model . 41 3.4 Documents and Applications . 44 3.5 Using standard Menus and Dialogs . 45 4 A Plug{in Kernel for Oberon 51 4.1 Introduction . 51 4.2 Bootlinker and Bootloader . 52 4.3 Compiler Extensions . 56 4.4 Exception Handling . 59 4.5 Multithreading Support . 62 5 Pluggable Objects as Web Applets 67 5.1 Introduction . 67 5.2 Pluggable Oberon Object . 69 5.2.1 Packages . 70 5.2.2 PlugIns . 74 5.3 Security Issues . 76 5.4 The Oberon Web Browser . 78 6 Oberon Netscape Browser Plug{in 81 6.1 Introduction . 81 6.2 Implementation of the Plug{in DLL . 82 6.2.1 NPInitialize . 83 6.2.2 NPGetEntryPoints . 84 6.2.3 NPShutdown . 85 6.2.4 Plug{In Window . 85 6.2.5 Plug{In Streams . 89 6.2.6 Linking the Plug{In DLL . 90 6.3 Installing the Plug{in DLL . 92 6.4 Interfacing to Java using LiveConnect . 93 6.4.1 Java Runtime Interface . 94 6.4.2 LiveConnect Implementation . 95 6.4.3 JavaScript Example . 99 ix 7 Oberon ActiveX Components 103 7.1 Introduction . 103 7.2 An ActiveX and DCOM Server . 108 7.3 OLEObjects . 113 7.3.1 IUnknown . 113 7.3.2 IDispatch . 115 7.3.3 IPersist . 118 7.3.4 IDataObject . 119 7.3.5 Events . 121 7.4 OLEFrames . 124 7.4.1 IOleObject . 124 7.4.2 IOleInPlaceObject . 127 7.4.3 IOleInPlaceActiveObject . 128 7.4.4 IViewObject . 128 7.4.5 IOleControl . 129 7.4.6 IQuickActivate . 130 7.5 OLEDataServices . 130 7.5.1 Clipboard . 131 7.5.2 Client Site . 131 7.5.3 Drag and Drop . 133 7.5.4 Document Files . 134 7.6 OLEPlugIns / Internet Explorer . 135 7.7 OLEObjectScripts . 136 8 Case Studies 139 8.1 Web Applets . 139 8.1.1 Simple Applets . 139 8.1.2 Applets using Network Streams . 143 8.1.3 Applets and Scripting . 146 8.2 ActiveX Controls . 148 8.2.1 Voyager and Microsoft O±ce . 151 8.2.2 Visual Basic . 151 9 Conclusions 155 9.1 Evaluation . 155 9.2 Future Perspectives . 156 A Module Statistics 157 x B Performance Evaluation 165 Bibliography 177 Trademark notice The following are trademarks or registered trademarks of their respec- tive companies: Oberon, Gadgets, Native Oberon, MacOberon, Oberon for Linux, Obe- ron for Windows, Oberon System 3, ETH Oberon, and ETH PlugIn Oberon are trademarks of the Swiss Federal Institute of Technology ZuricÄ h. Microsoft, NT, Win32, Windows, Windows 95, Windows 98, Windows NT, Windows 2000, Microsoft O±ce, Word, Excel, PowerPoint, Inter- net Explorer, Visual Basic, Visual C++, COM, DCOM, ActiveX, and OLE are trademarks of Microsoft. Intel is a trademark of Intel. Navigator, Communicator, and LiveConnect are trademarks of Net- scape. Java, and Java Beans are trademarks of Sun Microsystems. BlackBox, Component Pascal, and Direct{to{COM are trademarks of Oberon microsystems. Mac OS is a trademark of Apple Computer. CORBA is a trademark of the Object Management Group. Linux is a trademark of Linus Torvalds. UNIX is a trademark of X/Open Company Limited. xi Abstract The ETH Oberon System has been implemented in two fundamen- tally di®erent ways: as native operating system and as an application running on top of another operating system. The embedded versions of Oberon are typically implemented as full screen applications, which are poorly integrated in their host environment. On the on hand, this approach has the advantage of maintaining the look{and{feel of a na- tive Oberon implementation. On the other hand, developers of Oberon software would sometimes want to reuse it or make it available on a ¯ne{grained level as part of commercial applications. In this thesis, a generic solution to this problem using a software component approach is presented. Visual and non{visual Oberon com- ponents | ranging from simple gadgets such as buttons, to complex containers such as desktops | are subject to be plugged into foreign contexts of di®erent kinds, e.g. web pages, spreadsheets, etc. Such pluggable objects are able to cooperate and communicate with their context and with other components using technologies like in{place activation, scripting, automation, clipboard, drag{and{drop, persis- tency, etc. Although the implementation described in this thesis is speci¯c to the Windows platform, most of the fundamental ideas can easily be adopted for other platforms. xii Kurzfassung Das ETH Oberon System wurde bisher auf zwei grundsÄatzlich ver- schiedene Arten implementiert. Einerseits als eigenstÄandiges Betriebs- system und andererseits als Anwendung, die auf einem anderen Be- triebssystem ablÄauft. Die eingebetteten Versionen von Oberon werden typischerweise als Vollbild{Anwendung realisiert, welche nur schlecht in die jeweilige Gastumgebung integriert sind. Dieser Ansatz hat den Vorteil, dass eine sehr genaue Emulation eines eigenstÄandigen Oberon Systemes angeboten werden kann. Entwickler von Oberon Software mÄochten aber oft ihre Programme als integrierten Teil einer kom- merziellen (nicht Oberon) Anwendung benutzen kÄonnen. In dieser Dissertation wird ein allgemeiner Ansatz zur LÄosung dieses Problems vorgestellt. Damit kÄonnen sichtbare und unsichtbare Oberon Komponenten, von elementaren Objekten bis hin zu komplizierten Objekt{Hierarchien, in fremden Umgebungen verschiedenster Art (z.B. Web Seiten oder Tabellen) eingesetzt werden. Diese Komponenten kÄonnen mit ihrer Umgebung und anderen Komponenten mit einer Vielzahl von Standard Techniken kooperieren. Obwohl die in dieser Dissertation beschriebene Implementation auf dem Windows Betriebssystem basieren, kÄonnen die meisten der be- schriebenen Ideen auch auf andere Betriebsysteme angewandt werden. Chapter 1 Introduction 1.1 Motivation The Oberon system has been implemented on di®erent computer plat- forms, where it either runs natively or on top of another operating system. All existing ports of the Oberon system running on top of another system are implemented to provide a complete emulation of a native Oberon system. Unfortunately none of these ports provide additional functionality taking advantage of the underlying system. In this thesis di®erent extension to the Oberon system are dis- cussed. All these extensions are made possible by introducing rela- tively small extensions in the system core. 1.2 Overview This thesis is organized as follows: ² This ¯rst chapter gives a survey of topics closely related to this thesis. This are: { popular component software system standards { the ETH Oberon System and the Oberon programming lan- guage 1 2 { other projects which try to embed Oberon in a foreign con- text ² Chapter 2 discusses typicall problems encountered when embed- ding run{time systems into each other. ² Chapter 3 discusses the implementation of a new display system for Oberon. This makes it possible to integrate existing frames into a wide range of di®erent non{Oberon window contexts. ² Chapter 4 discusses the techniques needed to run a minimal Oberon system on Windows. This includes the following top- ics: { bootlinker and bootloader { interfacing with the Win32 API { compiler support for di®erent calling conventions { exception handling { multithreading ² Chapter 5 describes extensions to Oberon needed to use Oberon objects as web applets. ² Chapter 6 describes the implementation of a browser plug{in for using Oberon applets with the Netscape browser. ² Chapter 7 describes an Oberon framework for developing COM components. This framework is then used to implement ActiveX wrappers for visual and non{visual Oberon objects. ² Chapter 8 presents case studies where Oberon objects are used as plug{ins into web browsers and other container applications. ² Chapter 9 presents conclusions and reflections.