From eb61923207ee759141cbd308e390b863fb34fe61 Mon Sep 17 00:00:00 2001 From: Yifan Wu Date: Wed, 7 Apr 2021 16:39:45 +0800 Subject: [PATCH] Apply lost patches. --- os/Makefile | 8 ++++---- os/src/linker-k210.ld | 3 +++ os/src/linker-qemu.ld | 3 +++ user/src/linker.ld | 3 +++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/os/Makefile b/os/Makefile index c7991add..ea818c6b 100644 --- a/os/Makefile +++ b/os/Makefile @@ -58,10 +58,9 @@ disasm-vim: kernel @vim $(DISASM_TMP) @rm $(DISASM_TMP) -run: tools run-inner +run: run-inner -tools: - (which $(K210-BURNER)) || (cd .. && git clone https://github.com/sipeed/kflash.py.git && mv kflash.py tools) + run-inner: build ifeq ($(BOARD),qemu) @@ -71,6 +70,7 @@ ifeq ($(BOARD),qemu) -bios $(BOOTLOADER) \ -device loader,file=$(KERNEL_BIN),addr=$(KERNEL_ENTRY_PA) else + (which $(K210-BURNER)) || (cd .. && git clone https://github.com/sipeed/kflash.py.git && mv kflash.py tools) @cp $(BOOTLOADER) $(BOOTLOADER).copy @dd if=$(KERNEL_BIN) of=$(BOOTLOADER).copy bs=$(K210_BOOTLOADER_SIZE) seek=1 @mv $(BOOTLOADER).copy $(KERNEL_BIN) @@ -85,4 +85,4 @@ debug: build tmux split-window -h "riscv64-unknown-elf-gdb -ex 'file $(KERNEL_ELF)' -ex 'set arch riscv:rv64' -ex 'target remote localhost:1234'" && \ tmux -2 attach-session -d -.PHONY: build env kernel clean disasm disasm-vim run-inner tools +.PHONY: build env kernel clean disasm disasm-vim run-inner diff --git a/os/src/linker-k210.ld b/os/src/linker-k210.ld index 8a24ad14..2ef74ca0 100644 --- a/os/src/linker-k210.ld +++ b/os/src/linker-k210.ld @@ -18,6 +18,7 @@ SECTIONS srodata = .; .rodata : { *(.rodata .rodata.*) + *(.srodata .srodata.*) } . = ALIGN(4K); @@ -25,6 +26,7 @@ SECTIONS sdata = .; .data : { *(.data .data.*) + *(.sdata .sdata.*) } . = ALIGN(4K); @@ -33,6 +35,7 @@ SECTIONS *(.bss.stack) sbss = .; *(.bss .bss.*) + *(.sbss .sbss.*) } . = ALIGN(4K); diff --git a/os/src/linker-qemu.ld b/os/src/linker-qemu.ld index 8348a385..8bcce1a7 100644 --- a/os/src/linker-qemu.ld +++ b/os/src/linker-qemu.ld @@ -18,6 +18,7 @@ SECTIONS srodata = .; .rodata : { *(.rodata .rodata.*) + *(.srodata .srodata.*) } . = ALIGN(4K); @@ -25,6 +26,7 @@ SECTIONS sdata = .; .data : { *(.data .data.*) + *(.sdata .sdata.*) } . = ALIGN(4K); @@ -33,6 +35,7 @@ SECTIONS *(.bss.stack) sbss = .; *(.bss .bss.*) + *(.sbss .sbss.*) } . = ALIGN(4K); diff --git a/user/src/linker.ld b/user/src/linker.ld index d3f023d2..75438fb9 100644 --- a/user/src/linker.ld +++ b/user/src/linker.ld @@ -13,13 +13,16 @@ SECTIONS } .rodata : { *(.rodata .rodata.*) + *(.srodata .srodata.*) } .data : { *(.data .data.*) + *(.sdata .sdata.*) } .bss : { start_bss = .; *(.bss .bss.*) + *(.sbss .sbss.*) end_bss = .; } /DISCARD/ : {