Skip to content

Commit

Permalink
Merge branch 'intr'
Browse files Browse the repository at this point in the history
Signed-off-by: Zone.N <[email protected]>
  • Loading branch information
MRNIU committed Nov 24, 2021
2 parents 0c4e0b1 + ee7e0ec commit 66ff91e
Show file tree
Hide file tree
Showing 257 changed files with 33,618 additions and 7,184 deletions.
File renamed without changes.
24 changes: 20 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,37 @@ jobs:
run: |
brew install x86_64-elf-binutils
brew install x86_64-elf-gcc
brew tap riscv/riscv
brew install riscv-tools
- name: make build dir
shell: bash
run: |
mkdir ${{github.workspace}}/build
- name: cmake
- name: osx-i386
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake -DTOOLCHAIN_PREFIX=x86_64-elf- -DCMAKE_C_COMPILER=x86_64-elf-gcc -DCMAKE_CXX_COMPILER=x86_64-elf-g++ -DCMAKE_OBJCOPY=x86_64-elf-objcpy -DPLATFORM=bochs -DARCH=i386 -DCMAKE_BUILD_TYPE=RELEASE -DHAVE_FLAG_SEARCH_PATHS_FIRST=0 ..
run: |
cmake -DTOOLCHAIN_PREFIX=x86_64-elf- -DCMAKE_C_COMPILER=x86_64-elf-gcc -DCMAKE_CXX_COMPILER=x86_64-elf-g++ -DCMAKE_OBJCOPY=x86_64-elf-objcpy -DPLATFORM=bochs -DARCH=i386 -DCMAKE_BUILD_TYPE=RELEASE -DHAVE_FLAG_SEARCH_PATHS_FIRST=0 ..
make
rm -rf ./*
- name: osx-x86_64
shell: bash
working-directory: ${{github.workspace}}/build
run: |
cmake -DTOOLCHAIN_PREFIX=x86_64-elf- -DCMAKE_C_COMPILER=x86_64-elf-gcc -DCMAKE_CXX_COMPILER=x86_64-elf-g++ -DCMAKE_OBJCOPY=x86_64-elf-objcpy -DPLATFORM=bochs -DARCH=x86_64 -DCMAKE_BUILD_TYPE=RELEASE -DHAVE_FLAG_SEARCH_PATHS_FIRST=0 ..
make
rm -rf ./*
- name: make
- name: osx-riscv64
shell: bash
working-directory: ${{github.workspace}}/build
run: make
run: |
cmake -DTOOLCHAIN_PREFIX=riscv64-unknown-elf- -DCMAKE_C_COMPILER=riscv64-unknown-elf-gcc -DCMAKE_CXX_COMPILER=riscv64-unknown-elf-g++ -DCMAKE_OBJCOPY=riscv64-unknown-elf-objcpy -DPLATFORM=qemu -DARCH=riscv64 -DCMAKE_BUILD_TYPE=RELEASE -DHAVE_FLAG_SEARCH_PATHS_FIRST=0 ..
make
rm -rf ./*
# build_ubuntu:
# runs-on: ubuntu-latest
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ bochsout.txt
build
cmake-build-debug
cmake-build-debug_simplekernel
objconv-2.50.zip
objconv-2.50
grub-2.04.tar.xz
grub-2.04
iso
*.img
*.iso
*.bin
*.bin
null.d
tools/opensbi/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "tools/opensbi"]
path = tools/opensbi
url = https://github.com/riscv/opensbi.git
13 changes: 13 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"configurations": [
{
"name": "SimpleKernel_vscode_cpp",
"includePath": [
"${workspaceFolder}/src/**"
],
"cStandard": "gnu17",
"cppStandard": "gnu++17"
}
],
"version": 4
}
126 changes: 126 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
{
"files.associations": {
"array": "cpp",
"string": "cpp",
"string_view": "cpp",
"ranges": "cpp",
"random": "c",
"*.tcc": "cpp",
"streambuf": "cpp",
"cstdio": "cpp",
"exception": "cpp",
"memory_resource": "cpp",
"iosfwd": "cpp",
"new": "cpp",
"ostream": "cpp",
"sstream": "cpp",
"cstdlib": "cpp",
"deque": "cpp",
"vector": "cpp",
"initializer_list": "cpp",
"type_traits": "cpp",
"atomic": "cpp",
"complex": "cpp",
"unordered_map": "cpp",
"iterator": "cpp",
"optional": "cpp",
"utility": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iostream": "cpp",
"bit": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"compare": "cpp",
"concepts": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"map": "cpp",
"set": "cpp",
"memory": "cpp",
"numeric": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"iomanip": "cpp",
"istream": "cpp",
"limits": "cpp",
"stdexcept": "cpp",
"cinttypes": "cpp",
"typeinfo": "cpp",
"list": "cpp",
"climits": "cpp",
"basic_string": "cpp",
"construct": "cpp",
"exceptdef": "cpp",
"hashtable": "cpp",
"heap_algo": "cpp",
"set_algo": "cpp",
"uninitialized": "cpp",
"unordered_set": "cpp",
"util": "cpp",
"queue": "cpp",
"rb_tree": "cpp",
"algo": "cpp",
"algobase": "cpp",
"allocator": "cpp",
"astring": "cpp",
"numbers": "cpp"
},
"cmake.configureOnOpen": true,
// --------Doxygen--------
// 文件注释的组成及其排序
"doxdocgen.file.fileOrder": [
// @file
"file",
// @brief 简介
"brief",
// 作者
"author",
// 版本
"version",
// 日期
"date",
// 版权
"copyright",
// 自定义
"custom"
],
// 下面时设置上面标签tag的具体信息
// 文件注释:版权信息模板
"doxdocgen.file.copyrightTag": [
"@copyright MIT LICENSE",
"https://github.com/Simple-XX/SimpleKernel"
],
// 文件注释:自定义模块,这里我添加一个修改日志
"doxdocgen.file.customTag": [
"@par change log:",
"<table>",
"<tr><th>Date<th>Author<th>Description",
"<tr><td>{date}<td>作者<td>内容",
"</table>",
],
"doxdocgen.file.fileTemplate": "@file {name}",
"doxdocgen.generic.authorEmail": "[email protected]",
"doxdocgen.generic.authorName": "XXX",
"doxdocgen.generic.authorTag": "@author {author} ({email})",
// 日期格式与模板
"doxdocgen.generic.dateFormat": "YYYY-MM-DD",
"doxdocgen.generic.dateTemplate": "@date {date}",
// 根据自动生成的注释模板(目前主要体现在函数注释上)
"doxdocgen.generic.order": [
"brief",
"tparam",
"param",
"return"
],
"doxdocgen.generic.paramTemplate": "@param{indent:8}{param}{indent:25}My Param doc",
"doxdocgen.generic.returnTemplate": "@return {type}{indent:25}",
"doxdocgen.generic.splitCasingSmartText": true,
// --------Doxygen END--------
}
29 changes: 17 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,43 +1,48 @@

# 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).
# Based on https://github.com/SynestiaOS/SynestiaOS
# CMakeLists.txt for Simple-XX/SimpleKernel.
# CMake 入口

# Set minimum cmake version
# 设置最小 cmake 版本
cmake_minimum_required(VERSION 3.10)

# skip cmake compiler check
# 跳过编译器检查
set(CMAKE_C_COMPILER_WORKS TRUE)
set(CMAKE_CXX_COMPILER_WORKS TRUE)

project(SimpleKernel LANGUAGES C CXX ASM)
# 设置项目名与使用的语言
project(SimpleKernel LANGUAGES CXX ASM)

# 禁止原地编译
if(${SimpleKernel_SOURCE_DIR} STREQUAL ${SimpleKernel_BINARY_DIR})
message(FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there.")
endif()

# Set C gnu11
# 设置使用的 C/C++ 版本
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)

# Set cmake moudle path
# 设置辅助 cmake 脚本路径
set(CMAKE_MODULE_PATH "${SimpleKernel_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})

# Set arch
# 设置 arch
include(${SimpleKernel_SOURCE_DIR}/cmake/arch_detector.cmake)
# Set platform
include(${SimpleKernel_SOURCE_DIR}/cmake/platform_detector.cmake)
# Set header files
# 引入添加头文件函数
include(${SimpleKernel_SOURCE_DIR}/cmake/header_files.cmake)
# Find asm source files
# 引入添加汇编文件函数
include(${SimpleKernel_SOURCE_DIR}/cmake/find_asm_files.cmake)

# 设置输出路径
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

# Set kernel name
# 设置内核名称
set(KernelName kernel.elf)

# 设置 src 路径
set(SimpleKernel_SOURCE_CODE_DIR ${SimpleKernel_SOURCE_DIR}/src)
# 跳转到 SimpleKernel_SOURCE_CODE_DIR 下的 CMakeLists
add_subdirectory(${SimpleKernel_SOURCE_CODE_DIR})
Loading

0 comments on commit 66ff91e

Please sign in to comment.