Skip to content

Commit

Permalink
Merge pull request #153 from MRNIU/master
Browse files Browse the repository at this point in the history
refactor
  • Loading branch information
MRNIU authored May 13, 2023
2 parents 3cc3a83 + 733b428 commit 0463c81
Show file tree
Hide file tree
Showing 558 changed files with 82,463 additions and 21,980 deletions.
427 changes: 343 additions & 84 deletions .clang-format

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
shell: bash
run: |
brew install x86_64-elf-gcc
brew tap riscv/riscv
brew tap riscv-software-src/riscv
brew install riscv-tools
- name: make build dir
Expand Down
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@

# This file is a part of Simple-XX/SimpleKernel (https://github.com/Simple-XX/SimpleKernel).
# This file is a part of Simple-XX/SimpleKernel
# (https://github.com/Simple-XX/SimpleKernel).
#
# .gitinnore for Simple-XX/SimpleKernel.

bochsout.txt
*.o
*.gch
*.tags*
.DS_Store
build
cmake-build-debug
cmake-build-debug_simplekernel
build*
grub-2.04.tar.xz
grub-2.04
tools/opensbi
Expand All @@ -20,3 +18,5 @@ iso
*.bin
null.d
tools/aarch64-unknown-linux-gnu*
.gdbinit
tools/opensbi/build
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/SimpleKernel.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/cmake.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions .idea/dictionaries/SimpleKernel_dir.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/git_toolbox_prj.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/runConfigurations/kernel.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .idea/runConfigurations/make_i386_iso.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .idea/runConfigurations/make_x86_64_iso.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/runConfigurations/qemu_i386_debug.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/runConfigurations/qemu_riscv64_debug.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/runConfigurations/qemu_x86_64_debug.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/scopes/src.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added .idea/tool_settings.zip
Binary file not shown.
14 changes: 14 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

# This file is a part of Simple-XX/SimpleKernel
# (https://github.com/Simple-XX/SimpleKernel).
# Based on https://github.com/SynestiaOS/SynestiaOS
#
# CMakeLists.txt for Simple-XX/SimpleKernel.
# CMake 入口

# 设置最小 cmake 版本
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.13)

# 跳过编译器检查
set(CMAKE_C_COMPILER_WORKS TRUE)
Expand Down
13 changes: 7 additions & 6 deletions cmake/toolchain_linux_aarch64.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

# This file is a part of Simple-XX/SimpleKernel (https://github.com/Simple-XX/SimpleKernel).
# This file is a part of Simple-XX/SimpleKernel
# (https://github.com/Simple-XX/SimpleKernel).
#
# toolchain_linux_aarch64.cmake for Simple-XX/SimpleKernel.

Expand All @@ -11,13 +12,13 @@ set(CMAKE_SYSTEM_PROCESSOR AARCH64)
# GCC
find_program(GCC aarch64-none-eabi-gcc)
if (NOT GCC)
message(FATAL_ERROR "aarch64-none-eabi-gcc not found.\n"
"Run `brew install aarch64-none-eabi-gcc` to install the toolchain")
message(FATAL_ERROR "gcc-aarch64-linux-gnu not found.\n"
"Run `sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu` to install.")
else ()
message(STATUS "Found aarch64-none-eabi-gcc ${GCC}")
message(STATUS "Found gcc-aarch64-linux-gnu ${GCC}")
endif ()

set(TOOLCHAIN_PREFIX aarch64-none-eabi-)
set(TOOLCHAIN_PREFIX aarch64-linux-gnu-)
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}g++)
set(CMAKE_READELF ${TOOLCHAIN_PREFIX}readelf)
Expand All @@ -31,7 +32,7 @@ set(CMAKE_RANLIB ${TOOLCHAIN_PREFIX}ranlib)
find_program(QEMU qemu-system-aarch64)
if (NOT QEMU)
message(FATAL_ERROR "qemu not found.\n"
"Please install qemu first.")
"Run `sudo apt-get install -y qemu-system` to install.")
else ()
message(STATUS "Found qemu ${QEMU}")
endif ()
7 changes: 4 additions & 3 deletions cmake/toolchain_linux_riscv.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

# This file is a part of Simple-XX/SimpleKernel (https://github.com/Simple-XX/SimpleKernel).
# This file is a part of Simple-XX/SimpleKernel
# (https://github.com/Simple-XX/SimpleKernel).
#
# toolchain_linux_riscv.cmake for Simple-XX/SimpleKernel.

Expand All @@ -11,7 +12,7 @@ set(CMAKE_SYSTEM_PROCESSOR RISCV)
find_program(RISCV riscv64-linux-gnu-g++)
if (NOT RISCV)
message(FATAL_ERROR "riscv64-linux-gnu-gcc not found.\n"
"Run `sudo apt-get install -y gcc-riscv64-linux-gnu g++-riscv64-linux-gnu` to install the toolchain. Then add the bin path to you PATH.")
"Run `sudo apt-get install -y gcc-riscv64-linux-gnu g++-riscv64-linux-gnu` to install.")
else ()
message(STATUS "Found riscv64-linux-gnu-gcc ${RISCV}.")
endif ()
Expand All @@ -30,7 +31,7 @@ set(CMAKE_RANLIB ${TOOLCHAIN_PREFIX}ranlib)
find_program(QEMU qemu-system-riscv64)
if (NOT QEMU)
message(FATAL_ERROR "qemu not found.\n"
"Please install qemu-system-riscv64 first.")
"Run `sudo apt-get install -y qemu-system` to install.")
else ()
message(STATUS "Found qemu ${QEMU}")
endif ()
20 changes: 6 additions & 14 deletions cmake/toolchain_linux_x86_64.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

# This file is a part of Simple-XX/SimpleKernel (https://github.com/Simple-XX/SimpleKernel).
# This file is a part of Simple-XX/SimpleKernel
# (https://github.com/Simple-XX/SimpleKernel).
#
# toolchain_linux_x86_64.cmake for Simple-XX/SimpleKernel.

Expand All @@ -11,7 +12,7 @@ set(CMAKE_SYSTEM_PROCESSOR x86_64)
find_program(G++ g++)
if (NOT G++)
message(FATAL_ERROR "g++ not found.\n"
"Run `sudo apt-get install -y gcc g++` to install the toolchain")
"Run `sudo apt-get install -y gcc g++` to install.")
else ()
message(STATUS "Found g++ ${G++}")
endif ()
Expand All @@ -20,7 +21,7 @@ endif ()
find_program(XORRISO xorriso)
if (NOT XORRISO)
message(FATAL_ERROR "xorriso not found.\n"
"Run `sudo apt-get install -y xorriso` to install the toolchain")
"Run `sudo apt-get install -y xorriso` to install.")
else ()
message(STATUS "Found xorriso ${XORRISO}")
endif ()
Expand All @@ -29,25 +30,16 @@ endif ()
find_program(GRUB grub-file)
if (NOT GRUB)
message(FATAL_ERROR "grub-file not found.\n"
"Please install grub2 common first.")
"Run `sudo apt-get install -y grub2` to install.")
else ()
message(STATUS "Found grub-file ${GRUB}")
endif ()

# bochs
find_program(BOCHS bochs)
if (NOT BOCHS)
message(FATAL_ERROR "bochs not found.\n"
"Please install bochs and bochs-x first.")
else ()
message(STATUS "Found bochs ${BOCHS}")
endif ()

# qemu
find_program(QEMU qemu-system-x86_64)
if (NOT QEMU)
message(FATAL_ERROR "qemu not found.\n"
"Please install qemu first.")
"Run `sudo apt-get install -y qemu-system` to install.")
else ()
message(STATUS "Found qemu ${QEMU}")
endif ()
2 changes: 1 addition & 1 deletion cmake/toolchain_mac_riscv.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ endif ()
find_program(RISCV riscv64-unknown-elf-gcc)
if (NOT RISCV)
message(FATAL_ERROR "riscv64-unknown-elf-gcc not found.\n"
"Run `brew tap riscv/riscv` and `brew install riscv-tools` to install the toolchain. Then add the bin path to you PATH.")
"Run `brew tap riscv-software-src/riscv` and `brew install riscv-tools` to install the toolchain. Then add the bin path to you PATH.")
else ()
message(STATUS "Found riscv64-unknown-elf-gcc ${RISCV}.")
endif ()
Expand Down
9 changes: 0 additions & 9 deletions cmake/toolchain_mac_x86_64.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,6 @@ else ()
message(STATUS "Found grub-file ${GRUB}")
endif ()

# bochs
find_program(BOCHS bochs)
if (NOT BOCHS)
message(FATAL_ERROR "bochs not found.\n"
"run `brew install bochs` to install the toolchain")
else ()
message(STATUS "Found bochs ${BOCHS}")
endif ()

# qemu
find_program(QEMU qemu-system-x86_64)
if (NOT QEMU)
Expand Down
Loading

0 comments on commit 0463c81

Please sign in to comment.