Skip to content

Boot CD ROM Builder

opencode-agent[bot] edited this page Nov 22, 2026 · 4 revisions

Boot CD-ROM Builder

Builder for bootable CD-ROM ISO images in JNode's build system.

Overview

The Boot CD-ROM Builder is the build system component that assembles all JNode artifacts (boot image, init-jar, GRUB bootloader) into a bootable ISO-9660 formatted CD-ROM image. It is invoked by the cdrom, cdrom-lite, and cdrom_64-lite targets in the build system.

Key Components

File Purpose
all/build.xml Master build file, defines CD-ROM targets
all/build-x86.xml Contains create-cdrom macro and cdrom/cdrom-lite targets
all/conf/x86/menu-cdrom.lst, menu-cdrom-64.lst, menu.lst GRUB menus; the JNode Install entries load install.jgz
all/conf/install-plugin-list.xml Plugin set and Main-Class for the install initjar
builder/lib/iso9660.jar ISOTask library for ISO-9660 image creation

How It Works

Build Targets

The build system exposes four CD-ROM targets:

sh build.sh cd-x86                # Full distribution ISO
sh build.sh cd-x86-lite           # Lite x86 ISO
sh build.sh cd-x86_64-lite        # Lite x86_64 ISO
sh build.sh cd-x86-combined-lite  # Lite combined 32+64-bit ISO

The cd-x86-combined-lite target builds both 32-bit and 64-bit kernels (jnode32.gz + jnode64.gz) and creates one ISO with menu-disk-combined.lst. The GRUB menu offers paired 32-bit then 64-bit entries for each boot mode (default, all-plugins, shell, VESA, tests, install, DHCP).

Install Entries

The JNode Install entry is enabled (it was commented out before #615) in all/conf/x86/menu-cdrom.lst, menu-cdrom-64.lst and the disk menu.lst. It loads the normal kernel with install.jgz:

title JNode Install
kernel /jnode32.gz
module /install.jgz

all/conf/install-plugin-list.xml boots org.jnode.shell.CommandShell with Main-Class-Arg=boot instead of the old org.jnode.install.Main, so the install command runs with console input bound to a live shell. The list also includes org.classpath.ext, org.classpath.ext.core and org.classpath.ext.xml, which the install tooling needs. The result was rebuilt and verified as cd-x86-lite.

VESA Mode Entries

The combined boot menu includes VESA framebuffer mode entries for both 32-bit and 64-bit kernels. These entries load the fb kernel parameter and use vbematch 800 600 32 to select an 800x600x32bpp VESA mode, loading the full plugin set (full.jgz) instead of the minimal shell:

title JNode 32-bit (VESA mode)
kernel (hd0,0)/jnode32.gz mp=no fb kdb lkd
vbematch 800 600 32
module (hd0,0)/full.jgz

VESA entries require a VBE-compatible display adapter. The vbematch directive is processed by GRUB's VBE module to negotiate the best matching mode.

create-cdrom Macro

The create-cdrom macro in all/build-x86.xml:286 assembles the CD-ROM contents:

Directory contents:
  ├── boot/grub/           GRUB boot files (eltorito.s2, fat.s15, grub.s1, grub.s2)
  ├── boot/grub/menu.lst   Boot menu configuration
  ├── licenses/            License files
  ├── jnode*.gz            Boot image (compressed kernel)
  └── initjars/            Plugin JARs and descriptors

ISO Creation

The macro supports two ISO creation backends:

  1. mkisofs (Unix/Linux): Uses the system mkisofs utility with El Torito boot catalog

    mkisofs -o <destfile> -R -b boot/grub/eltorito.s2 \
      -no-emul-boot -boot-load-size 4 -boot-info-table <dir>
    
  2. ISOTask (cross-platform): Uses de.tu_darmstadt.informatik.rbg.hatlak.iso9660.ISOTask from iso9660.jar

    • enableRockRidge: Enables Rock Ridge extensions for Unix-style filenames
    • mkisofsCompatibility: Ensures compatibility with mkisofs-generated images
    • bootImage: Specifies the El Torito boot image
    • bootImageSectorCount: Boot image size in sectors (4 for GRUB)
    • genBootInfoTable: Generates boot info table for BIOS

Boot Image Structure

The CD-ROM follows this layout:

Component Location Purpose
Boot image Root jnode*.gz - compressed boot image
Init JAR Root initjars/ - all plugin JARs
GRUB boot/grub/ Bootloader stages
Menu boot/grub/menu.lst Boot configuration
Licenses licenses/ GPL/LGPL license files

GRUB Configuration

The menu.lst file is copied from all/conf/menu-cdrom.lst and provides boot menu options. GRUB is configured to:

  • Boot from El Torito emulation (no-emulation boot)
  • Load the boot image from CD-ROM
  • Pass multiboot parameters to the kernel

ISOTask Library

The ISOTask library (de.tu_darmstadt.informatik.rbg.hatlak.iso9660.ISOTask) is a Java-based ISO-9660 image creator that:

  • Implements ISO-9660 Level 1 and Level 2 formats
  • Supports Rock Ridge extensions for long filenames
  • Generates El Torito bootable CDs
  • Provides mkisofs-compatible output

Gotchas

  • Platform dependency: The mkisofs path is Unix/Linux only; Windows builds must use ISOTask
  • mkisofs spaces issue: Build fails on Windows if the path contains spaces
  • Boot image size: The boot image sector count (4 sectors = 2KB) must match GRUB expectations
  • ISOTask classpath: The iso9660.jar must be in the build classpath for ISOTask to work
  • Rock Ridge: Enabled by default but can affect compatibility with non-Unix systems
  • Output path: CD-ROM images are written to all/build/cdroms/jnode-*.iso

Related Pages

Clone this wiki locally