/laos

linux 内核

Primary LanguageC

laos

  • Boot from scratch, without GRUB - [✔]
  • Enter 32-bit mode - [✔]
  • Jump from Assembly to C - [✔]
  • Interrupt handling - [✔]
  • Screen output and keyboard input - [✔]
  • A tiny, basic libc which grows to suit our needs - [✔]
  • Memory management
  • Write a filesystem to store files
  • Create a very simple shell
  • User mode
  • Maybe we will write a simple text editor
  • Multiple processes and scheduling
  • A BASIC interpreter, like in the 70s!
  • A GUI
  • Networking

Mem management

  1. Higher half loader [✔]
  2. physical memory management []
  3. paging(virtual memory management) []
  4. kmalloc []

Filesystem

  1. PCI Enumerate,R/W []
  2. ATA/DMA Driver []
  3. Ext2 Filesystem []
  4. Virtual Filesystem []

Graphical Interface

  1. vesa driver, 1024 * 768 color(32-bit color),framebuffer mode []
  2. Milestone(try loading and showing a wallpaper from hardisk!) []
  3. Windows compositor, support fonts, buttons,and etc []
  4. Write a shell []
  5. Write a file browser []

Miscellaneous

  1. Usermode []
  2. Multi-tasking/Simple scheduler []
  3. Executable loader(elf) []
  4. spinlock, mutex, and other pthread primitives []
  5. Add more syscalls, like fork/exec, open, read, etc.. []
  6. Port newlib []
  7. Write or port some baisc utilities such asenv, rm, cp, mkdir, reboot []
  8. Real time clock []
  9. stadard input/output stuff []

Network protocols

  1. Send/Recv raw packets []
  2. IP []
  3. UDP []
  4. ARP []
  5. DHCP []
  6. TCP []
  7. HTTP []
如何运行
gcc -ffreestanding -c kernel.c -o kernel.o
ld -o kernel.bin -Ttext 0x1000 kernel.o --oformat binary
nasm boot_sect.asm -f bin -o boot_sect.bin
cat boot_sect.bin kernel.bin > os-image.bin
qemu-system-i386 -fda os-image.bin

或者
make clean
make run