From: Tulio A M Mendes Date: Thu, 5 Feb 2026 19:41:17 +0000 (-0300) Subject: arch/mips: add minimal boot and linker script X-Git-Url: https://projects.tadryanom.me/sitemap.xml?a=commitdiff_plain;h=e1fec662e9c3837d03d6b60c0d8132e50adbb7bf;p=AdrOS.git arch/mips: add minimal boot and linker script --- diff --git a/src/arch/mips/boot.S b/src/arch/mips/boot.S new file mode 100644 index 0000000..ef79e42 --- /dev/null +++ b/src/arch/mips/boot.S @@ -0,0 +1,35 @@ +/* + * AdrOS - MIPS32 Bootstrap + * Minimal entry point that sets up a stack and calls kernel_main. + */ + + .set noreorder + .set noat + + .section .text + .globl _start + .ent _start + +_start: + la $sp, stack_top + + /* kernel_main(unsigned long magic, unsigned long addr) + * For now, pass 0, 0 (no multiboot on MIPS) + */ + move $a0, $zero + move $a1, $zero + + jal kernel_main + nop + +1: + j 1b + nop + + .end _start + + .section .bss + .align 16 +stack_bottom: + .space 16384 +stack_top: diff --git a/src/arch/mips/linker.ld b/src/arch/mips/linker.ld new file mode 100644 index 0000000..babb9cc --- /dev/null +++ b/src/arch/mips/linker.ld @@ -0,0 +1,32 @@ +/* + * AdrOS - MIPS32 Linker Script + * Target: QEMU malta (RAM typically starts at 0x80000000, KSEG0) + */ + +ENTRY(_start) + +SECTIONS +{ + . = 0x80000000; + + _start = .; + + .text : { + *(.text) + } + + .rodata : { + *(.rodata) + } + + .data : { + *(.data) + } + + .bss : { + *(.bss) + *(COMMON) + } + + _end = .; +}