From 1767d390fbf3d0c65389de46caf0b6d43ef3b6ad Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Fri, 10 Jul 2026 11:24:56 +0800 Subject: feat: establish bootable new architecture checkpoint Replace the compressed boot path with a relocatable higher-half RISC-V entry, expand memory and SMP support, and add the driver, TTY, VFS, exec, signal, syscall, initramfs, and self-test infrastructure needed for a bootable kernel checkpoint. --- na/test/test_reloc.cc | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 na/test/test_reloc.cc (limited to 'na/test/test_reloc.cc') diff --git a/na/test/test_reloc.cc b/na/test/test_reloc.cc deleted file mode 100644 index 54e7144..0000000 --- a/na/test/test_reloc.cc +++ /dev/null @@ -1,46 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ -/* Copyright (C) 2026 Richard Qin */ - -/* - * Boot Self-Test: relocation engine - */ - -#include -#include - -struct RelocBlob { - RelocTableHeader hdr; - RelocEntry entries[2]; -}; - -void selftest_reloc() -{ - st_begin("reloc: relative + abs64"); - - alignas(8) uint8 buf[64] = {}; - uint64 base = reinterpret_cast(buf); - uint64 link_base = base - 0x1000; - - RelocBlob blob = {}; - blob.hdr.magic = kRelocTableMagic; - blob.hdr.version = kRelocTableVersion; - blob.hdr.arch = RELOC_ARCH_RISCV; - blob.hdr.entry_size = sizeof(RelocEntry); - blob.hdr.entry_count = 2; - - blob.entries[0].offset = 8; - blob.entries[0].addend = 0x200; - blob.entries[0].type = RELOC_RISCV_RELATIVE; - - blob.entries[1].offset = 16; - blob.entries[1].addend = link_base + 0x1234; - blob.entries[1].type = RELOC_RISCV_64; - - RelocStatus st = relocate_apply(base, sizeof(buf), link_base, - &blob, sizeof(blob)); - ST_ASSERT_EQ(st, RELOC_OK); - ST_ASSERT_EQ(*reinterpret_cast(base + 8), base + 0x200); - ST_ASSERT_EQ(*reinterpret_cast(base + 16), base + 0x1234); - - st_pass(); -} -- cgit v1.2.3