ebook img

Towards an embedded real-time Anders Ive Java virtual machine PDF

157 Pages·2016·2.43 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Towards an embedded real-time Anders Ive Java virtual machine

Towards an embedded real-time Java virtual machine Ive, Anders 2003 Link to publication Citation for published version (APA): Ive, A. (2003). Towards an embedded real-time Java virtual machine. [Licentiate Thesis, Department of Computer Science]. Department of Computer Science, Lund University. Total number of authors: 1 General rights Unless other specific re-use rights are stated the following general rights apply: Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of accessing publications that users recognise and abide by the legal requirements associated with these rights. • Users may download and print one copy of any publication from the public portal for the purpose of private study or research. • You may not further distribute the material or use it for any profit-making activity or commercial gain • You may freely distribute the URL identifying the publication in the public portal Read more about Creative commons licenses: https://creativecommons.org/licenses/ Take down policy If you believe that this document breaches copyright please contact us providing details, and we will remove access to the work immediately and investigate your claim. LUND UNIVERSITY PO Box 117 221 00 Lund +46 46-222 00 00 Towards an embedded real-time Java virtual machine Anders Ive Licentiate thesis, 2003 Department of Computer Science Lund Institute of Technology Lund University ISSN 1404-1219 Dissertation 20, 2003 LU-CS_LIC:2003-4 Thesis submitted for partial fulfillment of the degree of licentiate. Department of Computer Science Lund Institute of Technology Lund University Box 118 SE-221 00 Lund Sweden E-mail: [email protected] WWW: http://www.cs.lth.se/~ive © 2003 Anders Ive Abstract Most computers today are embedded, i.e. they are built into some prod- ucts or system that is not perceived as a computer. It is highly desirable to use modern safe object-oriented software techniques for a rapid develop- ment of reliable systems. However, languages and run-time platforms for embedded systems have not kept up with the front line of language development. Reasons include complex and, in some cases, contradictory requirements on timing, concurrency, predictability, safety, and flexibility. A carefully tailored Java virtual machine (called IVM) is proposed as an approach to overcome these difficulties. In particular, real-time gar- bage collection has been considered an essential part. The set of bytecodes has been revised to require less memory and to facilitate predictable exe- cution. To further reduce the memory footprint, the class loader can be located outside the embedded processor. Since the accomplished concur- rency is crucial for the function of many embedded applications, the scheduling can be defined on the application level in Java. Finally consid- ering future needs for flexibility and on-line configuration of embedded system, the IVM has a unique structure with which, for instance, methods being objects that can be replaced and GCed. The approach has been experimentally verified by a full prototype implementation of such a virtual machine. By making the prototype avail- able for development of real products, this in turn has confronted the solu- tions with real industrial demands. It was found that the IVM can be easily integrated in typical systems today and the mentioned require- ments are fulfilled. Based on experiences from more than 10 projects uti- lising the novel Java-oriented techniques, there are reasons to believe that the proposed approach is very promising for future flexible embedded systems. 4 Acknowledgements This thesis would not be without the support and help from my supervi- sors, Boris Magnusson and Roger Henriksson that tirelessly followed my progress. Their valuable ideas have made drastic improvements to the disposition of the thesis. The support and comments of Klas Nilsson have been especially valuable for me as they returned my focus to the original problems and objectives of this work. This thesis is also the product of many projects in cooperation with other companies and researchers. I am especially grateful for the project with BlueCell that resulted in a product where the IVM was an integral part, but above all I am glad for the acquaintance with the managers of BlueCell, Mats Iderup and Björn Strandmark, whose practical knowledge excel in the hardware and software field. The cooperation with Ericsson and ABB has been invaluable during the development of the machine. At Ericsson I thank Magnus Larsson, Elizabeth Bjarnasson, Christer San- dahl, and Sten Minör, for their supportive and positive attitude towards reaching a “Java-in-the-ear” solution. The constructive collaboration with Magnus Larsson during a couple of hectic weeks at Ericsson resulted in major improvements to the IVM code. The master thesis of Thomas Fänge and Daniel Linåker at Ericsson inspired me to improve the IVM with some optimisation. The projects with Anders Roswall at ABB Corporate Research in Västerås and Michael Meyer at ABB Automation Technology Products in Malmö have resulted in valuable contributions to the machine. I thank Anders Lindwall, Andreas Rebert, Johan Gren, and Jens Öhlund for their cooperation in their excellent student project in which they utilised the IVM in a real-time application. Their results have been most valuable in this licentiate thesis. Their summer project at ABB in Västerås, where the IVM was integrated into an embedded platform produced many new ideas concerning the IVM. The master theses of Johan Gren and Jens Öhlund, and Tor Andrœ and Johan Gustavsson at ABB Automation Control in Malmö resulted in further developments of the IVM code. 6 The IVM has been integrated in many research projects. First I thank Patrik Persson for his support and his friendship. His ideas from “Skån- erost” are a valuable part of the WCET analysis of the bytecodes. I thank Anders Nilsson for his work on the Java2C converter that resulted in a unified object model of the IVM. Torbjörn Ekman also contributed with his master thesis concerning a hard real-time kernel on an AVR processor. The unsurpassed knowledge of embedded real-time behaviour of Anders Blomdell resulted, together with the rest of the group, in the garbage col- lector interface that has been successfully utilised in the IVM and in the Java2C converter. I also thank all the other members of our group Görel Hedin, Sven Gestegård Robertz, Ulf Asklund, and the new members Torb- jörn Eklund and David Svensson, for valuable discussion and project ideas. I thank Göran Fries, Lennart Andersson, and all the other col- leagues at the Department of Computer Science in Lund for pushing me forward. I also would thank Anders Robertsson and Johan Eker for their support during my early days as a “robot” researcher. I especially thank Christian Andersson as a minute proofreader and for our “after-work” discussions providing me with determination. In this context, I would also thank Fredrik Jönsson for his understanding and support. I thank Daniel Einarsson and Flavius Gruian for their friendship and their tireless determination to include the IVM in their projects. I thank Mads Bondo Dydensborg for his cooperation in the Koala project. His invaluable knowledge of the open-source community and his practical knowledge of all the cool tools have increased quality of the IVM source code considerably and increased my interest in the open source community. I thank Magnus Landquist for his master thesis work together with the IVM and the PalmOS. His work pinpointed crucial requirements of the IVM that had to be implemented, but above all, he made me laugh so much that my muscles in my stomach cramped. Finally, I thank Madeleine Emmerfors for her support and love, but also for her determination to proofread the thesis. She forced me to con- front the darkest sections of the thesis, which improved the text consider- ably. Above everything, she made me laugh at myself in moments of despair. Contents Chapter 1 Introduction 1 1.1 Embedded systems . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.2 Real-time programming . . . . . . . . . . . . . . . . . . . . . 5 1.3 High-level Programming Languages . . . . . . . . . . 12 Chapter 2 The Infinitesimal Virtual Machine 19 2.1 Java Virtual Machine Overview. . . . . . . . . . . . . . 20 2.2 Modules and interfaces. . . . . . . . . . . . . . . . . . . . . 20 2.3 Internal data structures . . . . . . . . . . . . . . . . . . . . 30 2.4 Split machine. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 2.5 Runtime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 2.6 Preloaded classfiles. . . . . . . . . . . . . . . . . . . . . . . . 51 Chapter 3 IVM runtime 53 3.1 Fundamental runtime data structures . . . . . . . . 53 3.2 IVM runtime system in detail. . . . . . . . . . . . . . . . 55 3.3 Real-time aspects. . . . . . . . . . . . . . . . . . . . . . . . . . 72 3.4 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Chapter 4 Classfile conversion 79 4.1 Classfile conversion overview. . . . . . . . . . . . . . . . 80 4.2 Class linking and memory utilisation . . . . . . . . . 86 4.3 Loading converted classfiles. . . . . . . . . . . . . . . . . 99 4.4 Split machine. . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 4.5 Bytecode conversion . . . . . . . . . . . . . . . . . . . . . . 104 4.6 Control flow analysis. . . . . . . . . . . . . . . . . . . . . . 110 Chapter 5 Results 111 5.1 Target platforms . . . . . . . . . . . . . . . . . . . . . . . . . 111 Chapter 6 Related work 115 6.1 Java Real-Time API Specification . . . . . . . . . . . 115 2 6.2 Java platform. . . . . . . . . . . . . . . . . . . . . . . . . . . .116 6.3 Java virtual machines for embedded systems. .118 6.4 Java to C compilation . . . . . . . . . . . . . . . . . . . . .123 Chapter 7 Future work and conclusions 125 7.1 Real-time adaptations. . . . . . . . . . . . . . . . . . . . .125 7.2 Real-time code replacement . . . . . . . . . . . . . . . .126 7.3 Interpretation and compilation co-operation. . .126 7.4 Optimisations. . . . . . . . . . . . . . . . . . . . . . . . . . . .127 7.5 Measurements . . . . . . . . . . . . . . . . . . . . . . . . . . .128 7.6 Meta virtual machine . . . . . . . . . . . . . . . . . . . . .128 7.7 The minimal language. . . . . . . . . . . . . . . . . . . . .131 7.8 Real-time issues. . . . . . . . . . . . . . . . . . . . . . . . . .132 7.9 Communication between nodes . . . . . . . . . . . . .135 7.10 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . .135 References 137 Appendices 143 Chapter 1 Introduction The purpose of this thesis is to provide a foundation for the integration of high-level object-oriented language features in real-time embedded sys- tems. This is achieved by an implementation of a specially designed vir- tual machine for Java. In the field of embedded systems, the state-of-the-art high-level pro- gramming languages have not made any major impact, because the imposed restrictions are difficult to cope with in a high-level context. Lim- ited computational power and limited memory resources restrict the incorporation of desirable high-level language features. High-level pro- gramming languages have been developed on and adapted to general sys- tems with relatively powerful processors and vast memory resources. Hard real-time requirements, such as predictability, impose further issues that are not even resolved by powerful computers. Throughout computer history, programming languages have become more expressive and more secure. They have developed from low-level instructions into more abstract constructs that relate to the algorithms. Program complexity decreases with high-level programming languages. The vision is to unambiguously describe the execution of computer pro- grams with few building blocks, sufficiently few for the human mind to grasp (see [Nør99]). Introduction of modern high-level programming lan- guages into the development of embedded systems is desirable and in great demand from the industry. Common programming issues, such as the problem of encapsulation, or issues regarding re-usability, scalability, and portability are elegantly handled in modern high-level programming languages. High-level lan- guages often provide program organisation and structure. The time to develop software has decreased and the code quality has increased with the utilisation of high-level programming languages. High-level languages also focus programmers to essential program- ming tasks. Purely administrative tasks, such as memory management, are handled by the language itself. Programming errors can thereby be avoided. In many high-level languages, a garbage collector (GC) automati-

Description:
A carefully tailored Java virtual machine (called IVM) is proposed as an approach to .. Chapter 4 deals with the runtime description of the IVM with a subsection
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.