AXL SDK

Version

0.1.0

License

MIT

C header

#include <axl.h>

Website

axl.aximcode.com

Source

github.com/aximcode/axl-sdk

Build

axl-cc hello.c -o hello.efi

AXL

AXL (AximCode Library) is a GLib-inspired C library for UEFI, plus an SDK for building UEFI applications and drivers without EDK2.

  • AXL Library (libaxl.a) — the library itself: data structures, file I/O, networking (TCP, UDP, HTTP, TLS), graphics, event loop, logging, and more. UTF-8 everywhere, standard C types, axl_snake_case API.

  • AXL SDK — packages the library with headers, a CRT0 entry point, and axl-cc (a compiler wrapper). Build .efi binaries with a single command — no EDK2 source tree, no gnu-efi, just clang or GCC.

#include <axl.h>

int main(int argc, char **argv) {
    axl_printf("Hello from %s\n", argv[0]);

    AXL_AUTOPTR(AxlString) s = axl_string_new("AXL ");
    axl_string_append_printf(s, "v%d", 1);
    axl_printf("%s\n", axl_string_str(s));

    return 0;
}
$ axl-cc hello.c -o hello.efi    # 11KB binary, zero external deps

Include <axl.h> for the full API, or individual headers for specific modules (e.g., <axl/axl-mem.h>, <axl/axl-net.h>).

AXL Library API

Category

Functions

GLib equivalent

Memory

axl_malloc, axl_free, axl_calloc, axl_new

g_malloc, g_free, g_new0

Auto-cleanup

AXL_AUTO_FREE, AXL_AUTOPTR(Type)

g_autofree, g_autoptr

Strings

axl_strdup, axl_strsplit, axl_strjoin

g_strdup, g_strsplit

String builder

axl_string_new, axl_string_append

GString

String search

axl_strstr, axl_strchr, axl_str_has_prefix

g_strstr_len, g_str_has_prefix

Printf

axl_printf, axl_fprintf, axl_asprintf

g_print

File I/O

axl_fopen, axl_fread, axl_fseek, axl_readline

POSIX-style

File ops

axl_file_get_contents, axl_file_info, axl_file_delete

g_file_get_contents

Directories

axl_dir_open, axl_dir_read, axl_dir_mkdir

g_dir_open

Hash table

axl_hash_table_new, axl_hash_table_insert

GHashTable

Dynamic array

axl_array_new, axl_array_append

GArray

Linked lists

axl_list_append, axl_slist_prepend

GList, GSList

Queue

axl_queue_push_tail, axl_queue_pop_head

GQueue

JSON

axl_json_parse, axl_json_get_string

json-glib

Cache

axl_cache_new, axl_cache_put, axl_cache_get

Config

axl_config_new, axl_config_parse_args

GOptionContext

Event loop

axl_loop_run, axl_loop_add_timer

GMainLoop

Deferred work

axl_defer, axl_signal_emit

Arg parsing

axl_args_parse, axl_args_flag

GOptionContext

Logging

axl_info, axl_debug, axl_error

g_info, g_debug

HTTP client

axl_http_get, axl_http_request

libsoup

HTTP server

axl_http_server_new, axl_http_server_add_route

libsoup

TCP sockets

axl_tcp_connect, axl_tcp_listen

GSocket

UDP sockets

axl_udp_open, axl_udp_send, axl_udp_sendrecv

TLS (optional)

axl_tls_init, axl_tls_generate_self_signed

— (mbedTLS)

Graphics

axl_gfx_fill_rect, axl_gfx_draw_text

— (UEFI GOP)

Task pool

axl_async_submit, axl_buf_pool_new

— (UEFI MP)

Environment

axl_getenv, axl_setenv, axl_chdir

g_getenv, g_chdir

System

axl_reset, axl_driver_load, gBS, gST

— (UEFI-specific)

SMBIOS

axl_smbios_find, axl_smbios_get_string

— (UEFI-specific)

Utilities

AXL_ARRAY_SIZE, AXL_CONTAINER_OF

G_N_ELEMENTS

Quick start

Requirements

  • clang + lld-link (LLVM toolchain, default) or GCC + ld + objcopy

  • No EDK2, no gnu-efi, no external UEFI SDK

Install SDK

git clone --recurse-submodules git@github.com:aximcode/axl-sdk.git
cd axl-sdk
./scripts/install.sh --prefix /opt/axl-sdk

This builds the library for x64 and AARCH64 and packages headers, libs, and the axl-cc compiler wrapper.

Build an app

/opt/axl-sdk/bin/axl-cc hello.c -o hello.efi

Cross-build for AARCH64

/opt/axl-sdk/bin/axl-cc --arch aa64 hello.c -o hello-aa64.efi

CMake

set(AXL_SDK_DIR "/opt/axl-sdk")
include(${AXL_SDK_DIR}/lib/axl.cmake)
axl_add_app(hello hello.c)

Build a driver

/opt/axl-sdk/bin/axl-cc --type driver mydriver.c -o mydriver.efi

Build with TLS (optional)

# Library with TLS support (requires mbedTLS submodule)
make AXL_TLS=1

# Install SDK with TLS
./scripts/install.sh --prefix /opt/axl-sdk AXL_TLS=1

Run tests

# Unit tests (776 tests)
./test/integration/test-axl.sh

# Tool tests (hexdump, grep, find, sysinfo, etc.)
./test/integration/test-tools.sh

# HTTP integration tests
./test/integration/test-http.sh

# UDP integration tests
./test/integration/test-udp.sh

# HTTPS integration tests (requires AXL_TLS=1 build)
./test/integration/test-https.sh

# All architectures (x64 + aa64)
./test/integration/test-all.sh

Documentation

Architecture

AXL Library

  • include/axl/ — public headers. axl_snake_case functions, AxlPascalCase types, standard C types, UTF-8 strings.

  • src/ — module implementations. Each directory has a README.md with overview, examples, and usage guidance: mem, data (str, string, hash, array, list, queue, json, cache), io, log, util (args, config, path, env, sys, driver), loop (event loop, defer, signal), task (arena, task pool, buf pool, async), net (tcp, udp, http, tls), gfx.

  • Backend (src/backend/) — platform abstraction over UEFI firmware services. Single native implementation.

AXL SDK

  • axl-cc — compiler wrapper. Invokes clang + lld-link (or GCC) with the right flags, includes, and libraries.

  • axl-crt0 — UEFI entry point stub. Bridges EFI_HANDLE + EFI_SYSTEM_TABLE to int main(int argc, char **argv).

  • axl.cmake — CMake integration via axl_add_app().

  • include/uefi/ — auto-generated UEFI type definitions from the UEFI spec HTML. No dependency on EDK2 headers.

Optional: TLS

TLS support uses mbedTLS (v3.6.3) as a git submodule. Build with AXL_TLS=1 to enable HTTPS server/client and self-signed certificate generation.

Status

AXL is under active development. The core library is stable with 776 unit tests + 16 tool tests + 17 HTTP integration tests + 3 UDP tests + 5 HTTPS tests. Apps and drivers build with just clang (or GCC) — no EDK2 or external UEFI SDK needed.

License

BSD-2-Clause-Patent