Skip to content

Commit

Permalink
3rd: update opensbi to 1.4
Browse files Browse the repository at this point in the history
Signed-off-by: Zone.N <[email protected]>
  • Loading branch information
MRNIU committed Jan 5, 2024
1 parent 2032f53 commit 952fca6
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cmake/3rd.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ if (gdbinit_ADDED)
COMMAND
echo "target remote ${QEMU_GDB_PORT}" >> ${CMAKE_SOURCE_DIR}/.gdbinit
COMMAND
echo "add-symbol-file ${${KERNEL_ELF_OUTPUT_NAME}_BINARY_DIR}/${KERNEL_ELF_OUTPUT_NAME}" >> ${CMAKE_SOURCE_DIR}/.gdbinit
echo "add-symbol-file ${kernel_BINARY_DIR}/${KERNEL_ELF_OUTPUT_NAME}" >> ${CMAKE_SOURCE_DIR}/.gdbinit
COMMAND
echo "add-symbol-file ${${BOOT_ELF_OUTPUT_NAME}_BINARY_DIR}/${BOOT_ELF_OUTPUT_NAME}" >> ${CMAKE_SOURCE_DIR}/.gdbinit
echo "add-symbol-file ${boot_BINARY_DIR}/${BOOT_ELF_OUTPUT_NAME}" >> ${CMAKE_SOURCE_DIR}/.gdbinit
)
endif ()

Expand Down
6 changes: 3 additions & 3 deletions run.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ set -e
# 输出实际执行内容
#set -x

TARGET_ARCH=x86_64
# TARGET_ARCH=riscv64
# TARGET_ARCH=x86_64
TARGET_ARCH=riscv64
# TARGET_ARCH=aarch64

# 删除旧文件
rm -rf build_${TARGET_ARCH}
# rm -rf build_${TARGET_ARCH}
# 生成
cmake --preset build_${TARGET_ARCH}
# 编译并运行
Expand Down
6 changes: 6 additions & 0 deletions src/kernel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,9 @@ add_dependencies(kernel

set_target_properties(kernel PROPERTIES PREFIX "")
set_target_properties(kernel PROPERTIES OUTPUT_NAME ${KERNEL_ELF_OUTPUT_NAME})

# readelf -a
readelf_a(kernel)

# objdump -D
objdump_D(kernel)
13 changes: 12 additions & 1 deletion src/kernel/arch/riscv64/arch_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void put_char(const char _c) {
return;
}

int arch(int, char **) {
int arch(int, uint8_t **) {
put_char('H');
put_char('e');
put_char('l');
Expand All @@ -69,6 +69,17 @@ int32_t arch_init(uint32_t _argc, uint8_t **_argv) {
(void)_argc;
(void)_argv;

put_char('H');
put_char('e');
put_char('l');
put_char('l');
put_char('W');
put_char('o');
put_char('r');
put_char('l');
put_char('d');
put_char('!');

// 进入死循环
while (1) {
;
Expand Down

0 comments on commit 952fca6

Please sign in to comment.