From be72400beaa4dcd54fc8cbb474026f2b3ed121a6 Mon Sep 17 00:00:00 2001 From: Abhishek Shivakumar Date: Fri, 21 Aug 2026 00:42:49 +0100 Subject: [PATCH 01/18] Add Android Termux QEMU runner --- android/termux-run.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 android/termux-run.sh diff --git a/android/termux-run.sh b/android/termux-run.sh new file mode 100644 index 0000000..3f1fe1e --- /dev/null +++ b/android/termux-run.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +set -euo pipefail + +ISO="${1:-${FLOW_KERNEL_ISO:-$PWD/flow-kernel.iso}}" +QEMU="${FLOW_KERNEL_QEMU:-qemu-system-x86_64}" +MEMORY="${FLOW_KERNEL_MEMORY:-128M}" + +if ! command -v "$QEMU" >/dev/null 2>&1; then + echo "flow-kernel: $QEMU is not installed" >&2 + echo "flow-kernel: on Termux run: pkg install x11-repo && pkg install qemu-system-x86-64" >&2 + exit 1 +fi + +if [[ ! -r "$ISO" ]]; then + echo "flow-kernel: ISO not found or unreadable: $ISO" >&2 + echo "usage: $0 /path/to/flow-kernel.iso" >&2 + exit 1 +fi + +exec "$QEMU" \ + -machine accel=tcg \ + -m "$MEMORY" \ + -cdrom "$ISO" \ + -boot d \ + -serial stdio \ + -display none \ + -monitor none \ + -no-reboot \ + -no-shutdown From d7238ea266ad07d1b1055682c5bce673d3bb7959 Mon Sep 17 00:00:00 2001 From: Abhishek Shivakumar Date: Fri, 21 Aug 2026 00:42:54 +0100 Subject: [PATCH 02/18] Add Termux setup helper --- android/termux-setup.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 android/termux-setup.sh diff --git a/android/termux-setup.sh b/android/termux-setup.sh new file mode 100644 index 0000000..9244b6e --- /dev/null +++ b/android/termux-setup.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +set -euo pipefail + +case "$(uname -m)" in + aarch64|arm64|x86_64) + ;; + *) + echo "flow-kernel: a 64-bit Termux environment is required for the x86_64 QEMU target" >&2 + exit 1 + ;; +esac + +pkg update +pkg install -y x11-repo +pkg install -y qemu-system-x86-64 + +qemu-system-x86_64 --version From 6efff57460415cac36845ec0debbe256e6893f6c Mon Sep 17 00:00:00 2001 From: Abhishek Shivakumar Date: Fri, 21 Aug 2026 00:43:08 +0100 Subject: [PATCH 03/18] Document Android boot path --- android/README.md | 78 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 android/README.md diff --git a/android/README.md b/android/README.md new file mode 100644 index 0000000..e9bc094 --- /dev/null +++ b/android/README.md @@ -0,0 +1,78 @@ +# Flow Kernel on Android + +This boots the current x86_64 Multiboot2 Flow kernel inside QEMU TCG on a 64-bit Android device. It does not replace Android, unlock the bootloader, require root, or modify the phone kernel. + +## 1. Install QEMU in Termux + +Use a current Termux installation, then run: + +```bash +bash termux-setup.sh +``` + +The setup helper enables the Termux X11 package repository and installs `qemu-system-x86-64`, which provides the `qemu-system-x86_64` binary used by the runner. + +Equivalent manual commands are: + +```bash +pkg update +pkg install x11-repo +pkg install qemu-system-x86-64 +``` + +No X11 application is needed because Flow kernel output is carried over the emulated serial port. + +## 2. Get the kernel image + +Download the `flow-kernel-android-x86_64` artifact from a successful GitHub Actions run and extract it into a directory visible to Termux. The artifact contains: + +```text +flow-kernel.iso +termux-run.sh +SHA256SUMS +``` + +Verify the image before booting: + +```bash +sha256sum -c SHA256SUMS +``` + +## 3. Boot Flow + +From the extracted artifact directory: + +```bash +bash termux-run.sh flow-kernel.iso +``` + +A successful boot reaches: + +```text +Flow kernel: entry +Flow kernel: boot contract accepted +``` + +QEMU is intentionally configured with TCG rather than KVM because the current guest is x86_64 while normal modern Android phones are ARM64. + +Press `Ctrl+A`, then `X` to terminate QEMU if required. + +## Environment overrides + +The runner accepts these optional variables: + +```bash +FLOW_KERNEL_ISO=/path/to/flow-kernel.iso +FLOW_KERNEL_QEMU=qemu-system-x86_64 +FLOW_KERNEL_MEMORY=128M +``` + +For example: + +```bash +FLOW_KERNEL_MEMORY=256M bash termux-run.sh flow-kernel.iso +``` + +## Next architecture target + +This Android path deliberately validates the existing kernel unchanged. The next native-emulation target should be `aarch64` using QEMU's `virt` machine so ARM64 Android hosts no longer pay the x86_64 instruction-translation cost. From 463e433f70b1cb15b0b2288dc60c6d0f6f542ea8 Mon Sep 17 00:00:00 2001 From: Abhishek Shivakumar Date: Fri, 21 Aug 2026 00:43:18 +0100 Subject: [PATCH 04/18] Document Android QEMU boot --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 233d51f..014ae80 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,21 @@ FLOW=../flow/flow bash x86_64/run.sh That additionally requires `grub-mkrescue` and `qemu-system-x86_64`. Successful boot reaches the serial message `Flow kernel: boot contract accepted`. +## Boot on Android + +The same x86_64 ISO can boot on a 64-bit Android phone through Termux and QEMU TCG without root or bootloader changes. + +```bash +pkg update +pkg install x11-repo +pkg install qemu-system-x86-64 +bash android/termux-run.sh /path/to/flow-kernel.iso +``` + +CI publishes a `flow-kernel-android-x86_64` artifact containing the ISO, Android runner, and checksum manifest. See [`android/README.md`](android/README.md) for the complete phone workflow. + ## Roadmap The next layers are Multiboot2 memory-map ingestion, a physical page allocator, interrupt/exception tables, timer-driven scheduling, syscall entry, virtual memory ownership, and then the eBPF verifier/interpreter/JIT hooks. eBPF should consume explicit kernel hook surfaces rather than becoming part of the boot substrate. + +An `aarch64` architecture target is also planned so ARM64 Android devices can boot Flow under QEMU's `virt` machine without translating an x86_64 guest. From 2d0b7c1d99d6d3a88089aed4d071bd9e2fcda209 Mon Sep 17 00:00:00 2001 From: Abhishek Shivakumar Date: Fri, 21 Aug 2026 00:43:35 +0100 Subject: [PATCH 05/18] Exercise Android runner in kernel CI --- .github/workflows/ci.yml | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f8316b..fd7c9b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,6 +44,11 @@ jobs: xorriso \ qemu-system-x86 + - name: Validate Android runner scripts + run: | + bash -n android/termux-run.sh + bash -n android/termux-setup.sh + - name: Build freestanding x86_64 ELF env: FLOW: ${{ github.workspace }}/flow/flow @@ -65,17 +70,12 @@ jobs: grub-mkrescue -o /tmp/flow-kernel.iso /tmp/flow-kernel-iso test -s /tmp/flow-kernel.iso - - name: Boot smoke under QEMU + - name: Boot smoke through Android-compatible runner run: | set +e - timeout 10s qemu-system-x86_64 \ - -machine accel=tcg \ - -m 128M \ - -cdrom /tmp/flow-kernel.iso \ - -serial file:/tmp/flow-kernel-serial.log \ - -display none \ - -no-reboot \ - -no-shutdown + timeout 10s env FLOW_KERNEL_QEMU=qemu-system-x86_64 \ + bash android/termux-run.sh /tmp/flow-kernel.iso \ + > /tmp/flow-kernel-serial.log 2>&1 rc=$? set -e @@ -88,6 +88,17 @@ jobs: grep -F 'Flow kernel: entry' /tmp/flow-kernel-serial.log grep -F 'Flow kernel: boot contract accepted' /tmp/flow-kernel-serial.log + - name: Package Android boot artifact + run: | + package=/tmp/flow-kernel-android-x86_64 + mkdir -p "$package" + cp /tmp/flow-kernel.iso "$package/flow-kernel.iso" + cp android/termux-run.sh "$package/termux-run.sh" + cp android/termux-setup.sh "$package/termux-setup.sh" + cp android/README.md "$package/README.md" + (cd "$package" && sha256sum flow-kernel.iso > SHA256SUMS) + cat "$package/SHA256SUMS" + - name: Upload kernel artifacts if: always() uses: actions/upload-artifact@v4 @@ -99,3 +110,12 @@ jobs: /tmp/flow-kernel-serial.log if-no-files-found: warn retention-days: 7 + + - name: Upload Android boot artifact + if: always() + uses: actions/upload-artifact@v4 + with: + name: flow-kernel-android-x86_64 + path: /tmp/flow-kernel-android-x86_64/ + if-no-files-found: warn + retention-days: 7 From 663f691789ba9d0a97e2456723b179d0fa537d5b Mon Sep 17 00:00:00 2001 From: Abhishek Shivakumar Date: Fri, 21 Aug 2026 00:43:45 +0100 Subject: [PATCH 06/18] Keep Android artifact docs in sync --- android/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/android/README.md b/android/README.md index e9bc094..62045ea 100644 --- a/android/README.md +++ b/android/README.md @@ -29,6 +29,8 @@ Download the `flow-kernel-android-x86_64` artifact from a successful GitHub Acti ```text flow-kernel.iso termux-run.sh +termux-setup.sh +README.md SHA256SUMS ``` From f83c99661a62ccc7a59675471afdd7e64e3921e0 Mon Sep 17 00:00:00 2001 From: Abhishek Shivakumar Date: Fri, 21 Aug 2026 00:44:57 +0100 Subject: [PATCH 07/18] Fix Flow dependency setup in kernel CI --- .github/workflows/ci.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd7c9b7..5486648 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,8 +30,17 @@ jobs: repository: flooooooooooow/flow path: flow - - name: Set up Flow Python environment - uses: ./flow/.github/actions/setup-python + - name: Set up Flow Python + uses: actions/setup-python@v6 + with: + python-version: '3.11' + cache: pip + cache-dependency-path: flow/requirements.lock + + - name: Install Flow Python dependencies + run: | + python -m pip install --upgrade pip + pip install -r flow/requirements.lock - name: Install freestanding and boot-test toolchain run: | From e8ed0586479782571dd267a235dce7bee6d225d2 Mon Sep 17 00:00:00 2001 From: Abhishek Shivakumar Date: Fri, 21 Aug 2026 00:48:05 +0100 Subject: [PATCH 08/18] Add freestanding stdio declarations --- x86_64/freestanding/stdio.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 x86_64/freestanding/stdio.h diff --git a/x86_64/freestanding/stdio.h b/x86_64/freestanding/stdio.h new file mode 100644 index 0000000..9c1683a --- /dev/null +++ b/x86_64/freestanding/stdio.h @@ -0,0 +1,14 @@ +#ifndef FLOW_KERNEL_FREESTANDING_STDIO_H +#define FLOW_KERNEL_FREESTANDING_STDIO_H + +#include + +typedef struct flow_kernel_FILE FILE; + +extern FILE *stderr; + +int printf(const char *format, ...); +int fprintf(FILE *stream, const char *format, ...); +int snprintf(char *buffer, size_t size, const char *format, ...); + +#endif From f83a18d38e93240ac48a7252f63ee2c5b4016a28 Mon Sep 17 00:00:00 2001 From: Abhishek Shivakumar Date: Fri, 21 Aug 2026 00:48:08 +0100 Subject: [PATCH 09/18] Add freestanding stdlib declarations --- x86_64/freestanding/stdlib.h | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 x86_64/freestanding/stdlib.h diff --git a/x86_64/freestanding/stdlib.h b/x86_64/freestanding/stdlib.h new file mode 100644 index 0000000..1c65217 --- /dev/null +++ b/x86_64/freestanding/stdlib.h @@ -0,0 +1,11 @@ +#ifndef FLOW_KERNEL_FREESTANDING_STDLIB_H +#define FLOW_KERNEL_FREESTANDING_STDLIB_H + +#include + +void *malloc(size_t size); +void free(void *ptr); +int atexit(void (*function)(void)); +__attribute__((noreturn)) void abort(void); + +#endif From 1a47caf7c012bdd3d4834c03e77d542fe4b2ef6e Mon Sep 17 00:00:00 2001 From: Abhishek Shivakumar Date: Fri, 21 Aug 2026 00:48:14 +0100 Subject: [PATCH 10/18] Add freestanding string declarations --- x86_64/freestanding/string.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 x86_64/freestanding/string.h diff --git a/x86_64/freestanding/string.h b/x86_64/freestanding/string.h new file mode 100644 index 0000000..451bb1d --- /dev/null +++ b/x86_64/freestanding/string.h @@ -0,0 +1,13 @@ +#ifndef FLOW_KERNEL_FREESTANDING_STRING_H +#define FLOW_KERNEL_FREESTANDING_STRING_H + +#include + +size_t strlen(const char *text); +int strcmp(const char *lhs, const char *rhs); +int strncmp(const char *lhs, const char *rhs, size_t count); +void *memcpy(void *dst, const void *src, size_t count); +void *memmove(void *dst, const void *src, size_t count); +void *memset(void *dst, int value, size_t count); + +#endif From b872039a7df314a5369c77528d51694db375ef15 Mon Sep 17 00:00:00 2001 From: Abhishek Shivakumar Date: Fri, 21 Aug 2026 00:48:19 +0100 Subject: [PATCH 11/18] Add freestanding math header --- x86_64/freestanding/math.h | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 x86_64/freestanding/math.h diff --git a/x86_64/freestanding/math.h b/x86_64/freestanding/math.h new file mode 100644 index 0000000..76a2d6e --- /dev/null +++ b/x86_64/freestanding/math.h @@ -0,0 +1,4 @@ +#ifndef FLOW_KERNEL_FREESTANDING_MATH_H +#define FLOW_KERNEL_FREESTANDING_MATH_H + +#endif From cf1ba9786f5dbdb644ff152940109ba147fb20d9 Mon Sep 17 00:00:00 2001 From: Abhishek Shivakumar Date: Fri, 21 Aug 2026 00:48:29 +0100 Subject: [PATCH 12/18] Add freestanding Flow runtime compatibility shim --- x86_64/freestanding/runtime.c | 124 ++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 x86_64/freestanding/runtime.c diff --git a/x86_64/freestanding/runtime.c b/x86_64/freestanding/runtime.c new file mode 100644 index 0000000..43808f6 --- /dev/null +++ b/x86_64/freestanding/runtime.c @@ -0,0 +1,124 @@ +#include +#include +#include +#include + +struct flow_kernel_FILE { + int reserved; +}; + +static FILE flow_kernel_stderr; +FILE *stderr = &flow_kernel_stderr; + +int printf(const char *format, ...) +{ + (void)format; + return 0; +} + +int fprintf(FILE *stream, const char *format, ...) +{ + (void)stream; + (void)format; + return 0; +} + +int snprintf(char *buffer, size_t size, const char *format, ...) +{ + (void)format; + if (buffer != NULL && size != 0) { + buffer[0] = '\0'; + } + return 0; +} + +void *malloc(size_t size) +{ + (void)size; + return NULL; +} + +void free(void *ptr) +{ + (void)ptr; +} + +int atexit(void (*function)(void)) +{ + (void)function; + return 0; +} + +__attribute__((noreturn)) void abort(void) +{ + for (;;) { + __asm__ volatile ("cli; hlt"); + } +} + +size_t strlen(const char *text) +{ + size_t length = 0; + while (text[length] != '\0') { + ++length; + } + return length; +} + +int strcmp(const char *lhs, const char *rhs) +{ + while (*lhs != '\0' && *lhs == *rhs) { + ++lhs; + ++rhs; + } + return (int)(unsigned char)*lhs - (int)(unsigned char)*rhs; +} + +int strncmp(const char *lhs, const char *rhs, size_t count) +{ + while (count != 0 && *lhs != '\0' && *lhs == *rhs) { + ++lhs; + ++rhs; + --count; + } + if (count == 0) { + return 0; + } + return (int)(unsigned char)*lhs - (int)(unsigned char)*rhs; +} + +void *memcpy(void *dst, const void *src, size_t count) +{ + unsigned char *out = (unsigned char *)dst; + const unsigned char *in = (const unsigned char *)src; + for (size_t i = 0; i < count; ++i) { + out[i] = in[i]; + } + return dst; +} + +void *memmove(void *dst, const void *src, size_t count) +{ + unsigned char *out = (unsigned char *)dst; + const unsigned char *in = (const unsigned char *)src; + if (out < in) { + for (size_t i = 0; i < count; ++i) { + out[i] = in[i]; + } + } else if (out > in) { + while (count != 0) { + --count; + out[count] = in[count]; + } + } + return dst; +} + +void *memset(void *dst, int value, size_t count) +{ + unsigned char *out = (unsigned char *)dst; + for (size_t i = 0; i < count; ++i) { + out[i] = (unsigned char)value; + } + return dst; +} From bff48e5fe2ce9ea46d1c0af764cfd905c8ddf781 Mon Sep 17 00:00:00 2001 From: Abhishek Shivakumar Date: Fri, 21 Aug 2026 00:48:41 +0100 Subject: [PATCH 13/18] Keep generated Flow kernel C freestanding --- x86_64/build.sh | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/x86_64/build.sh b/x86_64/build.sh index 7108796..0db67ac 100644 --- a/x86_64/build.sh +++ b/x86_64/build.sh @@ -4,6 +4,7 @@ set -euo pipefail HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" BUILD="${1:-$HERE/build}" FLOW="${FLOW:-$HERE/../../flow/flow}" +FREESTANDING="$HERE/freestanding" if [[ ! -x "$FLOW" ]]; then echo "Flow compiler not found or not executable: $FLOW" >&2 @@ -18,21 +19,31 @@ mkdir -p "$BUILD" --export kernel_main kernel_abi_version kernel_page_size kernel_boot_magic_valid kernel_page_count \ -o "$BUILD/kernel.c" +COMMON_CFLAGS=( + -target x86_64-unknown-none-elf + -std=c11 + -ffreestanding + -fno-builtin + -fno-stack-protector + -fno-pic + -fno-pie + -mno-red-zone + -ffunction-sections + -fdata-sections + -O2 + -I "$FREESTANDING" +) + clang \ - -target x86_64-unknown-none-elf \ - -std=c11 \ - -ffreestanding \ - -fno-builtin \ - -fno-stack-protector \ - -fno-pic \ - -fno-pie \ - -mno-red-zone \ - -ffunction-sections \ - -fdata-sections \ - -O2 \ + "${COMMON_CFLAGS[@]}" \ -c "$BUILD/kernel.c" \ -o "$BUILD/kernel-flow.o" +clang \ + "${COMMON_CFLAGS[@]}" \ + -c "$FREESTANDING/runtime.c" \ + -o "$BUILD/freestanding-runtime.o" + clang \ -target x86_64-unknown-none-elf \ -ffreestanding \ @@ -48,6 +59,7 @@ ld.lld \ -T "$HERE/linker.ld" \ "$BUILD/boot.o" \ "$BUILD/kernel-flow.o" \ + "$BUILD/freestanding-runtime.o" \ -o "$BUILD/flow-kernel.elf" if command -v grub-file >/dev/null 2>&1; then From 5f8b5fadf55f87f0fc6095f7119f62fb3fb3982a Mon Sep 17 00:00:00 2001 From: Abhishek Shivakumar Date: Fri, 21 Aug 2026 00:50:21 +0100 Subject: [PATCH 14/18] Move x86 privileged helpers out of cEmbed --- x86_64/arch.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 x86_64/arch.c diff --git a/x86_64/arch.c b/x86_64/arch.c new file mode 100644 index 0000000..4b9c423 --- /dev/null +++ b/x86_64/arch.c @@ -0,0 +1,31 @@ +#include + +static inline void flow_kernel_outb(uint16_t port, uint8_t value) +{ + __asm__ volatile ("outb %0, %1" : : "a"(value), "Nd"(port)); +} + +void flow_kernel_serial_init(void) +{ + flow_kernel_outb(0x3f8 + 1, 0x00); + flow_kernel_outb(0x3f8 + 3, 0x80); + flow_kernel_outb(0x3f8 + 0, 0x03); + flow_kernel_outb(0x3f8 + 1, 0x00); + flow_kernel_outb(0x3f8 + 3, 0x03); + flow_kernel_outb(0x3f8 + 2, 0xc7); + flow_kernel_outb(0x3f8 + 4, 0x0b); +} + +void flow_kernel_serial_write(const char *text) +{ + while (*text != '\0') { + flow_kernel_outb(0x3f8, (uint8_t)*text++); + } +} + +__attribute__((noreturn)) void flow_kernel_halt(void) +{ + for (;;) { + __asm__ volatile ("cli; hlt"); + } +} From 0f3c588ca31eac8bd1a3728807e461f8eec590a4 Mon Sep 17 00:00:00 2001 From: Abhishek Shivakumar Date: Fri, 21 Aug 2026 00:50:27 +0100 Subject: [PATCH 15/18] Use external x86 architecture shim --- x86_64/kernel.flow | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/x86_64/kernel.flow b/x86_64/kernel.flow index 0b027d7..24106bf 100644 --- a/x86_64/kernel.flow +++ b/x86_64/kernel.flow @@ -3,36 +3,6 @@ # Phase one deliberately keeps the architecture shim tiny: Flow owns boot # validation and kernel policy; the shim owns privileged CPU/serial operations. -@cEmbed(" -#include - -static inline void flow_kernel_outb(uint16_t port, uint8_t value) { - __asm__ volatile (\"outb %0, %1\" : : \"a\"(value), \"Nd\"(port)); -} - -void flow_kernel_serial_init(void) { - flow_kernel_outb(0x3f8 + 1, 0x00); - flow_kernel_outb(0x3f8 + 3, 0x80); - flow_kernel_outb(0x3f8 + 0, 0x03); - flow_kernel_outb(0x3f8 + 1, 0x00); - flow_kernel_outb(0x3f8 + 3, 0x03); - flow_kernel_outb(0x3f8 + 2, 0xc7); - flow_kernel_outb(0x3f8 + 4, 0x0b); -} - -void flow_kernel_serial_write(const char* text) { - while (*text) { - flow_kernel_outb(0x3f8, (uint8_t)*text++); - } -} - -__attribute__((noreturn)) void flow_kernel_halt(void) { - for (;;) { - __asm__ volatile (\"cli; hlt\"); - } -} -") - extern { function flow_kernel_serial_init() -> void function flow_kernel_serial_write(text: string) -> void From 02f90d3537f396017c33edc644e8ae6eb0959a7f Mon Sep 17 00:00:00 2001 From: Abhishek Shivakumar Date: Fri, 21 Aug 2026 00:50:38 +0100 Subject: [PATCH 16/18] Link external x86 architecture shim --- x86_64/build.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/x86_64/build.sh b/x86_64/build.sh index 0db67ac..a0487ca 100644 --- a/x86_64/build.sh +++ b/x86_64/build.sh @@ -39,6 +39,11 @@ clang \ -c "$BUILD/kernel.c" \ -o "$BUILD/kernel-flow.o" +clang \ + "${COMMON_CFLAGS[@]}" \ + -c "$HERE/arch.c" \ + -o "$BUILD/arch.o" + clang \ "${COMMON_CFLAGS[@]}" \ -c "$FREESTANDING/runtime.c" \ @@ -59,6 +64,7 @@ ld.lld \ -T "$HERE/linker.ld" \ "$BUILD/boot.o" \ "$BUILD/kernel-flow.o" \ + "$BUILD/arch.o" \ "$BUILD/freestanding-runtime.o" \ -o "$BUILD/flow-kernel.elf" From 34780fc05521a617d6ccbdebd39e72d2cebaee28 Mon Sep 17 00:00:00 2001 From: Abhishek Shivakumar Date: Fri, 21 Aug 2026 00:51:53 +0100 Subject: [PATCH 17/18] Use available binutils inspection tools in CI --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5486648..9f17140 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,8 +68,8 @@ jobs: bash x86_64/build.sh /tmp/flow-kernel-build test -s /tmp/flow-kernel-build/flow-kernel.elf grub-file --is-x86-multiboot2 /tmp/flow-kernel-build/flow-kernel.elf - llvm-readelf -h /tmp/flow-kernel-build/flow-kernel.elf - llvm-nm /tmp/flow-kernel-build/flow-kernel.elf | grep -F 'flow_export_kernel_main' + readelf -h /tmp/flow-kernel-build/flow-kernel.elf + nm /tmp/flow-kernel-build/flow-kernel.elf | grep -F 'flow_export_kernel_main' - name: Build bootable GRUB image run: | From 41b01a900e9507e324d8d51d239510a413b91230 Mon Sep 17 00:00:00 2001 From: Abhishek Shivakumar Date: Fri, 21 Aug 2026 00:53:02 +0100 Subject: [PATCH 18/18] Install mtools for GRUB rescue image --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9f17140..285a3ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,6 +50,7 @@ jobs: lld \ grub-common \ grub-pc-bin \ + mtools \ xorriso \ qemu-system-x86