1 Star 0 Fork 0

MRNIU/SimpleKernel

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

github ci last-commit languages MIT License LICENSE 996.icu

English | 中文

SimpleKernel

关键词

  • kernel
  • x86, x86_64, riscv64
  • C, C++, AT&T ASM
  • cmake
  • multiboot2, opensbi

简介

提供了各个阶段完成度不同的内核,你可以从自己喜欢的地方开始。

各分支内容:

  1. boot: 系统的启动,从引导程序到内核入口
  2. printf: 基本的字符输出,便于调试
  3. parse_boot_info: 对引导程序传递信息的初步解析
  4. pmm: 物理内存初始化
  5. vmm: 虚拟内存初始化
  6. heap: 堆管理
  7. lib: C++ std/stl 的部分支持
  8. intr: 中断管理
  9. 进程: TODO
  10. 文件系统: TODO
  11. 设备管理: TODO
  12. 系统调用: TODO
  13. 用户模式: TODO

开发环境

  • 基本工具

    交叉编译器 x86_64-elf-gcc, riscv64-unknown-elf-gcc, arm-none-eabi-gcc

    调试工具 x86_64-elf-gdb, riscv64-unknown-elf-gdb, arm-none-eabi-gdb

    构建工具 cmake

    模拟器 bochs, qemu

  • For x86

    引导程序 grub

    制作内核镜像 xorriso

  • For riscv64

    引导程序 opensbi

  • For arm

    TODO

如何运行

git clone https://github.com/Simple-XX/SimpleKernel.git
cd SimpleKernel/
bash ./run.sh

运行截图

目录结构

  • 原则

    整个工程按照功能模块划分子目录,每个子目录再划分头文件和源文件目录,以便架构清晰、易懂。

目录设计

  • 原则

    目录的命名能准确描述模块的基本功能,建议用小写字母且不含下划线、点等特殊符号;

    目录必须放于相包含的父目录之下,并需要明确与其他目录间的耦合性。

  • 示例

    kernel:系统内核部分; libs:依赖库;

依赖关系

  • 原则

    新添加组件往往依赖于系统原有组件,必须以最小耦合的方式明确所直接依赖的组件。

头文件

文件命名

头文件命名能准确描述文件所包含的模块内容,达到通俗、易懂的目的。

CMake

测试

自动集成

每次 push 会使用 Github Action 进行测试,可以通过编译即可。

代码风格

  • git commit 规范:

    [tools/Git Commit 规范.pdf](./tools/Git Commit 规范.pdf)

  • 代码样式

    由 .clang-format 指定

TODO

  • 并发
  • 文件系统
  • 设备驱动

贡献者

MRNIU

cy295957410

rakino

xiaoerlaigeid

digmouse233

KehRoche

贡献

Free to PR!

感谢

此项目参考了很多优秀的项目和资料。

osdev

GRUB 在 Mac 上的安装

multiboot

《程序员的自我修养--链接、装载与库》(俞甲子 石凡 潘爱民)

JamesM's kernel development tutorials

xOS

hurlex

howerj/os

cfenollosa/os-tutorial

omarrx024/xos

PurpleBooth/project-title

0xAX weblong

How-to-Make-a-Computer-Operating-System

coding-style

DNKernel

c-algorithms

Linux内核中的中断栈与内核栈的补充说明

Linux进程管理 (1)进程的诞生

SynestiaOS

捐助者

版权信息

此项目使用 MIT 许可证

MIT License Copyright (c) 2018 Simple-XX Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ---------- Copyright (c) 2019 Simple-XX Anti 996 License Version 1.0 (Draft) Permission is hereby granted to any individual or legal entity obtaining a copy of this licensed work (including the source code, documentation and/or related items, hereinafter collectively referred to as the "licensed work"), free of charge, to deal with the licensed work for any purpose, including without limitation, the rights to use, reproduce, modify, prepare derivative works of, distribute, publish and sublicense the licensed work, subject to the following conditions: 1. The individual or the legal entity must conspicuously display, without modification, this License and the notice on each redistributed or derivative copy of the Licensed Work. 2. The individual or the legal entity must strictly comply with all applicable laws, regulations, rules and standards of the jurisdiction relating to labor and employment where the individual is physically located or where the individual was born or naturalized; or where the legal entity is registered or is operating (whichever is stricter). In case that the jurisdiction has no such laws, regulations, rules and standards or its laws, regulations, rules and standards are unenforceable, the individual or the legal entity are required to comply with Core International Labor Standards. 3. The individual or the legal entity shall not induce or force its employee(s), whether full-time or part-time, or its independent contractor(s), in any methods, to agree in oral or written form, to directly or indirectly restrict, weaken or relinquish his or her rights or remedies under such laws, regulations, rules and standards relating to labor and employment as mentioned above, no matter whether such written or oral agreement are enforceable under the laws of the said jurisdiction, nor shall such individual or the legal entity limit, in any methods, the rights of its employee(s) or independent contractor(s) from reporting or complaining to the copyright holder or relevant authorities monitoring the compliance of the license about its violation(s) of the said license. THE LICENSED WORK IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN ANY WAY CONNECTION WITH THE LICENSED WORK OR THE USE OR OTHER DEALINGS IN THE LICENSED WORK.

简介

暂无描述 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/MRNIU233/SimpleKernel.git
git@gitee.com:MRNIU233/SimpleKernel.git
MRNIU233
SimpleKernel
SimpleKernel
main

搜索帮助

Cb406eda 1850385 E526c682 1850385