Skip to content
forked from arighi/pastaos

PastaOS is a simple open-source kernel written from scratch for didactic purposes

License

Notifications You must be signed in to change notification settings

frenchguych/pastaos

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is PastaOS?
================

PastaOS is a simple open-source kernel written from scratch for didactic
purposes.

The main goal of this project is to help people that want to approach to kernel
development to understand the basic concepts of a kernel.

For this reason the code and functionalities are kept simple and minimal, so
that people can easily understand how the kernel works and use it to implement
their own project, as a kernel-dev sandbox.

How do I run it?
================

Build the kernel:
 $ make

Create a bootable ISO (requires grub-mkrescue, xorriso and mtools):
 $ make iso

Start the kernel in VM (requires the above packages + qemu-system-x86_64):
 $ make run

Design
======

These are the features implemented so far:
 - Intel x86 (32-bit) support

 - Multi-threading (the kernel implements a simple round-robin scheduler,
   preemption model is voluntary: threads need to voluntarily release the CPU
   to schedule the next thread; the kernel provide a simple stack-switch
   mechanism to perform a context switch between kernel threads)

 - Paging is enabled, but there's no memory allocator at the moment (first 4MB
   are identically mapped in the virtual address space and there's not memory
   protection: all the memory is shared among the kernel threads)

 - No user-space support yet, everything runs in kernel space as ring-0
   privileges

 - Simple 80x25 16-colors console driver

 - Interrupt management (PIC 8259), only the periodic clock interrupt is
   enabled for now

 - GRUB integration (kernel can be booted using GRUB)

Memory layout
=============

  .------------------------.    .------------------------.
  |     Virtual memory     |    |     Physical memory    |
  |0xc0000000 .. 0xc0100000| => |0x00000000 .. 0x00100000|
  `------------------------'    `------------------------'

Lower 4MB of physical memory is reserved to kernel and mapped into the virtual
address space starting at 0xc000.0000.

See linker.ld for more information about the memory layout.

About

PastaOS is a simple open-source kernel written from scratch for didactic purposes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 87.2%
  • Assembly 11.3%
  • Makefile 1.5%