GithubHelp home page GithubHelp logo

managarm / bootstrap-managarm Goto Github PK

View Code? Open in Web Editor NEW
32.0 32.0 20.0 3.25 MB

Patches and build scripts to build a managarm distribution

License: MIT License

Shell 10.66% C 0.15% Dockerfile 7.35% CMake 0.04% Python 81.80%
hacktoberfest

bootstrap-managarm's Introduction

The managarm Operating System

CI Documentation

Screenshot

What is this about?

This is the main repository of managarm, a microkernel-based operating system.

What is special about managarm? Some notable properties of managarm are: (i) managarm is based on a microkernel while common Desktop operating systems like Linux and Windows use monolithic kernels, (ii) managarm uses a completely asynchronous API for I/O and (iii) despite those internal differences, managarm provides good compatibility with Linux at the user space level.

Aren't microkernels slow? Microkernels do have some performance disadvantages over monolithic kernels. managarm tries to mitigate some of those issues by providing good abstractions (at the driver and system call levels) that allow efficient implementations of common user space functionality (like POSIX).

Is this a Linux distribution? No, managarm runs its own kernel that does not originate from Linux. While the managarm user space API supports many Linux APIs (e.g. epoll, timerfd, signalfd or tmpfs), managarm does not share any source code (or binaries) with the Linux kernel.

Official Discord server: https://discord.gg/7WB6Ur3. This is our primary real-time communication channel.

Official IRC channel: #managarm on irc.libera.chat, with many more available! Type /msg alis list managarm to find them.

Features

  • 64-bit operating system with SMP (i.e., multicore) and ACPI support.
  • Fully asynchronous microkernel and servers.
  • Support for many modern hardware devices such as USB 3 controllers.
  • Networking support.
  • POSIX and Linux API compatibility.
  • Support for Linux-style special files (epoll, signalfd, ...) and pseudo file systems (/sys, /proc, ...).

Trying out managarm

If you want to try out managarm without building the whole OS, you can download a xz-compressed nightly image; these images are automatically compiled on our build server and reflect the current state of Managarm development. To run the (uncompressed) image using qemu, we recommend the following flags:

qemu-system-x86_64 -enable-kvm -m 2048 -cpu host,migratable=off -device qemu-xhci -device usb-kbd -device usb-tablet -drive id=hdd,file=image,format=raw,if=none -device virtio-blk-pci,drive=hdd -vga vmware -debugcon stdio

Supported Software

Programs supported on managarm include Weston (the Wayland reference compositor), kmscon (a system console), GNU Coreutils, Bash, nano and others.

Supported Hardware

General USB (UHCI, EHCI)
Graphics Generic VBE graphics, Intel G45, virtio GPU, Bochs VBE interface, VMWare SVGA
Input USB human interface devices, PS/2 keyboard and mouse
Storage USB mass storage devices, NVMe, AHCI, ATA, virtio block

Building managarm

While this repository contains managarm's kernel, its drivers and other core functionality, it is not enough to build a full managarm distribution. Instead, we refer to the Managarm Handbook for build instructions.

bootstrap-managarm's People

Contributors

48cf avatar 64 avatar apache-hb avatar arsenarsen avatar avdgrinten avatar d-tatianin avatar dchapiesky avatar dennisbonke avatar electrodeyt avatar mintsuki avatar no92 avatar positrontheory avatar qookei avatar qwinci avatar thomtl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bootstrap-managarm's Issues

SDL2 issues

Games that use SDL2 currently don't work.

With SDL_VIDEODRIVER=wayland, EGL apparently fails to initialize, and as such tyr-quake fails to open a window. dsda-doom doesn't complain about anything but also does not open a window (but appears to otherwise function).

With SDL_VIDEODRIVER=x11, Weston crashes inside of it's xwayland.so library when a window is being opened (but other X11 programs work, like the GTK2 demo).

qemu: host qemu 9.0.0 breaks e9 logging

When not using the host-qemu tool (aka. running host QEMU), at least on Arch, the following warnings also appear:

(venv) [alexander@alex-computer build]$ xbstrap run qemu
xbstrap: Running the following plan:
    run            qemu
xbstrap: run qemu [1/1]
xbstrap: Running ['@SOURCE_ROOT@/scripts/vm-util.py', 'qemu', '--arch', '@OPTION:arch@'] (tools: [])
qemu-system-x86_64: warning: hub port hub0port0 has no peer
qemu-system-x86_64: warning: netdev net0 has no peer
qemu-system-x86_64: warning: netdev hub0port0 has no peer
qemu-system-x86_64: warning: requested NIC (#net033, model ?) was not created (not supported by this machine?)
QEMU does not support virtio-net-pci NICs

E9 debug output is also broken. When using the host-qemu tool (aka qemu 8.1.4), everything works fine.

ports: xbps configuration is not tailored to managarm

To my knowledge, xbps will install a default configuration with the repo pointing at the void linux package repo. This won't work for us, so we should either override this during the build or install our own configuration file with the correct repo url specified.

Work on getting proper GLX support

With the recent additions of several xorg libraries, effort can be made into building libGL.so from mesa and enabling proper OpenGL support in managarm. While locally, mesa builds libGL.so fine with few modifications, at runtime concerns have arisen that (a part of) the xorg server is needed. While we (currently) do not intend on porting the complete xorg stack, porting xwayland and supporting programs should allow libGL.so to be useful.

For this to be possible, the following (incomplete) list of programs need to be ported and/or upgraded:

  • xorg-server, for now xwayland is good enough. There are still some runtime issues for xorg-server to run and for clients to be able to work
  • libdrm upgrade to at least 2.4.89
  • libxfont2, direct dependency of xorg-server
  • libfontenc, dependency of libxfont2
  • font-util, both as a host-tool and on managarm, build-time and possible run-time dependencies of several packages in this list
  • libxkbfile, direct dependency of xorg-server
  • xkbcomp, dependency of xorg-server
  • a nice demo, preferably glxgears (will be implemented in #48)

This issue serves as a categorizing and tracking issue, making it easier to label pull requests as being part of porting xwayland

Missing ports for partial self-hosting

For managarm to be partially self hosting, meaning that we can compile managarm-kernel and managarm-system on managarm with the sources patched and available from the host, so that we only need to configure and build them, the following packages are needed (possible incomplete list):

  • meson, managarm's primary build system is meson.
  • ninja, managarm's primary builder is ninja.
  • xbstrap, managarm's master build system is executed by xbstrap, this needs some additional python modules as well.
  • pyyaml, xbstrap depends on pyyaml.
  • colorama, xbstrap depends on colorama.
  • jsonschema, xbstrap depends on this python module.
  • attrs, xbstrap depends on this python module.
  • pyrsistent, xbstrap depends on this python module.
  • llvm + clang, while we do build llvm, we do not build clang, the kernel is compiled with clang, and as such, this is needed.
  • setuptools, required dependency for pip.
  • pip, in order to be able to install python packages without much trouble, pip is required. Porting pip and setuptools, and having the proper networking support to back it up, can remove the requiremenst on pyyaml, colorama and xbstrap, as we can pull them from pip directly in that case.

Furthermore, the following ports require extra attention:

  • binutils, currently works, but when called from a makefile as crashes
  • gcc, gcc works, but invoking g++ fails, furthermore, calling gcc as cc (a symlink mandated by the FHS, and used for compatibility reasons in many build systems), crashes in mlibc (see issue managarm/mlibc#93) (This has been fixed in the meantime)
  • python, more modules need to be available, and several python packages need to be ported
  • pkg-config, fails when running, complains about ungetc()

fedora docker build fails

I have tried the docker build on Fedora31 (5.8.13-100.fc31.x86_64, gcc 9.3.1) with a small modification to the docker incantation: append :Z to -v and add -u root:root to share managarm dir.

xbstrap fails with configuring vim (wide char issue)

checking size of wchar_t is 2 bytes... configure: error: failed to compile test program
xbstrap: Action configure of package vim failed

and xbstrap install --all --keep-going ends with

xbstrap: Skipping action configure of base-devel due to failed prerequisites [264/266]
xbstrap: Skipping action build of base-devel due to failed prerequisites [265/266]
xbstrap: Skipping action install of base-devel due to failed prerequisites [266/266]
xbstrap: The following steps failed:
    configure      coreutils
    build          coreutils (prerequisites failed)
    install        coreutils (prerequisites failed)
    configure      vim
    build          vim (prerequisites failed)
    install        vim (prerequisites failed)
    configure      base (prerequisites failed)
    build          base (prerequisites failed)
    install        base (prerequisites failed)
    configure      base-devel (prerequisites failed)
    build          base-devel (prerequisites failed)
    install        base-devel (prerequisites failed)
xbstrap: Plan failed

I have never used xbstrap before and I'd appreciate some pointer. Thanks!

xorg-server: Missing access control support

Currently, the X server (specifically Xwayland) fails to authenticate hosts, including localhost, when access control is enabled. For now, we can work around this problem by disabling access control but this is not the desired way forward. Initial local testing seems to indicate that there may be some hostname related issues that are stopping X from authenticating us

Add versioning of packages and automated incremental builds

As discussed on Discord, we need to add versions to packages. This will also simplify incremental builds on the build server (since we only need to compare version to take the diff of two versions of bootstrap.yml).

  • For packages that build from tags, we should manually set their version.
  • For packages that we build from active branches (e.g., managarm and mlibc), we can count the number of commits (git rev-list --count). For development builds, we probably want to increment this number by one and add a pre suffix such that development builds are always newer than release builds.

Roadmap for versions and incremental builds:

  • Add a version property to xbstrap and propagate that properly to xbps-create. This enables versioning.
  • Let the build server fix the Git SHA1 hashes of all packages that build from branches (via some "version lock" file, or bootstrap-site.yml).
  • Add the ability to diff two bootstrap.yml files (+ their corresponding version lock files) to xbstrap.
  • Add the ability to build a plan that takes such diffs into account to xbstrap. This enables incremental builds.

Missing ports for full self-hosting

For managarm to become fully self-hosting, the following ports are missing (incomplete list)

  • autoconf, blocked on a working perl port
  • automake, blocked on a working perl port
  • libtool
  • m4
  • patch, ported, seems to work
  • git, blocked on networking and /dev/null support
  • mercurial, blocked on networking and more python support
  • cmake
  • wget, ported, seems to work decently, blocked on further tcp changes for now
  • curl, ported, but needs more work
  • grub, to produce an image
  • subversion. as preliminary support for subversion is pending in xbstrap, and pcre will move to an subversion repo, this tool is needed to allow xbstrap to build pcre
  • bison, many build systems invoke bison at some point
  • flex, as said with bison, flex is used in some build systems
  • texinfo, if we want to be able to produce documentation, texinfo is a must. This is blocked on a working perl port
  • rsync, to copy the contents of the sysroot to the image, rsync is used
  • cpio, the initrd that managarm uses is compressed with cpio

Furthermore, the following ports need attention before self-hosting can be achieved (incomplete list)

  • make, needs extensive testing
  • perl, segfaults when running, a fix is in development for this (this has been fixed by disabling locale suppport. Now perl is awaiting managarm/mlibc#101 and managarm/mlibc#102). Basic Perl programs can now run.
  • ncurses, this really needs to produce shared libraries
  • bzip2, crashes due to missing utime() (this has been fixed in current mlibc master, just awaiting a small build fix)
  • xz-utils, crashes due to missing printf() specifier
  • gettext, if we ever want to handle localized messages in applications, gettext at build time is a must, furthermore, support for this in mlibc needs to be added. A basic port is available, but untested and unused at this time

For proper self-hosting, we also need some extra support in managarm itself (incomplete list)

  • Support for loopback devices, the current image generation process either uses libguestfs or loopback devices, the latter should be easier to implement then libguestfs

This list is an addition upon #39 and #30

Intermittent failure of `update_image.py` with Docker mount: cannot create regular file `/mnt/boot/efi`

Sometimes when running xbstrap run make-image using Docker I get the following error:

$ xbstrap run make-image qemu
xbstrap: Running the following plan:
    run            update-initrd
    run            make-image
    run            qemu
xbstrap: run update-initrd [1/3]
xbstrap: Running ['@SOURCE_ROOT@/managarm/tools/gen-initrd.py', '--triple', '@OPTION:arch-triple@'] (tools: ['cross-binutils']) in Docker
xbstrap: run make-image [2/3]
xbstrap: Running ['@SOURCE_ROOT@/scripts/update-image.py', '--triple', '@OPTION:arch-triple@', '--mount-using', '@OPTION:mount-using@'] (tools: [])
update-image: Running the following plan:
 - mount
 - update file system
 - unmount
update-image: Running action mount ("image" to "mountpoint" using docker)
update-image: Running action update file system (from "system-root" to "mountpoint")
update-image: Updating the image doesn't require root
update-image: Update target has an EFI directory
update-image: Updating the file system...
+ mkdir -p /mnt/boot/managarm
+ install system-root/usr/managarm/bin/eir-stivale /mnt/boot/managarm
+ install -s --strip-program=tools/cross-binutils/bin/x86_64-managarm-strip system-root/usr/managarm/bin/eir-mb1 /mnt/boot/managarm
+ install -s --strip-program=tools/cross-binutils/bin/x86_64-managarm-strip system-root/usr/managarm/bin/thor /mnt/boot/managarm
+ install initrd.cpio /mnt/boot/managarm
+ mkdir -p /mnt/root
+ mkdir -p /mnt/usr/bin
+ mkdir -p /mnt/usr/lib
+ mkdir -p /mnt/var
+ mkdir -p /mnt/dev
+ mkdir -p /mnt/proc
+ mkdir -p /mnt/run
+ mkdir -p /mnt/sys
+ mkdir -p /mnt/tmp
+ mkdir -p /mnt/boot/grub
+ mkdir -p /mnt/home
+ cp /stuff/scripts/grub.cfg /mnt/boot/grub
+ cp /stuff/scripts/limine.cfg /mnt/boot/limine.cfg
+ sed -i 's|@ROOT_UUID@|4C722EAE-4DE0-1E4C-A5E6-8C5E0D62ED3E|g' /mnt/boot/limine.cfg
+ cp /stuff/scripts/limine.cfg /mnt/boot/efi/
cp: cannot create regular file '/mnt/boot/efi/': Not a directory
update-image: Action update file system failed with: ('Command "docker ..." failed with code 1',)
update-image: Running action unmount ("/mnt inside of container" using docker)
update-image: Finished running plan.
update-image: 1 step(s) failed.
xbstrap: Action run of task make-image failed

This appears to happen fairly consistently after a reboot, and goes away after re-building the image from scratch (with image_create.sh).

Problem with compile

Hello
I have problem with compile with xbstrap
make[1]: Wejście do katalogu '/home/japiotr123/hdd/managarm/build/tool-builds/system-gcc/isl' CDPATH="${ZSH_VERSION+.}:" && cd /home/japiotr123/hdd/managarm/build/../src/ports/gcc/isl && /bin/sh /home/japiotr123/hdd/managarm/src/ports/gcc/isl/missing aclocal-1.15 -I m4 /home/japiotr123/hdd/managarm/src/ports/gcc/isl/missing: 81: /home/japiotr123/hdd/managarm/src/ports/gcc/isl/missing: aclocal-1.15: not found WARNING: 'aclocal-1.15' is missing on your system. You should only need it if you modified 'acinclude.m4' or 'configure.ac' or m4 files included by 'configure.ac'. The 'aclocal' program is part of the GNU Automake package: <http://www.gnu.org/software/automake> It also requires GNU Autoconf, GNU m4 and Perl in order to run: <http://www.gnu.org/software/autoconf> <http://www.gnu.org/software/m4/> <http://www.perl.org/> make[1]: *** [Makefile:1202: /home/japiotr123/hdd/managarm/build/../src/ports/gcc/isl/aclocal.m4] Błąd 127 make[1]: Opuszczenie katalogu '/home/japiotr123/hdd/managarm/build/tool-builds/system-gcc/isl' make: *** [Makefile:6166: all-isl] Błąd 2 xbstrap: Action compile-tool of tool stage ('system-gcc', 'compiler') failed

I would be grateful for help

lua: Install to /usr

Currently, lua is installed to the root directory (i.e., /bin). Like other general purpose programs, it should be in /usr/bin instead. @krkk could you look into that?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.