Skip to content

rurumimic/operating-system-in-1000-lines

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Operating System in 1,000 Lines

Getting Started

Development Tools

bash, tar, clang, lld, llvm-objcopy, llvm-objdump, llvm-readelf, qemu-system-riscv32

Check RISC-V Target

clang -print-targets | grep riscv32

    riscv32     - 32-bit RISC-V

Ubuntu

sudo apt update && sudo apt install -y clang llvm lld qemu-system-riscv32 curl

OpenSBI:

curl -LO https://github.com/qemu/qemu/raw/v8.0.4/pc-bios/opensbi-riscv32-generic-fw_dynamic.bin

Arch Linux

sudo pacman -Syu --noconfirm clang llvm lld qemu-system-riscv curl

Ref

Writing an Operating System in 1,000 Lines

git clone https://github.com/nuta/operating-system-in-1000-lines
cd operating-system-in-1000-lines
├── disk/          - File system contents
│   ├── hello.txt
│   └── meow.txt
├── common.c       - Kernel/user common library: printf, memset, ...
├── common.h       - Kernel/user common library: definitions of structs and constants
├── kernel.c       - Kernel: process management, system calls, device drivers, file system
├── kernel.h       - Kernel: definitions of structs and constants
├── kernel.ld      - Kernel: linker script (memory layout definition)
├── shell.c        - Command-line shell
├── user.c         - User library: functions for system calls
├── user.h         - User library: definitions of structs and constants
├── user.ld        - User: linker script (memory layout definition)
└── run.sh         - Build script

Boot

CC=clang OBJCOPY=llvm-objcopy ./run.sh

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published