-
-
Notifications
You must be signed in to change notification settings - Fork 418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A completely new version of boot code #188
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
test(efi): use src/boot Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
pref(3rd): remove libcxxrt Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
- riscv 非 static 对象可以正常构造,static 对象会在 cpp_init 死循环,原因未知 - x8_64 只要执行 cpp_init 重的 f 就会 GP,开启 -no-pie 会直接进不去 elf Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Signed-off-by: Zone.N <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
本分支是 SImpleKernel 的首个分支。在本分支中,完成了构建系统的基础搭建、基本的文档部署与自动化测试,当然还有最重要的,有基于 uefi 的 x86_64 内核与由 opensbi 启动的 riscv64 内核,可以在 qemu 上运行,并实现了简单的屏幕输出。
构建系统
参考 MRNIU/cmake-kernel 的构建系统,详细解释见 doc/build_system.md
libc 支持
__stack_chk_guard
__stack_chk_fail()
memcpy()
memmove()
memset()
memcmp()
memchr()
strcpy()
strncpy()
strcat()
strcmp()
strncmp()
strlen()
strnlen()
strchr()
strrchr()
libc++ 支持
__cxa_atexit()
__cxa_finalize()
__cxa_guard_acquire()
__cxa_guard_release()
__cxa_guard_abort()
__cxa_rethrow()
throw
operator new()
operator new[]()
operator new()
operator new[]()
operator delete()
operator delete()
operator delete[]()
operator delete[]()
打印函数调用栈
逐层回溯帧指针后与 elf 信息进行对比,实现对函数调用栈的打印
基础 c++ 异常 支持
通过 throw 抛出异常后停机,没有上下文相关的处理
带颜色的输出
基于 ANSI 转义码,在支持 ANSI 转义码的终端中可以显示有颜色的字符串
基于 gnu-efi 引导的 x86_64 内核
编译后生成 boot.efi 与 kernel.elf,进入 uefi 环境后首先执行 boot.efi,初始化完成后跳转到 kernel.elf 执行
基于 opensbi 引导的 riscv64 内核
全局对象
static ostream cout
static Singleton<KernelElf> kKernelElf
static Singleton<KernelFdt> kKernelFdt
static Singleton<BasicInfo> kBasicInfo
static cpu::Serial kSerial(cpu::kCom1)
基于 doxygen 的文档生成与自动部署
github action 会将文档部署到 https://simple-xx.github.io/SimpleKernel/ (仅 main 分支)
基于 git submodule 的第三方资源管理
使用 git submodule 集成第三方资源
测试
支持 单元测试、集成测试、系统测试,引入 gtest 作为测试框架,同时统计了测试覆盖率
代码分析
引入 cppcheck、clang-tidy、sanitize 工具提前发现错误
代码格式化
使用 google 风格
docker
支持使用 docker 构建,详细使用方法见 doc/docker.md