2021 pre-release

This commit is contained in:
Zihao Yu 2021-07-13 15:53:57 +08:00
parent 11059d5b6f
commit a94708b3b5
42 changed files with 278 additions and 227 deletions

32
scripts/platform/nemu.ld Normal file
View file

@ -0,0 +1,32 @@
ENTRY(_start)
SECTIONS {
/* _pmem_start and _entry_offset are defined in LDFLAGS */
. = _pmem_start + _entry_offset;
.text : {
*(entry)
*(.text*)
}
etext = .;
_etext = .;
.rodata : {
*(.rodata*)
}
.data : {
*(.data)
}
edata = .;
_data = .;
.bss : {
_bss_start = .;
*(.bss*)
*(.sbss*)
*(.scommon)
}
_stack_top = ALIGN(0x1000);
. = _stack_top + 0x8000;
_stack_pointer = .;
end = .;
_end = .;
_heap_start = ALIGN(0x1000);
}

View file

@ -8,11 +8,10 @@ AM_SRCS := nemu/trm.c \
nemu/isa/$(ISA)/trap.S \
nemu/isa/$(ISA)/vme.c \
nemu/mpe.c \
nemu/isa/$(ISA)/boot/start.S
nemu/isa/$(ISA)/start.S
CFLAGS += -fdata-sections -ffunction-sections
LDFLAGS += -L $(AM_HOME)/am/src/nemu/scripts
LDFLAGS += -T $(AM_HOME)/am/src/nemu/isa/$(ISA)/boot/loader.ld
LDFLAGS += -T $(AM_HOME)/scripts/platform/nemu.ld --defsym=_entry_offset=0x100000
LDFLAGS += --gc-sections -e _start
NEMUFLAGS += -b -l $(shell dirname $(IMAGE).elf)/nemu-log.txt $(IMAGE).bin