Skip to content

Chain Loading

A running executable hands primary control to a separately loadable successor stage through a platform-defined loading interface.

Version
v1 · 2026-10-03 · History
Domain-specific #
13053
Domain group
Applied Sciences & Engineering
Origin domain
Computer Science & Software Engineering
Subdomains
Program Execution, Boot Loading → Computer Science & Software Engineering
Aliases
Chainloading

Core Idea

Chain loading occurs when a running executable selects a separately loadable successor and hands it primary execution through a host-defined loading interface. GNU GRUB can chain-load another boot loader instead of loading an operating system directly; HP BASIC for OpenVMS uses CHAIN to start another executable image. The shared structure is a deliberate successor-stage handoff, not an ordinary returning function call.[1][2]

The successor need not overwrite every byte of the predecessor, receive state through a universal common-memory block, or be unable ever to return. Those matters depend on the platform: GRUB allows return on some EFI paths, while HP BASIC CHAIN does not return to the old program.[3][2]

How would you explain it like I'm…

Program Baton Pass

Think of a relay race. The first runner gets ready, hands the baton to the next runner, and now the next runner is in charge of the race. Chain loading is when one computer program gets the next program ready and hands over control to it like that.

Passing the Computer Baton

When a computer starts up or runs programs, one program can pick another program, get it ready, and then hand control over to it. That handoff is called chain loading. For example, a startup program can load a different startup program instead of starting the main system itself. It's not just asking for quick help and then taking back over; the new program becomes the one in charge. Whether the first program can ever get control back depends on the computer system.

Staged Program Handoff

Chain loading is a staged handoff between programs: the currently running program chooses and prepares a separate program, then passes primary execution to it using the system's loading and control-transfer mechanism. A boot loader like GNU GRUB can load another boot loader and jump to it, and in HP BASIC for OpenVMS the CHAIN statement transfers from one running program to another executable. Both involve deliberately giving up control to a successor, not calling a subroutine that returns. The key is who is in control next, not erasing the first program from memory. Details vary: GRUB can return from a chain-loaded loader on some platforms such as EFI, while HP BASIC's CHAIN never returns to the old program.

 

Chain Loading is a staged control handoff: the currently executing program selects and prepares a separately loadable successor, then transfers primary execution to it via the host's loading and control-transfer interface. In booting, GNU GRUB can load a second boot loader and jump to it rather than loading an OS kernel itself. In HP BASIC for OpenVMS, CHAIN moves execution from a running program to another executable image. Despite very different environments, both involve a predecessor deliberately yielding to a successor stage, unlike calling one of its own routines that returns. The defining relation is successor-stage control, not overwriting every byte of the predecessor. Memory residency, state passed across the boundary, and the possibility of return are implementation properties. GRUB permits return from a chain-loaded loader on some platforms such as EFI, whereas HP BASIC's CHAIN never returns to the old program, so neither behavior can be made part of the definition.

Scope of Application

In boot management, GRUB loads another boot loader and jumps to it through real mode or firmware. In program segmentation, an HP BASIC program uses CHAIN to start a named executable; that implementation closes files and releases storage before the new image runs. The two cases share the stage-handoff relation but have different resource and return contracts.[1][2]

IBM XCTL and POSIX exec are useful neighboring mechanisms, not automatic synonyms. XCTL may transfer to an already resident module and removes the issuer module only conditionally; exec replaces a process image while retaining selected process properties and file descriptors.[4][5]

Clarity

To identify chain loading, distinguish the present controlling executable, the distinct successor, the loading interface, the transfer of primary control, and the platform-defined state contract. A returning subroutine has a different control relation; an overlay that leaves the original program in charge is not sufficient. “Load the next stage” does not itself tell us what memory persists, which resources remain open, or whether a later return is possible.[3][2]

Manages Complexity

The concept reduces a complicated boot or application path to a stage graph: predecessor → successor, with a loading and state boundary between them. That graph helps separate failures of target selection, loading, transferred context, and expectations about return. The precise remedy still depends on the actual loader or runtime; the graph does not erase platform rules.[1][2]

Abstract Reasoning

Given a case, ask whether an already running stage chose a distinct executable that became the primary controller. If so, inspect the platform's handoff contract before inferring state persistence or return. GRUB's documented EFI return possibility and HP BASIC's nonreturning file-closing CHAIN show why neither “all memory overwritten” nor “the first stage can never resume” is a valid universal deduction.[3][2]

Knowledge Transfer

The predecessor–successor–interface role map transfers between bootloader delegation and language-runtime program chaining, while their executable formats and resource rules do not. A still broader “one stage yields to another” skeleton may be worth future prime analysis, but executable loading and machine control are constitutive here. The draft therefore proposes no strict DAG parent merely from resemblance to Sequencing, Cascade, Bootstrapping, or Authority Handoff.[1][2]

Neighborhood in Abstraction Space

Chain Loading sits in a sparse region of the domain-specific corpus (63rd percentile for distinctiveness): few abstractions share its structure, so a faithful description tends to retrieve it precisely.

Family — Program Execution & Runtime Concepts (34 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-11-14

References

[1] GNU Project, GNU GRUB Manual 2.14, §5.1.3, “Chain-loading an OS”, original maintainer documentation. registry ↩a ↩b ↩c ↩d

[2] Hewlett Packard Enterprise, HP BASIC for OpenVMS, “CHAIN,” Statements and Functions, p. 3-13, original vendor language manual. registry ↩a ↩b ↩c ↩d ↩e ↩f ↩g

[3] GNU Project, GNU GRUB Manual 2.14, “Platform-specific operations”, paragraph on chainloading and possible return to GRUB on EFI platforms. registry ↩a ↩b ↩c

[4] IBM, “XCTL and XCTLX description,” z/OS 3.1 Documentation, opening description and use-count behavior. registry ↩

[5] The Open Group, The Open Group Base Specifications, Issue 8, exec, process-image and retained file-descriptor rules. registry ↩