JavaOSª Ð Javaª on the Bare Metal

Peter Madany Outline

¥ Goals ¥ Hosted Java ¥ JavaOS Ð Technical overview Ð Advantages Ð Target systems Ð Status ¥ Demo ¥ Future Goals

¥ Enable new types of network devices Ð Intelligent Ð Dynamic Ð Simple to install, administer, and use ¥ Run Java in systems with limited resources Ð Java-enabled devices Ð Cannot assume high-end hardware and software ¥ Limited Hardware: Ð Limited Memory: RAM, ROM Ð Optional items display and disks ¥ No host Ð Minimize memory requirements How Features Are Delivered

¥ Today: the Java language is embedded in applications Ð e.g. browsers ¥ Soon: embedded within operating systems Ð e.g. in Solaris, Windows, Mac OS ¥ Both rely on a host OS ¥ Conclusion: today Java requires a host OS Java on a Conventional OS

HotJava Java API

Java Foundation AWT Net and IO Classes Classes Classes Java

Java Run-Time ‘’ Platform Independent + libawt libnet Platform Dependent

Operating System (Windows 95, MacOS 7.5, Solaris 2.5)

Hardware JavaSoft Software LEGEND: 3rd Party Software Major Features

¥ Ð Byte-code interpreter Ð Class loader Ð Garbage collector ¥ Language and Utility Classes ¥ AWT Classes ¥ Net Classes ¥ IO Classes Host OS Requirements

¥ Support for threads Ð Context switching ¥ Memory Allocation ¥ Window system ¥ Network Protocols ¥ File Systems ¥ Device drivers Ð Keyboard Ð Mouse Ð Display Matching Java to a Host OS

¥ Map AWT to window system ¥ Map Net classes to native networking ¥ Map file-related IO classes to file system ¥ Port platform-dependent part of VM Java Without a Host OS

¥ Provide just enough kernel features: Ð To implement the Java VM ¥ Just enough Javaª-based code for: Ð AWT, Net, and File IO ¥ Necessary device drivers Ð Display and network Ð Mouse and keyboard ¥ Still support the full Java Platform API JavaOSª Architecture

Java HotJava API

Java Foundation AWT Net and IO Classes classes classes

TCP NFS client Java windows UDP IP Java graphics Ethernet KBD Mouse

Java Virtual Machine

Booting, traps, interrupts, threads Hardware Java LEGEND: C and assembler JavaOSª Details: JavaKernel

¥ Bootstrap Ð Memory allocation Ð Device mapping ¥ Trap and interrupt handling ¥ Thread support Ð Simple context switching Ð Single address space JavaOS Details: Virtual Machine

¥ The virtual machine implements “Java” Ð Bytecode interpreter loop Ð Java exception handling Ð Memory management Ð Threads ¥ JavaOS mostly uses standard VM Ð Tuned the malloc and Javaª-compatible heaps Ð Class garbage collection JavaOSª Details: ROMability

¥ Javaª-based byte codes are modified when run Ð Cannot be placed as is in ROM ¥ The ROMizer tool Ð Converts set of class files into ROMable, bootable Javaª-based images Ð Performs some optimizations on the image JavaOS Details: Device Drivers

¥ All device drivers written in Java Ð Use two small “C” support classes Ð For “memory objects” and interrupt dispatch ¥ We have working device drivers for: Ð Ethernet Ð Keyboard, mouse, serial ports, and clock Ð Several frame buffers, including VGA Ð Audio ¥ Designing a Javaª-compatible Interface JavaOS Details: Networking

¥ Written in the Java language ¥ We currently have working versions of: Ð TCP, UDP, IP and ICMP Ð ARP for address resolution Ð DNS or NIS for hostname lookup and login Ð DHCP or RARP for address discovery Ð NFS client-side, including SunRPC/XDR Ð SNMP agent for network management Ð Socket support Ð Network time JavaOS Details: Windows & Graphics

¥ Uses the “Tiny AWT” widget library ¥ X-windows would be too heavy-weight ¥ Window system Ð Small window system Ð Written in the Java language Ð Optimized for limited memory ¥ Graphics rendering package Ð Mostly written in Java Ð Designed for AWT Ð Lowest level uses native methods written in “C” Ð Bitmapped fonts JavaOS Details: Applet API

¥ Same code ¥ Same API HotJava As “Desktop”

¥ HotJava Ð HTML browser Ð Written in the Java language Ð Supports multiple windows Ð Can run multiple applets per window Ð Dynamically extendable ¥ Could run other Javaª-based programs Ð Possibly customized versions of HotJava JavaOS Is Not an OS

6. It doesn’t need a file system 5. It doesn’t need virtual memory 4. It doesn’t need separate address spaces 3. It doesn’t support more than one language 2. It doesn’t have its own set of system calls 1. ... JavaOS Is Not an OS

1. Marketing tells people it is NOT an OS JavaOS Is an OS

9. You can boot it 8. You can log in to it 7. It safely runs several applets at a time 6. It drives devices 5. It networks 4. It does windows 3. It has an API Ð the Java Applet API 2. Tons of applets are being written for it JavaOS Is an OS

1. Marketing tells people it is an OS JavaOS Performance: Speed

¥ System built without using a JIT compiler ¥ Network performance Ð Current TCP/IP throughput is 500K Bps Ð Little tuning Ð No native methods written in C JavaOS Performance: Speed

¥ Pendragon CaffeineMark

Category Netscape/Solaris HotJava/Solaris HotJava/JavaOS Seive 31 33 33 Loop 27 27 29 Graphics 89 102 122 Image 57 96 265 CaffeineMark 51 64 112 JavaOS Performance: Memory

¥ 4MB ROM Ð Code for JavaOS includes: ¥ Kernel code and drivers, Java VM and classes, ¥ JavaOS windows, graphics, and networking Ð Code for HotJava Ð Fonts of various types, sizes, and styles ¥ 4MB RAM Ð Assuming ROM can be executed in place Ð 2.5MB for JavaOS + Hotjava Ð 1.5MB for pages, applets, and images JavaOS Advantages

¥ Eliminates host OS overhead Ð Smaller size Ð No extraneous features Ð Faster startup ¥ ROMable ¥ Written in the Java language Ð Safe language Ð Portable Ð Dynamically extendable ¥ Cost of ownership Ð Ease of installation Ð Ease of administration JavaOS for Intranet Computers

¥ Exploit enterprise network infrastructure Ð Ethernet at each desktop Ð Higher speed backbone networks Ð Level of system administration depends on choice of protocols like DHCP or RARP ¥ Supports Javaª-based application environment Ð MIS applications easier to develop, deploy, maintain ¥ OEMs build JavaOS Intranet Computers JavaOS for Internet Computers

¥ Use current or future home networking Ð High-speed modem Ð ISDN Ð Cable modem ¥ Requires an Internet Service Provider (ISP) to make it behave like an appliance ¥ Supports Javaª-based application environment Ð Suitable for surfing the Web ¥ OEMs build JavaOS Internet Computers JavaOS for Network Devices ¥ Tailoring Java to fit the device Ð No subsetting of: ¥ Java VM and language and utility classes Ð Include or exclude based on hardware features: ¥ AWT, Net, and file-related IO classes Ð Tune system for soft real time ¥ VM and garbage collection ¥ JavaOS Development Environment ¥ Embedded JavaOS memory requirements: Ð 128K RAM, 512K ROM Ð Retains ability to download new Java code JavaOS Status

¥ Currently runs on two platforms Ð SPARC Ð X86 ¥ Being ported to other platforms ¥ Available in October 1996 JavaOS Demo

¥ Demo hardware Ð Prototype “network portal” ¥ Demo software Ð No host OS Ð Alpha JavaOS Ð Pre-beta HotJava ¥ Demo applets JavaOS Future

¥ New Java API’s ¥ Device Driver Interface ¥ Window system enhancements Ð Scalable fonts Summary

¥ Features ¥ Performance ¥ Advantages ¥ Target systems ¥ Status Deep Dive: JavaKernel

¥ MMU usage Ð Modified only at boot-time Ð Used to make memory ranges contiguous ¥ JavaOS runs in supervisor mode only ¥ Javaª-compatible interrupt handlers were a little tricky Ð Low-level code uses interrupts-as-threads