Code Monkey home page Code Monkey logo

simplekernel's People

Contributors

anjieyang avatar cy295957410 avatar mrniu avatar rakino avatar xiaoerlaigeid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simplekernel's Issues

一行写满时不能自动换行

Describe the bug
一行写满时不能自动换行

To Reproduce
Steps to reproduce the behavior:

  1. 运行kernel
  2. 将一行写满,不手动换行
  3. 多余的字符不显示,也没有自动换行

Expected behavior
一行写满时应自动从下一行开始继续

Screenshots
2019-01-11 3 50 14

Desktop (please complete the following information):

  • OS: MacOS 10.14.2
  • Compile tools: i386-elf-gcc i386-elf-ld
  • Emulator: Bochs 2.6.9
  • Branch: TODO

[HELP]想知道i386架构下代码具体的编译指令

我的系统是MacOS 12.6.5,我尝试用x86_64-elf-as -o boot.o boot.S手动编译i386架构下的boot.S,给出的错误信息是:
image
但是使用提供的run.sh脚本是可以正常编译运行的,我不太熟悉CMakeLists,查找了一下也没有找到可以编译成功的方法。如果将代码的#define ...修改为.SET ...倒是可以编译成功,但这样手动编译出来并不符合i386架构。

如果我想用这个boot.S和一个kernel.c写一个bare bone,请问要如何编译链接?

或者有什么方法可以让CMake输出所有编译和链接的指令吗?

内核构建

生成 boot、内核 elf 文件

需要考虑不同平台的区分,使用最小编译参数

backspace has a mistake

Describe the bug
退格键会影响到上一行;且会留下多余字符

To Reproduce
Steps to reproduce the behavior:

  1. 运行kernel
  2. 使用退格键
  3. See error

Expected behavior
应该没有多余的字符,且不应该影响上一行

Screenshots
2019-01-11 9 03 28
2019-01-11 9 03 37

Desktop (please complete the following information):

  • OS: MacOS 10.14.2
  • Compile tools: i386-elf-gcc i386-elf-ld
  • Emulator: Bochs 2.6.9
  • Branch: TODO

CI

支持 github action,codecov 等

clock有问题

使用 cpu_hlt(); 打印出来的 tick 数量有时候不够,很难复现

clang 支持

相比 gcc,clang 可以简单构造出交叉编译工具链,可以省去配置环境的麻烦。

[HELP]无法生成iso文件

  • OS: [MacOS 12.6.5]
  • Compile tools: [i386-elf-gcc i386-elf-ld]
  • Emulator: [qemu]
    qemu-system-x86_64: -cdrom ./simplekernel.iso: Could not open './simplekernel.iso': No such file or directory
    其他错误信息:
image

是不是先来个架构图,来个全景视角

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
[Optional] A clear and concise description of what you want to happen.

Describe alternatives you've considered
[Optional] A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

[ASK FOR HELP]Mac 运行 bash ./run.sh 后没有启动 README 中的操作界面

Env (please complete the following information):

  • OS: MacOS Sonoma 14.3.1
  • Compile tools: (我不知道怎么查看实际上是什么工具编译的)
  • Any modifications to tools/env.sh: 没有修改

Describe your question
运行 bash ./run.sh之后

截图为:

image

输出内容为:

~/workspace/SimpleKernel
☺  bash ./run.sh                                                  main 4c86b9db
-- Found brew /opt/homebrew/bin/brew
-- Found riscv64-unknown-elf-gcc /opt/homebrew/bin/riscv64-unknown-elf-gcc.
-- Found qemu /opt/homebrew/bin/qemu-system-riscv64
-- Found brew /opt/homebrew/bin/brew
-- Found riscv64-unknown-elf-gcc /opt/homebrew/bin/riscv64-unknown-elf-gcc.
-- Found qemu /opt/homebrew/bin/qemu-system-riscv64
-- The CXX compiler identification is GNU 13.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /opt/homebrew/bin/riscv64-unknown-elf-gcc
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - no
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/homebrew/bin/riscv64-unknown-elf-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- SimpleKernelArch is riscv64
-- CMAKE_BUILD_TYPE is DEBUG
-- CMAKE_C_FLAGS is -march=rv64imafdc -Driscv64 -g -ggdb -O0 -ffreestanding -nostdlib -nostdinc -fexceptions -nostartfiles -fPIC  -no-pie -Wall -Wextra -MMD
-- CMAKE_CXX_FLAGS is -march=rv64imafdc -Driscv64 -g -ggdb -O0 -ffreestanding -nostdlib -nostdinc -fexceptions -nostartfiles -fPIC  -no-pie -Wall -Wextra -MMD
-- CMAKE_ASM_FLAGS is -march=rv64imafdc -Driscv64 -g -ggdb -O0 -ffreestanding -nostdlib -nostdinc -fexceptions -nostartfiles -fPIC  -no-pie -Wall -Wextra -MMD
-- TOOLCHAIN_PREFIX is riscv64-unknown-elf-
-- CMAKE_OBJCOPY is /opt/homebrew/bin/riscv64-unknown-elf-objcopy
-- found asm files: /Users/cmz/workspace/SimpleKernel/src/arch/riscv64/boot/boot.S
-- found asm files: /Users/cmz/workspace/SimpleKernel/src/arch/riscv64/intr/intr_s.S
-- The C compiler identification is GNU 13.2.0
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - no
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/homebrew/bin/riscv64-unknown-elf-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- found asm files: /Users/cmz/workspace/SimpleKernel/src/libcxx/src/__dso_handle.S
-- Configuring done (0.5s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/cmz/workspace/SimpleKernel/build_riscv64
[  3%] Building ASM object src/libcxx/CMakeFiles/libcxx.dir/src/__dso_handle.S.o
[  6%] Building CXX object src/libcxx/CMakeFiles/libcxx.dir/src/cxxabi.cpp.o
[  9%] Building CXX object src/libcxx/CMakeFiles/libcxx.dir/src/iostream.cpp.o
[ 12%] Building CXX object src/libcxx/CMakeFiles/libcxx.dir/src/new.cpp.o
[ 16%] Building CXX object src/libcxx/CMakeFiles/libcxx.dir/src/stack_chk.cpp.o
[ 16%] Built target libcxx
[ 19%] Building ASM object src/arch/riscv64/CMakeFiles/arch.dir/boot/boot.S.o
[ 22%] Building ASM object src/arch/riscv64/CMakeFiles/arch.dir/intr/intr_s.S.o
[ 25%] Building CXX object src/arch/riscv64/CMakeFiles/arch.dir/intr/clint.cpp.o
[ 29%] Building CXX object src/arch/riscv64/CMakeFiles/arch.dir/intr/intr.cpp.o
[ 32%] Building CXX object src/arch/riscv64/CMakeFiles/arch.dir/intr/page_fault.cpp.o
[ 35%] Building CXX object src/arch/riscv64/CMakeFiles/arch.dir/intr/plic.cpp.o
[ 38%] Building CXX object src/arch/riscv64/CMakeFiles/arch.dir/intr/timer.cpp.o
[ 38%] Built target arch
[ 41%] Building CXX object src/kernel/CMakeFiles/kernel.dir/allocator.cpp.o
[ 45%] Building CXX object src/kernel/CMakeFiles/kernel.dir/firstfit.cpp.o
[ 48%] Building CXX object src/kernel/CMakeFiles/kernel.dir/heap.cpp.o
[ 51%] Building CXX object src/kernel/CMakeFiles/kernel.dir/io.cpp.o
[ 54%] Building CXX object src/kernel/CMakeFiles/kernel.dir/kernel_main.cpp.o
[ 58%] Building CXX object src/kernel/CMakeFiles/kernel.dir/pmm.cpp.o
[ 61%] Building CXX object src/kernel/CMakeFiles/kernel.dir/slab.cpp.o
[ 64%] Building CXX object src/kernel/CMakeFiles/kernel.dir/test.cpp.o
[ 67%] Building CXX object src/kernel/CMakeFiles/kernel.dir/vmm.cpp.o
[ 67%] Built target kernel
[ 70%] Building CXX object src/drv/CMakeFiles/drv.dir/opensbi/opensbi.cpp.o
[ 74%] Building CXX object src/drv/CMakeFiles/drv.dir/sbi_console/sbi_console.cpp.o
[ 77%] Building CXX object src/drv/CMakeFiles/drv.dir/dtb/dtb.cpp.o
[ 77%] Built target drv
[ 80%] Building C object src/libc/CMakeFiles/libc.dir/src/stdio/vsprintf.c.o
[ 83%] Building C object src/libc/CMakeFiles/libc.dir/src/stdlib/atoi.c.o
[ 87%] Building C object src/libc/CMakeFiles/libc.dir/src/stdlib/itoa.c.o
[ 90%] Building C object src/libc/CMakeFiles/libc.dir/src/stdlib/strtol.c.o
[ 93%] Building C object src/libc/CMakeFiles/libc.dir/src/string/string.c.o
[ 96%] Building C object src/libc/CMakeFiles/libc.dir/src/math/math.c.o
[ 96%] Built target libc
[100%] Linking CXX executable ../bin/kernel.elf
/opt/homebrew/Cellar/riscv-gnu-toolchain/main/lib/gcc/riscv64-unknown-elf/13.2.0/../../../../riscv64-unknown-elf/bin/ld: warning: ../bin/kernel.elf has a LOAD segment with RWX permissions
Generating kernel debug...
Generating raw kernel...
nm...
readelf...
Disassembling...
[100%] Built target kernel.elf

OpenSBI v1.2
   ____                    _____ ____ _____
  / __ \                  / ____|  _ \_   _|
 | |  | |_ __   ___ _ __ | (___ | |_) || |
 | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
 | |__| | |_) |  __/ | | |____) | |_) || |_
  \____/| .__/ \___|_| |_|_____/|____/_____|
        | |
        |_|

Platform Name             : riscv-virtio,qemu
Platform Features         : medeleg
Platform HART Count       : 1
Platform IPI Device       : aclint-mswi
Platform Timer Device     : aclint-mtimer @ 10000000Hz
Platform Console Device   : uart8250
Platform HSM Device       : ---
Platform PMU Device       : ---
Platform Reboot Device    : sifive_test
Platform Shutdown Device  : sifive_test
Firmware Base             : 0x80000000
Firmware Size             : 200 KB
Runtime SBI Version       : 1.0

Domain0 Name              : root
Domain0 Boot HART         : 0
Domain0 HARTs             : 0*
Domain0 Region00          : 0x0000000002000000-0x000000000200ffff (I)
Domain0 Region01          : 0x0000000080000000-0x000000008003ffff ()
Domain0 Region02          : 0x0000000000000000-0xffffffffffffffff (R,W,X)
Domain0 Next Address      : 0x0000000080200000
Domain0 Next Arg1         : 0x0000000082200000
Domain0 Next Mode         : S-mode
Domain0 SysReset          : yes

Boot HART ID              : 0
Boot HART Domain          : root
Boot HART Priv Version    : v1.12
Boot HART Base ISA        : rv64imafdch
Boot HART ISA Extensions  : time,sstc
Boot HART PMP Count       : 16
Boot HART PMP Granularity : 4
Boot HART PMP Address Bits: 54
Boot HART MHPM Count      : 16
Boot HART MIDELEG         : 0x0000000000001666
Boot HART MEDELEG         : 0x0000000000f0b509
sbi console init.
BOOT_INFO init.
First Fit Allocator(kernel space): 0x0000000080200000(0x800 pages) init.
First Fit Allocator: 0x0000000080A00000(0x7800 pages) init.
BOOT_INFO reinit.
pmm init.
pmm test done.
paging enabled.
vmm init.
vmm test done.
SLAB Allocator Kernel: 0x0000000080200000(0x0000000800000000 bytes) init.
SLAB Allocator: 0x0000000080A00000(0x0000007800000000 bytes) init.
heap init.
heap test done.
clint init.
plic init.
intr init.
sepc: 0x000000008021D4BC, stval: 0x00000000C0000000, scause: 0x000000000000000D, all_regs(sp): 0x000000008020FD98, sie: 0x0000000000000202
sstatus: val: 0x8000000200006100, sie: disable, spie: disable, spp: S mode,
satp: val: 0x800000000008023E, ppn: 0x000000000008023E, asid: 0x0000000000000000, mode: SV39,
sscratch: 0x0000000000000000
pg_load_excp done: 0x00000000C0000000.
sepc: 0x000000008021D4F2, stval: 0x00000000C0000000, scause: 0x000000000000000F, all_regs(sp): 0x000000008020FD98, sie: 0x0000000000000202
sstatus: val: 0x8000000200006100, sie: disable, spie: disable, spp: S mode,
satp: val: 0x800000000008023E, ppn: 0x000000000008023E, asid: 0x0000000000000000, mode: SV39,
sscratch: 0x0000000000000000
pg_store_excp done: 0x00000000C0000000.
intr test done.
timer init.
sepc: 0x000000008021B138, stval: 0x0000000000000000, scause: 0x8000000000000005, all_regs(sp): 0x000000008020FD78, sie: 0x0000000000000222
sstatus: val: 0x8000000200006120, sie: disable, spie: enable, spp: S mode,
satp: val: 0x800000000008023E, ppn: 0x000000000008023E, asid: 0x0000000000000000, mode: SV39,
sscratch: 0x0000000000000000
Kernel start: 0x0000000080200000, end 0x000000008023BA00, size: 0x3BA00 bytes, 0x3C pages.
Kernel start4k: 0x0000000080200000, end4k: 0x000000008023C000.
Simple Kernel.
sepc: 0x000000008021B1D6, stval: 0x0000000000000000, scause: 0x8000000000000005, all_regs(sp): 0x000000008020FDB8, sie: 0x0000000000000222
sstatus: val: 0x8000000200006120, sie: disable, spie: enable, spp: S mode,
satp: val: 0x800000000008023E, ppn: 0x000000000008023E, asid: 0x0000000000000000, mode: SV39,
sscratch: 0x0000000000000000
sepc: 0x000000008021B1D6, stval: 0x0000000000000000, scause: 0x8000000000000005, all_regs(sp): 0x000000008020FDB8, sie: 0x0000000000000222
sstatus: val: 0x8000000200006120, sie: disable, spie: enable, spp: S mode,
satp: val: 0x800000000008023E, ppn: 0x000000000008023E, asid: 0x0000000000000000, mode: SV39,
sscratch: 0x0000000000000000
sepc: 0x000000008021B1D6, stval: 0x0000000000000000, scause: 0x8000000000000005, all_regs(sp): 0x000000008020FDB8, sie: 0x0000000000000222
sstatus: val: 0x8000000200006120, sie: disable, spie: enable, spp: S mode,
satp: val: 0x800000000008023E, ppn: 0x000000000008023E, asid: 0x0000000000000000, mode: SV39,
sscratch: 0x0000000000000000
sepc: 0x000000008021B1D6, stval: 0x0000000000000000, scause: 0x8000000000000005, all_regs(sp): 0x000000008020FDB8, sie: 0x0000000000000222
sstatus: val: 0x8000000200006120, sie: disable, spie: enable, spp: S mode,
satp: val: 0x800000000008023E, ppn: 0x000000000008023E, asid: 0x0000000000000000, mode: SV39,
sscratch: 0x0000000000000000
sepc: 0x000000008021B1D6, stval: 0x0000000000000000, scause: 0x8000000000000005, all_regs(sp): 0x000000008020FDB8, sie: 0x0000000000000222
sstatus: val: 0x8000000200006120, sie: disable, spie: enable, spp: S mode,
satp: val: 0x800000000008023E, ppn: 0x000000000008023E, asid: 0x0000000000000000, mode: SV39,
sscratch: 0x0000000000000000
sepc: 0x000000008021B1D6, stval: 0x0000000000000000, scause: 0x8000000000000005, all_regs(sp): 0x000000008020FDB8, sie: 0x0000000000000222
sstatus: val: 0x8000000200006120, sie: disable, spie: enable, spp: S mode,
satp: val: 0x800000000008023E, ppn: 0x000000000008023E, asid: 0x0000000000000000, mode: SV39,
sscratch: 0x0000000000000000
sepc: 0x000000008021B1D6, stval: 0x0000000000000000, scause: 0x8000000000000005, all_regs(sp): 0x000000008020FDB8, sie: 0x0000000000000222
sstatus: val: 0x8000000200006120, sie: disable, spie: enable, spp: S mode,
satp: val: 0x800000000008023E, ppn: 0x000000000008023E, asid: 0x0000000000000000, mode: SV39,
sscratch: 0x0000000000000000
sepc: 0x000000008021B1D6, stval: 0x0000000000000000, scause: 0x8000000000000005, all_regs(sp): 0x000000008020FDB8, sie: 0x0000000000000222
sstatus: val: 0x8000000200006120, sie: disable, spie: enable, spp: S mode,
satp: val: 0x800000000008023E, ppn: 0x000000000008023E, asid: 0x0000000000000000, mode: SV39,
sscratch: 0x0000000000000000
sepc: 0x000000008021B1D6, stval: 0x0000000000000000, scause: 0x8000000000000005, all_regs(sp): 0x000000008020FDB8, sie: 0x0000000000000222
sstatus: val: 0x8000000200006120, sie: disable, spie: enable, spp: S mode,
satp: val: 0x800000000008023E, ppn: 0x000000000008023E, asid: 0x0000000000000000, mode: SV39,
sscratch: 0x0000000000000000
sepc: 0x000000008021B1D6, stval: 0x0000000000000000, scause: 0x8000000000000005, all_regs(sp): 0x000000008020FDB8, sie: 0x0000000000000222
sstatus: val: 0x8000000200006120, sie: disable, spie: enable, spp: S mode,
satp: val: 0x800000000008023E, ppn: 0x000000000008023E, asid: 0x0000000000000000, mode: SV39,
sscratch: 0x0000000000000000
sepc: 0x000000008021B1D6, stval: 0x0000000000000000, scause: 0x8000000000000005, all_regs(sp): 0x00

这看起来和 README 里面的图片不太一样:

readme

代码格式

长期问题,保证代码风格的一致性

build error

  • I am in macOS Big Sur

CMake Error at cmake/toolchain_mac_x86_64.cmake:27 (message):
grub-file not found.

Use grub4mac.sh to install grub.
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.21.3_1/share/cmake/Modules/CMakeDetermineSystem.cmake:124 (include)
CMakeLists.txt:13 (project)

IDE

  1. clion 配置文件
  2. vscode 配置文件

使用回车、tab时会显示多余的白点

Describe the bug
使用回车、tab时会显示多余的白点

To Reproduce
Steps to reproduce the behavior:

  1. 运行kernel
  2. 在tty里使用回车或tab
  3. See error

Expected behavior
因该没有多余的东西出现

Screenshots
2019-01-11 3 58 10

Desktop (please complete the following information):

  • OS: MacOS 10.14.2
  • Compile tools: i386-elf-gcc i386-elf-ld
  • Emulator: e.g. Bochs 2.6.9
  • Branch: TODO

Error at printf

Code:

int a=233;
char c='!';
float f=3.14;
io.printf("Hello Kernel!");
io.printf("%d\t%f\t%c, end!", a, f, c);

Run:
2018-06-01 17 41 08

编译出错

我在虚拟机上跑的ubuntu-18.04.5-desktop-amd64的版本上,安装的是cmake version 3.10.2
我在编译的时候出现下图的错误:
image
能请问一下怎么解决吗?

换行操作有问题

	printk("Hello Kernel!\t");
	printk("Hello Kernel!\n");
	printk("Hello Kernel!");
	printk("Hello Kernel!\b");
	int a=2;
	printk("Hello Kernel! %d\t", a);

2018-06-03 20 08 55

第二行应当是在第一列显示,然而并不是

定义项目信息

在 cmake 中定义相关信息,生成头文件以供在内核中使用

对第三方依赖的支持/构建

自动下载并编译第三方依赖,自动生成相关 licence

预计要使用的第三方内容

第三方内容 描述 类型
CPM cmake 包管理 cmake module
CPMLicences.cmake 为第三方包生成 licence cmake module
google/googletest 测试
easylogingpp 日志
rttr c++ 反射库,在设备驱动部分用
Format.cmake 代码格式化,支持 clang-format 与 cmake-format cmake module
FreeImage 图片渲染
Freetype 字体渲染
opensbi riscv 引导
gnu-efi gnu uefi 引导
posix-uefi posix uefi 引导
ovmf qemu 使用的 uefi 固件 bin
edk2 构建 qemu 使用的 uefi 固件 ovmf

测试

内核测试比较麻烦,需要先设计出测试框架

指定输出目录

将第三方依赖、内核等编译生成的文件放到指定位置

运行不起来啊

setup.sh倒数第五行报错
cp: 无法创建普通文件'./boot_folder/boot/': 不是目录

Where is grub-file?

Describe the bug
Can not find a grub-file. I am using Fedora Core 29, could you please tell where I can get the file or which package am I missing?

To Reproduce
Steps to reproduce the behavior:

./run.sh
which: no grub-file in (/home/shawn/.local/bin:/home/shawn/bin:/home/shawn/.nvm/versions/node/v13.14.0/bin:/home/shawn/.local/bin:/home/shawn/bin:/usr/share/Modules/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/var/lib/snapd/snap/bin)
dirname: missing operand
Try 'dirname --help' for more information.

Expected behavior
Should find the grub-file.

idt initialization failed

If idt is initialized successfully, it should be like this
2018-06-21 09 43 40
but in fact, it is:
2018-06-21 09 43 29

Is there any errors?

x86_64 UEFI 支持

x86_64 平台下的 uefi 支持。
启动、ui、硬件信息处理。

Will this repo update on the base of Rust implementation one day in the future?

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
[Optional] A clear and concise description of what you want to happen.

Describe alternatives you've considered
[Optional] A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

调试

  1. gdbinit
  2. make debug
  3. qemu 脚本

MacOS x86_64-elf-ld reports link error

正在生成内核... drv/mouse/mouse.o
x86_64-elf-ld: drv/console/console.o:/Users/zivyou/workspace/SimpleKernel/src/include/mem/pmm.h:126: multiple definition of mem_page'; drv/clock/clock.o:/Users/zivyou/workspace/SimpleKernel/src/include/mem/pmm.h:126: first defined here x86_64-elf-ld: drv/console/console.o:/Users/zivyou/workspace/SimpleKernel/src/include/mem/pmm.h:124: multiple definition of mem_zone'; drv/clock/clock.o:/Users/zivyou/workspace/SimpleKernel/src/include/mem/pmm.h:124: first defined here
x86_64-elf-ld: drv/console/console.o:/Users/zivyou/workspace/SimpleKernel/src/include/multiboot2.h:352: multiple definition of `mmap_tag'; drv/clock/clock.o:/Users/zivyou/workspace/SimpleKernel/src/include/multiboot2.h:352: first defined here
......

OS: MacOS (Darwin 192.168.124.8 18.2.0 Darwin Kernel Version 18.2.0: Mon Nov 12 20:24:46 PST 2018; root:xnu-4903.231.4~2/RELEASE_X86_64 x86_64)
x86_64-elf-ld version:
x86_64-elf-ld --version
GNU ld (GNU Binutils) 2.35
Copyright (C) 2020 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.

It seems like a GNU ld bug reported in some version. More details: https://stackoverflow.com/questions/15822700/ld-resolve-multiple-definition-manually
This ld error can be fixed by simply adding "-z muldefs" command line parameter in config file Makefile.env. At least it works for me.

doxygen 文档生成

  1. 使用 doxygen 从注释生成文档
  2. doxygen 配置文件
  3. doxygen 在代码中的格式规范

跨平台支持

在不同的 host 上编译不同的 target,支持以下组合

host target gcc clang
x86_64-osx x86_64 x86_64_elf-gcc TEST
x86_64-osx aarch64 aarch64-unknown-linux-gnu-gcc TEST
x86_64-osx riscv64 riscv64-unknown-elf-gcc TEST
aarch64-osx x86_64 TODO TODO
aarch64-osx aarch64 TODO TODO
aarch64-osx riscv64 TODO TODO
x86_64-ubuntu x86_64 gcc TEST
x86_64-ubuntu aarch64 aarch64-linux-gnu-gcc TEST
x86_64-ubuntu riscv64 riscv64-linux-gnu-gcc TEST
aarch64-ubuntu x86_64 TODO TEST
aarch64-ubuntu aarch64 TODO TEST
aarch64-ubuntu riscv64 TODO TEST
riscv64-ubuntu x86_64 TODO TODO
riscv64-ubuntu aarch64 TODO TODO
riscv64-ubuntu riscv64 TODO TODO

host: 编译平台
target: 内核要运行的平台
gcc: 使用的 gcc 名称
clang: 使用的 clang 参数
TODO: 暂无测试条件
TEST: 需要进一步验证。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.