You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
James Zow 52b7ac9b2f
fix ci/cd error (#195)
* fix ci/cd error

* update copyright year

* Modify remaining years

* solve ci report settings.json code style

* update .prettierrc.json

* prettierrc fix code style

* fix rb file i.to_s and code style

* fix error Line is too long. [101/100]

* Modify the Ruby file format and restore other file formats

* update makefile and readme file space
7 months ago
..
.vscode fix ci/cd error (#195) 7 months ago
src fix ci/cd error (#195) 7 months ago
Cargo.lock Give the project a name 3 years ago
Cargo.toml fix ci/cd error (#195) 7 months ago
Makefile fix ci/cd error (#195) 7 months ago
README.CN.md More link.ld -> kernel.ld renaming 2 years ago
README.ES.md More link.ld -> kernel.ld renaming 2 years ago
README.md Updated to reflect rename of link.ld to kernel.ld 2 years ago
build.rs Linker: Use absolute library path 2 years ago

README.md

Tutorial 01 - Wait Forever

tl;dr

  • The project skeleton is set up.
  • A small piece of assembly code runs that just halts all CPU cores executing the kernel code.

Building

  • Makefile targets:
    • doc: Generate documentation.
    • qemu: Run the kernel in QEMU
    • clippy
    • clean
    • readelf: Inspect the ELF output.
    • objdump: Inspect the assembly.
    • nm: Inspect the symbols.

Code to look at

  • BSP-specific kernel.ld linker script.
    • Load address at 0x8_0000
    • Only .text section.
  • main.rs: Important inner attributes:
    • #![no_std], #![no_main]
  • boot.s: Assembly _start() function that executes wfe (Wait For Event), halting all cores that are executing _start().
  • We (have to) define a #[panic_handler] function to make the compiler happy.
    • Make it unimplemented!() because it will be stripped out since it is not used.

Test it

In the project folder, invoke QEMU and observe the CPU core spinning on wfe:

$ make qemu
[...]
IN:
0x00080000:  d503205f  wfe
0x00080004:  17ffffff  b        #0x80000