25 Star 55 Fork 10

JinXue / lyos

加入 Gitee
与超过 800 万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README.org

Lyos

screenshot

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 nightly image, uncompress the image and run it with QEMU:

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 -sdl -cpu host,pmu=true --enable-kvm

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, …
    • Weston Wayland’s reference compositor

Building Lyos

Preparation

First we will clone the repository into the lyos directory:

git clone https://github.com/Jimx-/lyos.git
cd lyos

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:

docker build -t lyos_build .

After building the Docker image, start a container:

docker run -v $PWD:/workspace/lyos -it lyos_build

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:

root@2519c5bdfad9:/# ls /workspace
lyos

Now you can switch to the /workspace/lyos directory and proceed to the Building section.

cd /workspace/lyos

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:

make <SUBARCH=x86_64> defconfig objdirs install-headers

The optional SUBARCH environment variable specifies which architecture to build Lyos for. Currently only x86_64, i686 and riscv64 are supported. If not specified, Lyos will be built for the architecture of the host system.

Set up the toolchain and userspace packages for building Lyos:

cd toolchain
./download.sh
BUILD_EVERYTHING=true ./setup.sh <-m x86_64>
cd ..

Similar to SUBARCH, the -m option of setup.sh specifies the architecture to build the toolchain and packages for.

Now build the kernel and servers:

make SUBARCH=x86_64

(Optionally) setup.sh only builds some core userspace packages like bash and coreutils. You still need to build some extra packages if you want to use graphical interface:

cd toolchain
BUILD_EVERYTHING=true ./setup-extra.sh -m x86_64
BUILD_EVERYTHING=true ./setup-x11.sh -m x86_64
cd ..

Creating Disk Image

Now you can create the disk image for Lyos:

sudo ./scripts/setup-disk.sh

This will create a disk image lyos-disk.img under the current directory which can be launched with QEMU.

仓库评论 ( 3 )

你可以在登录后,发表评论

简介

微内核类Unix操作系统内核,支持x86/x86_64,arm64和RISC-V 展开 收起
GPL-3.0
取消

发行版

暂无发行版

lyos

贡献者

全部

近期动态

加载更多
不能加载更多了
C
1
https://gitee.com/jimxue/lyos.git
git@gitee.com:jimxue/lyos.git
jimxue
lyos
lyos
develop

搜索帮助

103111 552b83b3 1850385 103110 ed87a847 1850385