Skip to content

alisterd51/gratOS

Repository files navigation

gratOS

Nightly Release

Presentation

Kernel from scratch written in rust

Run

From source

git clone https://github.com/alisterd51/gratOS.git
cd gratOS
make run

From nightly release

wget https://github.com/alisterd51/gratOS/releases/download/nightly/gratos.x86.iso
qemu-system-x86_64 -cdrom gratos.x86.iso

TODO

  • KFS-1 (gratOS:0.1.0):
    • Mandatory:
      • Install GRUB on an virtual image
      • Write an ASM boot code that handles multiboot header, and use GRUB to init and call main function of the kernel itself
      • Write basic kernel code of the choosen language.
      • Compile it with correct flags, and link it to make it bootable.
      • Once all of those steps above are done, you can write some helpers like kernel types or basic functions (strlen, strcmp, ...)
        • string.h
          • memcpy
          • memmove
          • memset
          • memcmp
      • Your work must not exceed 10 MB.
      • Code the interface between your kernel and the screen.
        • vga text_mode driver
      • Display "42" on the screen.
        • clean screen
        • print "42"
      • Makefile: Your makefile must compile all your source files with the right flags and the right compiler. Keep in mind that your kernel will use at least two different languages (ASM and whatever-you-choose), so make (<- joke) your Makefile’s rules correctly
    • Bonus:
      • Add scroll and cursor support to your I/O interface.
        • scroll
        • cursor
        • history
        • interprete escape sequences such as CSI n A
        • add consts such as: CURSOR_UP = "\x1B[A"
      • Add colors support to your I/O interface.
        • interpret color escape sequences such as CSI n m
        • add consts such as: FG_RED = "\x1b[31m"
        • add default color
        • add tests in debug mode
      • Add helpers like printf / printk in order to print information / debug easily
        • print!
        • println!
      • Handle keyboard entries and print them.
      • Handle different screens, and keyboard shortcuts to switch easily between then.
  • KFS-2 (gratOS:0.2.0):
    • Mandatory:
      • create a Global Descriptor Table
      • Your GDT must contain:
        • Kernel Code
        • Kernel Data
        • Kernel stack
        • User code
        • User data
        • User stack
      • Your work must not exceed 10 MB.
      • You must declare your GDT to the BIOS.
      • The GDT must be set at address 0x00000800.
      • When this is done, you have to code a tool to print the kernel stack, in a human-friendly way. (Tip: If you haven’t made a printk yet, now is a good time !)
    • Bonus:
      • Assuming your keyboard work correctly in your Kernel, and you able to catch an entry, let’s code a Shell ! Not a POSIX Shell, just a minimalistic shell with a few commands, for debugging purposes.
      • For example, you could implement the print-kernel-stack-thing in this shell, and some other things like reboot, halt and such.
        • hello
        • print-kernel-stack-thing
        • reboot
        • halt
  • Other:
    • add CI to build and serve an iso of gratOS