Go to main content

School of Computer Science Intranet

The Jamaica Project - Operating Systems

The Jamiaca project has been considering alternatives to porting a conventional system such as Linux to the Jamaica processor. This is motivated in part by the need for the OS to efficiently utilise & expose to client applications the new features of the Jamaica hardware and to cope with the absence of conventional features such as virtual memory mapping hardware. However it is also due to dissatisfaction with some limitations that conventional systems impose on the development of advanced optimizing compilers.

The investigation is not limited to implementation of a system solely for the Jamaica hardware. It is envisaged that the system will be able to run on conventional hardware configurations, such as Intel-based PCs, and will provide benefits to optimizing compilers on these systems too.

Challenges for Current Operating Systems

Current operating system design suffers from a number of problems which limit opportunities for optimized compilation:

Performance
Implementations of features like message passing are often at odds with optimisations compilers would like to make, such as code inlining.
Security
Languages conventionally used in the implementation of operating systems tend not to have an inbuilt notion of security, which leads to security holes and frequent kernel patching.
Hardware support
Current UNIX like operating systems require virtual memory to support different process spaces. Copying data between processes is made more expensive by this, as well as increasing the amount of hardware required on a processor.
Separation of compiler and operating system
Using a static compiler to build an operating system kernel leads to the source of the kernel being interdispersed with statements to support performance enhancing features such as collaborative multithreading. It also disallows global optimizations being performed across the application-operating system boundary.

Co-design of operating system and compiler

The Jamaica project is aiming to solve some of these problems by co-designing a dynamic compiler and operating system. An early prototype OS was developed using the jtrans static compiler. This provided a minimal Java runtime, using the Jamaica hardware's CMP and CMT capabilities to implement both Java threads and light-weight threads supporting parallel execution. Subsequent work has concentrated on replacing the (Unix) OS-dependent kernel of the Jikes RVM Java virtual machine with a simpler kernel based directly on the Jamaica hardware. Further investigation is under way into implementing a complete bootstrap and runtime kernel in Java targetted for Jamaica and other hardware platforms.

Java Threads in Hardware
The Jikes RVM (version 2.3.2) has been ported to run on the Jamaica simulator. It has been modified to use the chip multi-processor (CMP) and chip multi-threading (CMT) capabilities of the Jamaica hardware to implement a concurrent Java thread layer. These hardware features completely replace the Unix pthread and signal libraries normally employed to implement the Jikes RVM with a much simpler implementation.
Fast, Cheap Distribution
The Jamaica RVM also exports a light-weight threading mechanism to the Jikes optimizing compiler, enabling fast distribution of small-grained tasks to idle cores. The chip multi-threading features of Jamaica require significantly less cycles to implement thread creation, scheduling, distribution and synchronization than their equivalents in a conventional Unix/SMP configurations.
Automatic Parallelization
A parallelizing phase is being added to the Jikes optimizing compiler to make use of the lightweight thread layer exposed by the Jamaica RVM. Since the operating system is (almost) entirely Java code, global optimization and dynamic, feedback-directed parallelization of both application and system code is feasible.
Direct Memory Access
On Unix the Jikes RVM employs the malloc and mmap APIs to allocate memory for the Java kernel image and the heap(s) used to store dynamically loaded code and dynamically created data. The Jamaica RVM avoids the use of virtual memory implementing a much simpler memory allocation layer direct over the hardware cache-mapped memory space. Java's clean memory model, with its use of object references and garbage collection, requires no special memory protection or memory management mechanisms. So this simplification is a safe and highly beneficial optimization of both software and hardware.
Java in Java Kernel
On Unix the Jikes RVM employs a C bootstrap and runtime kernel which uses the Unix multi-threading (pthread/signal) and device (file/netsocket) APIs to implement the Java threads and i/o. The Jamaica RVM completely replaces this kernel, implementing the entire bootstrap from a processor cold start and providing its own version of the runtime layer.

The current bootstrap and runtime is implemented as a mixture of Jamaica assembler, C and Java code. It uses the hardware CMP/CMT features to implement Java threads and, at present, side-steps device i/o through the simulator. Investigation is under way into implementation of a complete kernel in Java, including a full device layer along the lines of other Java OS projects such as jnode or JX. Careful design of this Java kernel should support porting of the bootstrap and runtime support code to architectures other than Jamaica.

Next generation virtual machine design

PearColator

The Jamaica project is tackling a range of problems in next generation virtual machine design:

Dynamically typed language VMs
Dynamic typing is a new area for virtual machines, with the parrot bytecode format becoming the bytecode of choice for many dynamically typed languages such as Perl, Python and Ruby. Parakeet is a dynamically typed VM building on the years of research in statically typed VMs. It includes garbage collection and optimizing compiler facilities from statically typed VMs.
Legacy code execution
The Jamaica project is working on state-of-the-art emulation to run legacy applications within a virtual machine environment. The process spaces or physical memory are emulated by dedicated objects. The translator of the virtual machine translates the legacy code into the virtual machine's intermediate format (a process known a dynamic binary translation). The intermediate code is compiled and run within the virtual machine frame work. The technique leverages the virtual machines compiler, performance and security features whilst minimizing overhead. A key advantage of the technique is it can take exisiting legacy applications and dynamically translate them into parallel versions.
Discover more about PearColator

Back to the Jamaica project front page