Feat: lab 4

This commit is contained in:
2025-03-21 03:39:25 +08:00
parent ed2ced5caf
commit 45ebb20cf2
35 changed files with 833 additions and 174 deletions

View File

@@ -1,16 +1,16 @@
ENTRY(_start)
MEMORY
{
NEWTEXT (rx) : ORIGIN = 0x10000, LENGTH = 64K
NEWRO (r) : ORIGIN = 0x20000, LENGTH = 16K
NEWDATA (rw) : ORIGIN = 0x24000, LENGTH = 16K
NEWBSS (rw) : ORIGIN = 0x28000, LENGTH = 16K
NEWTEXT (rx) : ORIGIN = 0x10000, LENGTH = 32K
NEWRO (r) : ORIGIN = 0x18000, LENGTH = 8K
NEWDATA (rw) : ORIGIN = 0x1a000, LENGTH = 8K
NEWBSS (rw) : ORIGIN = 0x1c000, LENGTH = 8K
TEXT (rx) : ORIGIN = 0x80000, LENGTH = 64K
RO (r) : ORIGIN = 0x90000, LENGTH = 16K
DATA (rw) : ORIGIN = 0x94000, LENGTH = 16K
BSS (rw) : ORIGIN = 0x98000, LENGTH = 16K
RAM (rw) : ORIGIN = 0x9c000, LENGTH = 4M
TEXT (rx) : ORIGIN = 0x80000, LENGTH = 32K
RO (r) : ORIGIN = 0x88000, LENGTH = 8K
DATA (rw) : ORIGIN = 0x8a000, LENGTH = 8K
BSS (rw) : ORIGIN = 0x8c000, LENGTH = 8K
RAM (rw) : ORIGIN = 0xa4000, LENGTH = 4M
}
SECTIONS

View File

@@ -1,5 +1,4 @@
#include <stddef.h>
#include <shell.h>
#include <uart.h>
// extern uint64_t __kernel;
@@ -22,7 +21,7 @@ void main(void *dtb)
kernel_header.buf[i] = uart_getb();
uart_puts("received kernel size: ");
uart_int(kernel_header.size);
uart_hex(kernel_header.size);
uart_puts(ENDL);
uart_puts("loaded addr: ");