# lyos **Repository Path**: jimxue/lyos ## Basic Information - **Project Name**: lyos - **Description**: 微内核类Unix操作系统内核,支持x86/x86_64,arm64和RISC-V - **Primary Language**: C - **License**: GPL-3.0 - **Default Branch**: develop - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 68 - **Forks**: 12 - **Created**: 2015-03-29 - **Last Updated**: 2025-07-25 ## Categories & Tags **Categories**: os **Tags**: None ## README #+HTML:
Lyos is an open source microkernel multitasking operating system, it runs on 64-bit x86-based PCs. It is distributed under the GNU General Public License. ** Trying out Lyos To try out Lyos without building the whole system, you can download a xz-compressed [[https://lyos.jimx.codes/nightly/lyos-i686.img.xz][nightly image]], uncompress the image and run it with QEMU: #+BEGIN_SRC shell qemu-system-x86_64 -smp 2 -drive id=hda,file=lyos-i686.img,format=raw,if=none -device virtio-blk-pci,drive=hda -m 2048 -serial stdio -vga virtio -display sdl -cpu host,pmu=true --enable-kvm -netdev user,id=net0,hostfwd=tcp::5555-:22 -device virtio-net,netdev=net0 #+END_SRC ** Features Lyos has many standard features: - Microkernel + Kernel only handles message passing, interrupts and task scheduling, other things like reading/writing files, memory managing and device operations are handled by servers. + Servers are single executables(not modules) that are loaded by kernel at boot time, running in user privilege level and their own address space. - Multitasking + BFS scheduler - Symmetric multiprocessing - ELF loading - Interprocess Communication + Servers and user programs communicate using fixed length message(80 bytes) + Interrupts are converted into messages and sent to userspace servers + Unix signals - Virtual file system + Ext2 filesystem support + procfs, sysfs, ... - Userspace + Newlib + GCC, binutils, bash, ... + [[https://github.com/wayland-project/weston][Weston]] Wayland's reference compositor ** Building Lyos *** Preparation First we will clone the repository into the ~lyos~ directory: #+BEGIN_SRC shell git clone https://github.com/Jimx-/lyos.git cd lyos #+END_SRC Since Lyos requires various build-time dependencies, it is recommended to set up a Docker instance as the build environment to make sure the correct versions of these dependencies are installed: #+BEGIN_SRC shell docker build -t lyos_build . #+END_SRC After building the Docker image, start a container: #+BEGIN_SRC shell docker run -v $PWD:/workspace/lyos -it lyos_build #+END_SRC If everything is set up properly, you should see the bash prompt and a ~lyos~ directory under ~/workspace~ containing the source files in the repository: #+BEGIN_SRC shell root@2519c5bdfad9:/# ls /workspace lyos #+END_SRC Now you can switch to the ~/workspace/lyos~ directory and proceed to the Building section. #+BEGIN_SRC shell cd /workspace/lyos #+END_SRC Alternatively, you can install the dependencies manually if you prefer to build Lyos on the host system directly. The complete list of required dependencies is in ~Dockerfile~. You can install the dependencies with a standard package manager (e.g. ~apt~ on Ubuntu). *** Building Make sure that you are in the root directory of this repository (~/workspace/lyos~ if you are using a Docker container). First we need to create the build configuration file and install some userspace headers to the cross-compile system root: #+BEGIN_SRC shell make