Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d5ee6fe
feat: add UEFI HTTP boot support with file upload and manifest APIs
Josen-B May 9, 2026
3c02b85
feat: add UEFI HTTP Boot runner with CLI and config support
Josen-B May 9, 2026
0f240a8
feat: support efi_loader_path config for HTTP Boot runner
Josen-B May 9, 2026
1bd9446
feat: add httpboot-loader crate with no-std manifest parser and UEFI …
Josen-B May 9, 2026
78361da
feat: extract URI from UEFI device path and derive sibling manifest URL
Josen-B May 11, 2026
8b62838
feat: add downloaded manifest byte parser with validation
Josen-B May 11, 2026
168519c
feat: probe EFI HTTP protocol availability via locate_handle_buffer
Josen-B May 11, 2026
50d7390
feat: probe EFI HTTP child handle creation and destruction
Josen-B May 11, 2026
b54cfed
feat: probe EFI HTTP configure and reset with IPv4 default settings
Josen-B May 11, 2026
3b4260c
feat: refactor UEFI types into modules and implement HTTP GET request…
Josen-B May 11, 2026
b114ceb
feat: implement HTTP response handling and manifest parsing for UEFI …
Josen-B May 11, 2026
881e40f
feat: implement kernel HTTP probe request and response handling for U…
Josen-B May 11, 2026
822ab80
fix: rename httpboot-loader crate to httpboot
Josen-B May 12, 2026
8a8d65c
feat: implement chunked kernel download to UEFI pool memory with chec…
Josen-B May 12, 2026
7a2e6e1
feat: download kernel to fixed load address using UEFI allocate_pages
Josen-B May 12, 2026
471216c
feat: probe memory map and prepare kernel jump readiness for UEFI loader
Josen-B May 12, 2026
a53bda1
feat: implement ExitBootServices call with retry and memory map abstr…
Josen-B May 12, 2026
73da97b
feat: add entry call module with arch-aware calling convention for UE…
Josen-B May 12, 2026
d37193b
feat: integrate entry point call into ExitBootServices flow for UEFI …
Josen-B May 12, 2026
ea71760
feat: add proxy DHCP service support for HTTP Boot
Josen-B May 12, 2026
96050c6
feat: extend proxy DHCP to handle DHCP Request/ACK with configurable …
Josen-B May 12, 2026
55d6345
feat: add LoongArch64 native UEFI loader and embedded manifest URL fa…
Josen-B May 14, 2026
9b23e50
refactor: split monolithic UEFI loader main.rs into modular source files
Josen-B May 14, 2026
c40e64a
feat: implement TLS handshake with process_packet and pre-receive for…
Josen-B May 14, 2026
a33a3b1
feat: implement TLS encrypt/decrypt for application data in UEFI loader
Josen-B May 14, 2026
77b66a8
feat: implement raw TCP4 HTTPS GET for kernel download with TLS in UE…
Josen-B May 15, 2026
483acd5
feat: implement kernel boot jump with exit boot services and memory d…
Josen-B May 15, 2026
5674d40
feat: add serial output, graphics boot info, and TLS plaintext stripp…
Josen-B May 18, 2026
f5e9fd2
feat: add HTTPS static server for HTTP Boot and fresh TLS connection …
Josen-B May 18, 2026
fcdade0
feat: add HTTP network warmup and retry logic for UEFI loader
Josen-B May 18, 2026
a193928
feat: add TCP4 connect retry with network warmup and remove legacy C …
Josen-B May 18, 2026
839c9f7
feat: wire up full HTTP boot loader pipeline with boot-jump feature g…
Josen-B May 28, 2026
09cdec3
feat: support pre-built frontend assets via EMBED_WEB_DIR env
Josen-B May 28, 2026
32a378e
feat: add HTTP range request support for chunked kernel download with…
Josen-B May 29, 2026
b5f51b6
feat: add COM1 serial port output to UEFI console module
Josen-B May 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
465 changes: 211 additions & 254 deletions Cargo.lock

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
[workspace]
exclude = ["assets/*", "fit_test"]
members = ["ostool", "uboot-shell", "jkconfig", "fitimage", "ostool-server"]
members = [
"ostool",
"uboot-shell",
"jkconfig",
"fitimage",
"ostool-server",
"httpboot",
]
resolver = "3"

[workspace.dependencies]
Expand Down
24 changes: 24 additions & 0 deletions httpboot/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[package]
name = "httpboot"
authors = ["柏乔森 <baiqiaosen@gmail.com>"]
categories = ["command-line-interface", "config"]
description = "UEFI HTTP Boot bare-bin loader for ostool"
edition = "2024"
keywords = ["ostool", "uefi", "http boot", "loader"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/drivercraft/ostool"
version = "0.1.0"
publish = false

[lib]
path = "src/lib.rs"

[[bin]]
name = "httpboot"
path = "src/main.rs"
required-features = ["uefi-app"]

[features]
default = []
uefi-app = []
boot-jump = ["uefi-app"]
73 changes: 73 additions & 0 deletions httpboot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# ostool HTTP Boot

This crate contains the UEFI-side loader for `ostool run httpboot`.

Current status:

- The shared no-std core parses `manifest.json`.
- The shared no-std core can extract a URI device path and derive the sibling `manifest.json` URL.
- The `uefi-app` binary builds a minimal UEFI application stub for targets that Rust supports, such as `x86_64-unknown-uefi`.
- The loader opens Loaded Image Protocol, reads its file path URI, and derives the sibling `manifest.json` URL.
- When the loader is started from a local EFI system partition instead of HTTP Boot, it can use the compile-time `OSTOOL_HTTPBOOT_MANIFEST_URL` fallback.
- The loader uses UEFI HTTP Protocol to download `manifest.json` and the kernel `.bin`.
- The loader places the kernel at `kernel_load_addr`, prepares memory-map and `ExitBootServices` state, and prints the entry plan.
- The final boot jump is behind the default-off `boot-jump` feature.

Build the x86_64 loader after installing the target:

```bash
rustup target add x86_64-unknown-uefi
cargo build -p httpboot --features uefi-app --target x86_64-unknown-uefi
mkdir -p target/httpboot
cp target/x86_64-unknown-uefi/debug/httpboot.efi target/httpboot/BOOTX64.EFI
```

The default build downloads and loads the kernel, prints the jump plan, and stops before `ExitBootServices`.
Build with `boot-jump` only after the x86_64 AxVisor direct-entry ABI is ready:

```bash
cargo build -p httpboot --features boot-jump --target x86_64-unknown-uefi
```

Then set:

```toml
efi_loader_path = "target/httpboot/BOOTX64.EFI"
```

For local ESP or removable-media boot, build the loader with an embedded manifest URL:

```bash
OSTOOL_HTTPBOOT_MANIFEST_URL=http://10.3.10.229:2999/boot/boards/loongchip-httpboot-smoke/current/manifest.json \
cargo build -p httpboot --features uefi-app --target x86_64-unknown-uefi
```

In that mode the firmware only needs to start the EFI application from disk/USB/ESP.
The loader still uses UEFI HTTP Protocol to download `manifest.json` and `kernel.bin`.

LoongArch64 boards use the native C loader in:

```text
loongarch64-uefi-loader/
```

Build it with:

```bash
make -C loongarch64-uefi-loader
```

The output is:

```text
target/loongarch64-uefi-loader/BOOTLOONGARCH64.EFI
```

If UEFI Shell returns `Command Error Status: Unsupported` before printing
`ostool LoongArch64 UEFI loader`, rebuild this loader and copy the fresh output
to `EFI/BOOT/BOOTLOONGARCH64.EFI`. The native loader keeps `.text` at PE RVA
`0x1000` and emits a valid no-op `.reloc` block because some firmware rejects
EFI images whose first section starts at RVA `0x0` or whose relocation directory
is malformed.

Do not use `BOOTX64.EFI` on a LoongArch board.
Loading