Skip to content

GUI AWT

opencode-agent[bot] edited this page May 11, 2026 · 6 revisions

GUI & AWT

JNode implements a graphical user interface subsystem that supports the standard Java Abstract Window Toolkit (AWT), allowing many standard Java graphical applications to run unmodified.

Overview

Because JNode does not have an underlying host OS like X11 or Wayland, it must implement the entire graphical stack from the ground up—from writing pixels directly to the video card framebuffer, up to handling mouse clicks, and finally rendering AWT components.

Architecture

The GUI stack is divided into hardware drivers and the AWT implementation.

Location: gui/src/

1. Video Drivers (org.jnode.driver.video)

Location: gui/src/driver/org/jnode/driver/video/

Video drivers manage the physical graphics hardware through the Video-Driver-Architecture subsystem.

  • VGA/VESA: Standard fallback drivers that use BIOS calls (during boot) or VBE to set up a linear framebuffer.
  • Hardware-Specific Drivers: JNode includes rudimentary support for specific chipsets (e.g., ATI, VMware, NVIDIA) to enable hardware acceleration or better resolution switching.
  • Framebuffer (FrameBufferAPI): The driver exposes a raw chunk of memory representing the screen pixels through the Surface abstraction.

2. Input Drivers (org.jnode.driver.input)

Location: core/src/driver/org/jnode/driver/input/

Handles user interaction. See Input-Drivers for details.

  • Keyboard: Translates raw PS/2 or USB scancodes into Java KeyEvents.
  • Mouse: Translates hardware motion and clicks into MouseEvents.
  • Input events are queued and dispatched to the active AWT window.

3. AWT Implementation (org.jnode.awt)

Location: gui/src/awt/org/jnode/awt/

To support standard Java GUI applications, JNode provides a custom implementation of java.awt.Toolkit and peer classes. See AWT-Peer-Implementation for details.

  • JNodeToolkit: The entry point for AWT. When an application calls Toolkit.getDefaultToolkit(), JNode returns this instance.
  • Peers: In standard Java, peers bridge AWT to the native OS windowing system (e.g., WButtonPeer on Windows). In JNode, peers (like JNodeButtonPeer) render themselves using JNode's own 2D graphics primitives directly to the video driver's framebuffer.
  • Font Rendering: JNode includes a FreeType-based font rasterizer to render TrueType fonts onto the screen.

Desktop Environments

JNode supports multiple presentation layers:

  • TextScreen: A raw 80x25 VGA text mode interface. Used during early boot and for the raw console.
  • Swing Console: A graphical terminal emulator that draws text onto the graphical framebuffer, allowing for higher resolutions and custom fonts while presenting a traditional CLI.
  • Thinlet: A lightweight GUI framework supported by JNode for simple desktop applications.

Related Pages

Clone this wiki locally