From 535511f23e320ad0c19a3803cf68b08bb6555c96 Mon Sep 17 00:00:00 2001 From: Tulio A M Mendes Date: Sat, 7 Feb 2026 12:50:34 -0300 Subject: [PATCH] refactor: rename arch_start to arch_early_setup --- README.md | 2 +- include/arch/{arch_start.h => arch_early_setup.h} | 10 +++++----- src/arch/arm/{arch_start.c => arch_early_setup.c} | 4 ++-- src/arch/arm/boot.S | 4 ++-- src/arch/mips/{arch_start.c => arch_early_setup.c} | 4 ++-- src/arch/mips/boot.S | 4 ++-- src/arch/riscv/{arch_start.c => arch_early_setup.c} | 4 ++-- src/arch/riscv/boot.S | 4 ++-- src/arch/x86/{arch_start.c => arch_early_setup.c} | 4 ++-- src/arch/x86/boot.S | 6 +++--- 10 files changed, 23 insertions(+), 23 deletions(-) rename include/arch/{arch_start.h => arch_early_setup.h} (58%) rename src/arch/arm/{arch_start.c => arch_early_setup.c} (86%) rename src/arch/mips/{arch_start.c => arch_early_setup.c} (86%) rename src/arch/riscv/{arch_start.c => arch_early_setup.c} (86%) rename src/arch/x86/{arch_start.c => arch_early_setup.c} (96%) diff --git a/README.md b/README.md index 018a03e1..f7ab93e8 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ QEMU debug helpers: ## TODO - **Multi-architecture kernel bring-up** - Implement VMM/interrupts/scheduler for ARM/RISC-V/MIPS - - Standardize arch entrypoint behavior (`arch_start`) across architectures + - Standardize arch entrypoint behavior (`arch_early_setup`) across architectures - **Userspace** - Process model (fork/exec/wait), per-process address spaces, and cleanup on `exit` - Syscall ABI expansion (read/open/close, file descriptors, etc.) diff --git a/include/arch/arch_start.h b/include/arch/arch_early_setup.h similarity index 58% rename from include/arch/arch_start.h rename to include/arch/arch_early_setup.h index faa317ff..5893e89e 100644 --- a/include/arch/arch_start.h +++ b/include/arch/arch_early_setup.h @@ -7,11 +7,11 @@ * Source: https://github.com/tadryanom/AdrOS */ -#ifndef ARCH_START_H -#define ARCH_START_H + #ifndef ARCH_EARLY_SETUP_H + #define ARCH_EARLY_SETUP_H -#include "arch/arch_boot_args.h" + #include "arch/arch_boot_args.h" -void arch_start(const struct arch_boot_args* args); + void arch_early_setup(const struct arch_boot_args* args); -#endif + #endif diff --git a/src/arch/arm/arch_start.c b/src/arch/arm/arch_early_setup.c similarity index 86% rename from src/arch/arm/arch_start.c rename to src/arch/arm/arch_early_setup.c index aa62eddc..2e64e9ee 100644 --- a/src/arch/arm/arch_start.c +++ b/src/arch/arm/arch_early_setup.c @@ -7,14 +7,14 @@ * Source: https://github.com/tadryanom/AdrOS */ -#include "arch/arch_start.h" + #include "arch/arch_early_setup.h" #include "kernel/boot_info.h" #include "uart_console.h" extern void kernel_main(const struct boot_info* bi); -void arch_start(const struct arch_boot_args* args) { + void arch_early_setup(const struct arch_boot_args* args) { (void)args; uart_init(); diff --git a/src/arch/arm/boot.S b/src/arch/arm/boot.S index 80516894..4f1f5440 100644 --- a/src/arch/arm/boot.S +++ b/src/arch/arm/boot.S @@ -26,9 +26,9 @@ _start: ldr x0, =stack_top mov sp, x0 - /* Build arch_boot_args (in .bss) and call arch_start(args) */ + /* Build arch_boot_args (in .bss) and call arch_early_setup(args) */ ldr x0, =arch_boot_args - bl arch_start + bl arch_early_setup /* Hang */ 1: wfi diff --git a/src/arch/mips/arch_start.c b/src/arch/mips/arch_early_setup.c similarity index 86% rename from src/arch/mips/arch_start.c rename to src/arch/mips/arch_early_setup.c index 12e940d9..6518b319 100644 --- a/src/arch/mips/arch_start.c +++ b/src/arch/mips/arch_early_setup.c @@ -7,14 +7,14 @@ * Source: https://github.com/tadryanom/AdrOS */ -#include "arch/arch_start.h" + #include "arch/arch_early_setup.h" #include "kernel/boot_info.h" #include "uart_console.h" extern void kernel_main(const struct boot_info* bi); -void arch_start(const struct arch_boot_args* args) { + void arch_early_setup(const struct arch_boot_args* args) { (void)args; uart_init(); diff --git a/src/arch/mips/boot.S b/src/arch/mips/boot.S index f4086b8f..d7bc85b3 100644 --- a/src/arch/mips/boot.S +++ b/src/arch/mips/boot.S @@ -22,14 +22,14 @@ _start: la $sp, stack_top - /* Build arch_boot_args (in .bss) and call arch_start(args) */ + /* Build arch_boot_args (in .bss) and call arch_early_setup(args) */ la $a0, arch_boot_args sw $zero, 0($a0) sw $zero, 4($a0) sw $zero, 8($a0) sw $zero, 12($a0) - jal arch_start + jal arch_early_setup nop 1: diff --git a/src/arch/riscv/arch_start.c b/src/arch/riscv/arch_early_setup.c similarity index 86% rename from src/arch/riscv/arch_start.c rename to src/arch/riscv/arch_early_setup.c index aa62eddc..2e64e9ee 100644 --- a/src/arch/riscv/arch_start.c +++ b/src/arch/riscv/arch_early_setup.c @@ -7,14 +7,14 @@ * Source: https://github.com/tadryanom/AdrOS */ -#include "arch/arch_start.h" + #include "arch/arch_early_setup.h" #include "kernel/boot_info.h" #include "uart_console.h" extern void kernel_main(const struct boot_info* bi); -void arch_start(const struct arch_boot_args* args) { + void arch_early_setup(const struct arch_boot_args* args) { (void)args; uart_init(); diff --git a/src/arch/riscv/boot.S b/src/arch/riscv/boot.S index 2097b985..1c4c5a4f 100644 --- a/src/arch/riscv/boot.S +++ b/src/arch/riscv/boot.S @@ -24,9 +24,9 @@ _start: */ la sp, stack_top - /* Build arch_boot_args (in .bss) and call arch_start(args) */ + /* Build arch_boot_args (in .bss) and call arch_early_setup(args) */ la a0, arch_boot_args - call arch_start + call arch_early_setup /* Hang if return */ 1: wfi diff --git a/src/arch/x86/arch_start.c b/src/arch/x86/arch_early_setup.c similarity index 96% rename from src/arch/x86/arch_start.c rename to src/arch/x86/arch_early_setup.c index eade7ce3..5d169802 100644 --- a/src/arch/x86/arch_start.c +++ b/src/arch/x86/arch_early_setup.c @@ -7,7 +7,7 @@ * Source: https://github.com/tadryanom/AdrOS */ -#include "arch/arch_start.h" + #include "arch/arch_early_setup.h" #include "kernel/boot_info.h" @@ -22,7 +22,7 @@ extern void kernel_main(const struct boot_info* bi); static uint8_t multiboot_copy[65536]; static uint32_t multiboot_copy_size; -void arch_start(const struct arch_boot_args* args) { + void arch_early_setup(const struct arch_boot_args* args) { uart_init(); uart_print("\n[AdrOS] Booting...\n"); diff --git a/src/arch/x86/boot.S b/src/arch/x86/boot.S index e9e7b548..f57b5222 100644 --- a/src/arch/x86/boot.S +++ b/src/arch/x86/boot.S @@ -71,7 +71,7 @@ _start: /* * Map 0-16MB using 4 page tables. - * With Multiboot2 info copied in arch_start and initrd mapped via VMM, + * With Multiboot2 info copied in arch_early_setup and initrd mapped via VMM, * we only need a small identity window for early bring-up. */ @@ -162,7 +162,7 @@ higher_half_start: pop %ebx /* EBX now has the Multiboot Info address */ pop %eax /* EAX now has the Magic Number */ - /* Build arch_boot_args (in .bss) and call arch_start(args) */ + /* Build arch_boot_args (in .bss) and call arch_early_setup(args) */ mov $arch_boot_args, %ecx mov %eax, 0(%ecx) /* args->a0 = multiboot magic */ mov %ebx, 4(%ecx) /* args->a1 = multiboot info phys */ @@ -170,7 +170,7 @@ higher_half_start: movl $0, 12(%ecx) /* args->a3 = 0 */ push %ecx - call arch_start + call arch_early_setup add $4, %esp /* Hang */ -- 2.43.0