Multi-Persona Mobile Computing
Total Page:16
File Type:pdf, Size:1020Kb
Multi-Persona Mobile Computing Jeremy Andrus Submitted in partial fulfillment of the requirements for the degree of Doctor of Philosophy in the Graduate School of Arts and Sciences COLUMBIA UNIVERSITY 2015 c 2015 Jeremy Andrus All Rights Reserved ABSTRACT Multi-Persona Mobile Computing Jeremy Andrus Smartphones and tablets are increasingly ubiquitous, and many users rely on multiple mobile devices to accommodate work, personal, and geographic mobility needs. Pervasive access to always-on mobile com- puting has created new security and privacy concerns for mobile devices that often force users to carry multiple devices to meet those needs. The volume and popularity of mobile devices has commingled hard- ware and software design, and created tightly vertically integrated platforms that lock users into a single, vendor-controlled ecosystem. My thesis is that lightweight mechanisms can be added to commodity operat- ing systems to enable multiple virtual phones or tablets to run at the same time on a physical smartphone or tablet device, and to enable apps from multiple mobile platforms, such as iOS and Android, to run together on the same physical device, all while maintaining the low-latency and responsiveness expected of modern mobile devices. This dissertation presents two lightweight operating systems mechanisms, virtualization and binary compatibility, that enable multi-persona mobile computing. First, we present Cells, a mobile virtualization architecture enabling multiple virtual phones, or personas, to run simultaneously on the same physical cellphone in a secure and isolated manner. Cells introduces device namespaces that allow apps to run in a virtualized environment while still leveraging native devices such as GPUs to provide accelerated graphics. Second, we present Cycada, an operating system compatibility architecture that runs applica- tions built for different mobile ecosystems, iOS and Android, together on a single Android device. Cycada introduces kernel-level code adaptation and diplomats to simplify binary compatibility support by reusing existing operating system code and unmodified frameworks and libraries. Both Cells and Cycada have been implemented in Android, and can run multiple Android virtual phones, and a mix of iOS and Android apps on the same device with good performance. Because mobile computing has become increasingly important, we also present a new way to teach operating systems in a mobile-centric way that incorporates the concepts of geographic mobility, sensor data acquisition, and resource-constrained design considerations. Table of Contents List of Figures v List of Tables vi 1 Introduction 1 2 Cells 4 2.1 Usage Model . .6 2.2 System Architecture . .8 2.2.1 Kernel-Level Device Virtualization . 10 2.2.2 User-Level Device Virtualization . 12 2.2.3 Scalability and Security . 13 2.3 Graphics . 14 2.3.1 Framebuffer . 14 2.3.2 GPU . 17 2.4 Power Management . 19 2.4.1 Frame Buffer Early Suspend . 20 2.4.2 Wake Locks . 21 2.5 Telephony . 22 2.5.1 RIL Proxy . 22 2.5.2 Multiple Phone Numbers . 27 2.6 Networking . 28 2.7 Experimental Results . 30 i 2.7.1 Methodology . 31 2.7.2 Measurements . 33 2.8 Related Work . 38 2.9 Conclusions . 39 3 Cycada 41 3.1 Overview of Android and iOS . 44 3.2 System Integration . 46 3.3 Architecture . 47 3.3.1 Kernel ABI . 48 3.3.2 Duct Tape . 50 3.3.3 Diplomatic Functions . 51 3.4 iOS Subsystems on Android . 54 3.4.1 Devices . 54 3.4.2 Input . 55 3.4.3 Graphics . 56 3.4.4 Networking . 58 3.5 Experimental Results . 59 3.5.1 Obtaining iOS Apps . 61 3.5.2 Microbenchmark Measurements . 62 3.5.3 Application Measurements . 66 3.6 Limitations . 67 3.7 Related Work . 68 3.8 Conclusions . 71 4 Cycada Graphics 72 4.1 Introduction . 72 4.2 iOS and Android Graphics Overview . 76 4.3 Cycada Graphics Architecture . 78 4.4 GLES . 81 4.4.1 Diplomat Usage Patterns . 82 ii 4.5 EAGL.............................................. 85 4.5.1 Render-Target Object Attachment . 85 4.5.2 Double Buffering . 87 4.6 Memory Management . 88 4.6.1 IOSurface Life Cycle Management . 88 4.6.2 Cross-API Object Sharing . 89 4.7 Multi-Threaded GLES . 90 4.7.1 Thread Impersonation . 90 4.8 EAGL Multi-Context Support . 93 4.8.1 Dynamic Library Replication . 93 4.8.2 Unintended Consequences . 95 4.9 Evaluation . 96 4.9.1 iOS WebKit Functionality . 97 4.9.2 Performance . 97 4.9.3 iOS Application List . 102 4.9.4 Prototype: Current State . 106 4.10 Related Work . 107 4.11 Conclusions . 109 5 Cycada: Experiences and Lessons Learned 110 5.1 Virtue and Vice . 114 5.1.1 Laziness . 114 5.1.2 Diligence . 115 5.1.3 Impatience . 119 5.1.4 Patience . 121 5.1.5 Hubris . 123 5.1.6 Repudiation . 125 5.2 The Future: Forward-Porting Cycada ............................. 128 6 Teaching OS Using Android 131 6.1 Introduction . 131 iii 6.2 Android Virtual Lab . 133 6.3 Kernel Projects . 134 6.3.1 System Calls and Processes . 135 6.3.2 Synchronization . 136 6.3.3 Scheduling . 137 6.3.4 Virtual Memory . 139 6.3.5 File Systems . 140 6.4 Experiences . 141 6.5 Related Work . ..