Home   Info   DevZone   Wiki  
UsersWeb  |  MainWeb  |  InfoWeb  |  DevZoneWeb  |  SupportWeb
JosKernel ] [ not logged in ] [ Web: Imported ] goto:  options
[ get info on or edit ] login or new user ] [ list of topics, hubs & nodes, or recent changes ]

ArchitectureDiagram


Article contributed by GilbertHerschberger (3 April 2000).

Introduction

The general architecture of a Java-based operating system requires machine code. What should be implemented in machine code? How much of an operating system should be written in C/C++? This article provides a introduction to these issues.

Diagram 1

This diagram illustrates the standard libraries for a traditional operating system. Native interface and bytecode are optional.

Machine Code
Standard machine code library

Diagram 2

This diagram illustrates the necessary standard libraries for any Java-based operating system. Unlike a traditional operating system, this operating system always includes a native interface and bytecode layer.

Machine Code
Standard machine code library
Native Interface
Standard native interface library
Bytecode
Standard bytecode library

Standard libraries

The machine code and bytecode layers of the general architecture require their own standard libraries. A "standard" library contains functions available to all programs. The library is standardized for a number of very good reasons.

A Java-based operating system has two kinds of standard libraries: machine code and bytecode. C programmers have come to expect a standard machine code library. Java programmers have come to expect a standard machine code and bytecode library.

Standard machine code library

The standard machine code library contains all of the "standard" functions available to all machine code programs. It is also known as the "standard C library" and "standard class library". In addition, there is a "standard template library" for C++ templates.

When optimized, a standard machine code library for JOS is incompatible. It cannot be used on Linux, Windows or any other operating system.

The standard machine code library can be written carefully in C/C++. A function can depend on other functions within the standard machine code library. Functions cannot depend on the standard C library or standard C++ class library.

Standard native interface library

The standard native interface library contains all of the functions, structures and classes to translate between bytecode and machine code. Like the JavaNativeInterface, additional functions are requires to copy an object in bytecode to a corresponding object in machine code. This library provides methods for interpreting the primative types.

Any kernel module can define a class in bytecode, invoke a static method, create an object in bytecode and invoke a virtual method. Likewise, any bytecode object can invoke "native" methods that are bound to machine code. The native interface is implemented for each hardware platform in a standard native interface library.

This library can be written in C/C++. These functions can depend on other functions within the standard native interface library or standard machine code library.

Standard bytecode library

The standard bytecode library contains all of the classes available to all bytecode programs. It is also called the "standard class libraries", or the java packages.

Unlike a machine code library, a bytecode library can be compatible. Even when optimized, a standard bytecode library for JOS might be used on another bytecode processor.

Functions

Here is a diagram of the kernel interface, from the bottom up:

kernel

The kernel is written in machine code. It is loaded before any other kernel module.

kernel interface

Some of the kernel is exposed through a kernel interface. A kernel exposes useful functions through an interface. It provide an interface between the kernel and standard machine code libraries.

machine code library

The standard machine code library provide high-level functions for all kernel modules. A standard C library could be written here.

kernel module

A kernel module provides high-level functions for all bytecode. A virtual machine could be written at this layer.

Multiple kernels

There are multiple kernels because there are multiple hardware platforms. A kernel must be ported to different hardware platforms. This means that there must be more than one version of the kernel. With a standard kernel interface, kernels from different hardware platforms can provide similar functionality to a platform-independent virtual machine.




Content of these pages are owned and copyrighted by the poster.
Hosted by: