Skip to content
/ laylaos Public

A hobby OS with a custom kernel and userspace, with many ported software including musl libc, SDL2 and even Qt5!

License

Notifications You must be signed in to change notification settings

moisam/laylaos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

LaylaOS is a hobby operating system with a kernel that is written in C. The project started around 2015 and took almost 9 years to reach a stable point where I felt it could be shared with the world. It is meant as a learning tool to better understand the internal workings of an Operating System's kernel, how system calls work and how to implement a Graphical User Interface (GUI) environment.

It is definitely not a system meant for everyday use (not yet, at least).

Screenshots

LaylaOS screenshot More screenshots

Features

The project's features include:

  • 64 bit monolithic multitasking pre-emptive kernel written in C (the 32 bit code is included here but is not fully functional)
  • Network stack (based on PicoTCP)
  • ATA/ATAPI and AHCI support
  • Basic Intel HDA sound support
  • PS2 keyboard and mouse
  • Virtual consoles
  • Virtual Dynamic Shared Object (vdso)
  • Interprocess Communication (IPC) facilities in the form of shared memory, semaphores and message queues
  • Page cache for demand loading of pages
  • ACPI support via ACPICA
  • C library (currently using musl)
  • Ports of 3rd party software (GNU coreutiles, inetutils, bash, several image and audio/video decoding libraries, etc.)
  • Graphical desktop with many (mostly demonstrative) applications
  • SDL2
  • Qt5.12
  • OpenTTD
  • A fork of SDL2 DOOM

TODO list

This is mostly to keep track of where we are at and what needs to be done next:

  • More syscalls including POSIX message queues syscalls
  • More GUI functionality (text editor, screenshot facility, paint program, desktop themes, archiver, web browser, etc.)
  • VFAT, ext3, ext4, NFS filesystem support (maybe NTFS at some point)
  • Kernel logging and perhaps a syslogd server
  • Swap support
  • USB support
  • Symmetric Multiprocessing (SMP)

Prebuilt packages

You can download a prebuilt bootable disk image that includes everything (including the ported software) from the releases page. Be mindful, however, that the unzipped disk image is likely to be big (3+ GiB in size). You can use this image to run LaylaOS under Bochs or QEmu.

If you want to try LaylaOS under Oracle VM VirtualBox, you will need to convert the bootable disk image into a VDI image. This can be done by running: VBoxManage convertfromraw bootable_disk.img bootable_disk.vdi

You can then create a new virtual machine under VirtualBox using the disk image. You will probably face a problem as the image contains two files (/boot/grub/grub.cfg and /etc/fstab) with a hardcoded boot device name (something like /dev/hda4). To be able to use this disk as a SATA (or AHCI) disk under VirtualBox you need to either:

  • Edit these two files in the disk image you downloaded and change the device name to /dev/sda4 (assuming you connect the disk at SATA port 0; the image contains 4 partitions)
  • Build LaylaOS from source and create the bootable disk image using: ./create_bootable_disk.sh rootdev sda4

See below if you decided to build LaylaOS from source.

How to build

To build LaylaOS from source:

  1. Download this repository and unzip the zip file
  2. Change directory to the unzipped source directory, e.g. cd ~/downloads/laylaos-master
  3. Change directory to the build-scripts subdirectory in the source tree: cd build-scripts
  4. To run the build (this has to be done from the build-scripts directory): ./buildos.sh
  5. Go grab a coffee or better yet, have some lunch. It takes a little over 3 hours to build the whole project!
  6. Oh, and you need internet connection to download the sources of ported software!
  7. When the build is done, create a bootable harddisk image by running: ./create_bootable_disk.sh
  8. The bootable disk image is named bootable_disk.img and is created by default in the current working directory (you can run ./create_bootable_disk.sh help to see the list of options)
  9. A bochsrc file is automatically created alongside bootable_disk.img (you might want to fix the name of the wireless device you use in the file). You can now run Bochs: bochs -q
  10. Another script called qemu.sh is also created to let you test the OS under QEmu. However, you need a TUN/TAP network device to run LaylaOS under QEmu using the provided script. You need to first run sudo ./netprep.sh to create the network device, then you can proceed with running qemu.sh

Licenses

  • LaylaOS is released under GPL v3.
  • PicoTCP (upon which our network stack is built) is released under GPL v2 or v3.
  • ACPICA is released under a dual Intel and Unix-compatible licenses.
  • Timidity files (needed for sound in DOOM) are in the public domain (see their copyright.txt file).
  • The monospace font used in the system console and the GUI terminal is Dina font, which is released under a free license.
  • libaelf32.a and libaelf64.a are part of asmlib, the software optimisation library by Agner Fog, which is released under GPL.
  • All other ported software come with their respective licenses.