├── land ├── base │ ├── etc │ │ ├── group │ │ ├── hostname │ │ ├── passwd │ │ ├── init.d │ │ │ ├── gfxcompd │ │ │ └── console-login │ │ ├── shells │ │ ├── motd │ │ ├── profile │ │ └── inputrc │ └── PKGBUILD ├── gfxcompd │ ├── src │ │ ├── bg.png │ │ ├── cursor.png │ │ ├── bar.h │ │ ├── bus.h │ │ ├── view-app-grid-symbolic.png │ │ ├── text.h │ │ ├── mouse.h │ │ ├── util.h │ │ ├── main.c │ │ ├── window.h │ │ ├── text.c │ │ ├── Makefile │ │ ├── libxelixgfx.h │ │ └── render.h │ └── PKGBUILD ├── newlib │ └── xelix │ │ ├── crtn.s │ │ ├── sys │ │ ├── fcntl.h │ │ ├── ioctl.h │ │ ├── utime.h │ │ ├── un.h │ │ ├── dirent.h │ │ ├── resource.h │ │ ├── utsname.h │ │ ├── uio.h │ │ ├── wait.h │ │ ├── limits.h │ │ └── mman.h │ │ ├── crti.s │ │ ├── include │ │ ├── endian.h │ │ ├── dlfcn.h │ │ ├── err.h │ │ ├── netinet │ │ │ └── tcp.h │ │ ├── net │ │ │ └── if.h │ │ ├── pty.h │ │ ├── arpa │ │ │ └── inet.h │ │ └── sgtty.h │ │ ├── configure.in │ │ ├── bits │ │ └── wordsize.h │ │ ├── xelix.c │ │ └── crt0.c ├── binutils │ ├── elf_i386_xelix.sh │ ├── elf_x86_64_xelix.sh │ └── PKGBUILD ├── nano │ ├── nanorc │ ├── nano-4.2.patch │ └── PKGBUILD ├── xelix-utils │ ├── src │ │ ├── .gitignore │ │ ├── basictest.asm │ │ ├── xelix-loader.ld │ │ ├── xelix-loader-i386.asm │ │ └── util.h │ └── PKGBUILD ├── htop │ ├── xelix │ │ ├── ProcessField.h │ │ ├── XelixProcessList.h │ │ └── XelixProcess.h │ └── PKGBUILD ├── ca-certs │ └── PKGBUILD ├── font-fira │ └── PKGBUILD ├── tzdb │ ├── tz.patch │ └── PKGBUILD ├── font-fira-code │ └── PKGBUILD ├── font-roboto │ └── PKGBUILD ├── font-dejavu │ └── PKGBUILD ├── fontconfig │ ├── fontconfig.patch │ └── PKGBUILD ├── openssl-quic │ ├── 50-xelix.conf │ └── PKGBUILD ├── gmp │ ├── gmp-6.2.0.patch │ └── PKGBUILD ├── libpng │ ├── libpng.patch │ └── PKGBUILD ├── bzip2 │ └── PKGBUILD ├── mpfr │ ├── mpfr-4.1.0.patch │ └── PKGBUILD ├── zlib │ └── PKGBUILD ├── bash │ ├── bash-5.0.patch │ └── PKGBUILD ├── cairo │ ├── cairo.patch │ └── PKGBUILD ├── mpc │ ├── mpc-1.2.0.patch │ └── PKGBUILD ├── flac │ ├── flac-1.3.3.patch │ └── PKGBUILD ├── dialog │ ├── dialog-1.3-20191210.patch │ └── PKGBUILD ├── xelix-kernel │ └── PKGBUILD ├── dropbear │ ├── dropbear.patch │ └── PKGBUILD ├── less │ └── PKGBUILD ├── pixman │ ├── pixman.patch │ └── PKGBUILD ├── darkhttpd │ ├── darkhttpd-1.13.patch │ └── PKGBUILD ├── libtextstyle │ ├── libtextstyle.patch │ └── PKGBUILD ├── pcre2 │ ├── pcre2-10.32.patch │ └── PKGBUILD ├── ncurses │ ├── ncurses-6.1.patch │ ├── PKGBUILD │ └── xelix.terminfo ├── libxml2 │ ├── libxml2-2.9.9.patch │ └── PKGBUILD ├── xz │ ├── xz-5.2.4.patch │ └── PKGBUILD ├── which │ └── PKGBUILD ├── freetype │ ├── freetype-2.9.patch │ └── PKGBUILD ├── libexpat │ ├── libexpat.patch │ └── PKGBUILD ├── openlibm │ └── PKGBUILD ├── dash │ └── PKGBUILD ├── tar │ ├── PKGBUILD │ └── tar-1.32.patch ├── gzip │ ├── PKGBUILD │ └── gzip-1.9.patch ├── zsh │ └── PKGBUILD ├── grep │ ├── PKGBUILD │ └── grep-3.1.patch ├── tmux │ └── PKGBUILD ├── nghttp2 │ └── PKGBUILD ├── diffutils │ ├── PKGBUILD │ └── diffutils-3.6.patch ├── libedit │ ├── PKGBUILD │ └── libedit-20191231-3.1.patch ├── nghttp3 │ └── PKGBUILD ├── e2fsprogs │ └── PKGBUILD ├── libarchive │ ├── PKGBUILD │ └── libarchive-3.7.2.patch ├── ngtcp2 │ └── PKGBUILD ├── curl │ └── PKGBUILD ├── vim │ └── PKGBUILD ├── wget │ └── PKGBUILD ├── libevent │ └── PKGBUILD ├── pacman │ ├── PKGBUILD │ └── xelixconfig.h ├── git │ └── PKGBUILD ├── ffmpeg │ ├── PKGBUILD │ ├── ffmpeg.patch │ └── xelixsnd.h ├── pciutils │ └── PKGBUILD ├── gcc │ ├── xelix.h │ └── PKGBUILD └── coreutils │ └── PKGBUILD ├── src ├── lib │ ├── printf │ ├── md5.h │ ├── version.h │ ├── variadic.h │ ├── endian.h │ ├── cmdline.h │ ├── stdlib.h │ ├── log.h │ ├── i386-variadic.asm │ ├── printf.h │ ├── prof.h │ ├── version.c │ ├── libgen.h │ ├── panic.h │ ├── time.h │ └── list.h ├── gfx │ ├── Tamsyn8x16r.psf │ ├── mouse.h │ ├── gfxbus.h │ └── fbtext.h ├── tty │ ├── pty.h │ ├── console.h │ ├── serial.h │ └── keyboard.h ├── int │ └── i386-idt.h ├── block │ ├── null.h │ ├── virtio.h │ ├── random.h │ ├── part.h │ └── null.c ├── net │ ├── virtio_net.h │ ├── i386-rtl8139.h │ ├── i386-ne2k.h │ ├── conv.h │ └── net.h ├── tasks │ ├── exception.h │ ├── execdata.h │ ├── wait.h │ ├── i386-signal.asm │ ├── worker.h │ ├── mem.h │ └── scheduler.h ├── sound │ └── i386-ac97.h ├── fs │ ├── pipe.h │ ├── ext2.h │ ├── ext2_misc.h │ ├── ftree.h │ ├── poll.h │ └── mount.h ├── bsp │ ├── timer.h │ └── i386-walk_stack.asm ├── mem │ ├── i386-gdt.h │ ├── mem.h │ ├── i386-gdt.asm │ ├── page_alloc.h │ └── paging.h └── boot │ └── i386-linker.ld ├── ext └── picotcp │ ├── .gitignore │ ├── Makefile │ ├── pico_xelix.h │ └── picotcp-1.7.0.patch ├── docs ├── images │ └── screenshot.png ├── net.md ├── pyproject.toml ├── int.md └── boot.md ├── .gitattributes ├── .gdbinit ├── .gitmodules ├── AUTHORS ├── .gitignore ├── util ├── setenv.sh ├── buildpkgs.sh └── findleaks.py ├── README.md ├── THANKS ├── .github └── workflows │ ├── docs.yml │ ├── kernel.yml │ └── nightly.yaml └── mkdocs.yml /land/base/etc/group: -------------------------------------------------------------------------------- 1 | root:x:0:root 2 | -------------------------------------------------------------------------------- /src/lib/printf: -------------------------------------------------------------------------------- 1 | ../../ext/printf/src/printf -------------------------------------------------------------------------------- /land/base/etc/hostname: -------------------------------------------------------------------------------- 1 | localhost.localdomain 2 | -------------------------------------------------------------------------------- /land/base/etc/passwd: -------------------------------------------------------------------------------- 1 | root:root:0:0:root:/home/root:/usr/bin/bash 2 | -------------------------------------------------------------------------------- /ext/picotcp/.gitignore: -------------------------------------------------------------------------------- 1 | picotcp-1.7.0 2 | build 3 | picotcp-1.7.0.tar.gz 4 | -------------------------------------------------------------------------------- /land/gfxcompd/src/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lutoma/xelix/HEAD/land/gfxcompd/src/bg.png -------------------------------------------------------------------------------- /src/gfx/Tamsyn8x16r.psf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lutoma/xelix/HEAD/src/gfx/Tamsyn8x16r.psf -------------------------------------------------------------------------------- /docs/images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lutoma/xelix/HEAD/docs/images/screenshot.png -------------------------------------------------------------------------------- /land/gfxcompd/src/cursor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lutoma/xelix/HEAD/land/gfxcompd/src/cursor.png -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.c linguist-language=C 2 | *.h linguist-language=C 3 | *.asm linguist-language=Assembly 4 | 5 | -------------------------------------------------------------------------------- /land/base/etc/init.d/gfxcompd: -------------------------------------------------------------------------------- 1 | [Service] 2 | Target=gui 3 | ExecStart=/usr/bin/gfxcompd 4 | Restart=onfailure 5 | -------------------------------------------------------------------------------- /land/base/etc/shells: -------------------------------------------------------------------------------- 1 | /usr/bin/sh 2 | /usr/bin/bash 3 | /usr/bin/dash 4 | /usr/bin/zsh 5 | /usr/bin/xshell 6 | -------------------------------------------------------------------------------- /land/base/etc/init.d/console-login: -------------------------------------------------------------------------------- 1 | [Service] 2 | Target=default 3 | ExecStart=/usr/bin/login 4 | Restart=always 5 | -------------------------------------------------------------------------------- /land/gfxcompd/src/bar.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | void update_bar(); 5 | void bar_init(); 6 | -------------------------------------------------------------------------------- /land/gfxcompd/src/bus.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "bus.h" 4 | 5 | int bus_handle_msg(); 6 | int bus_init(); 7 | -------------------------------------------------------------------------------- /land/newlib/xelix/crtn.s: -------------------------------------------------------------------------------- 1 | .section .init 2 | popl %ebp 3 | ret 4 | 5 | .section .fini 6 | popl %ebp 7 | ret 8 | -------------------------------------------------------------------------------- /land/gfxcompd/src/view-app-grid-symbolic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lutoma/xelix/HEAD/land/gfxcompd/src/view-app-grid-symbolic.png -------------------------------------------------------------------------------- /.gdbinit: -------------------------------------------------------------------------------- 1 | file xelix.bin 2 | set max-value-size unlimited 3 | target remote localhost:1234 4 | directory ./src 5 | directory ./toolchain/ 6 | -------------------------------------------------------------------------------- /land/newlib/xelix/sys/fcntl.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_FCNTL_H_ 2 | #define _SYS_FCNTL_H_ 3 | #include 4 | 5 | #define F_GETPATH 15 6 | #endif 7 | -------------------------------------------------------------------------------- /land/binutils/elf_i386_xelix.sh: -------------------------------------------------------------------------------- 1 | source_sh ${srcdir}/emulparams/elf_i386.sh 2 | TEXT_START_ADDR=0x3200000 3 | ELF_INTERPRETER_NAME=\"/usr/libexec/system/xelix-loader\" 4 | -------------------------------------------------------------------------------- /land/binutils/elf_x86_64_xelix.sh: -------------------------------------------------------------------------------- 1 | source_sh ${srcdir}/emulparams/elf_x86_64.sh 2 | TEXT_START_ADDR=0x3200000 3 | ELF_INTERPRETER_NAME=\"/usr/libexec/system/xelix-loader\" 4 | -------------------------------------------------------------------------------- /land/nano/nanorc: -------------------------------------------------------------------------------- 1 | set linenumbers 2 | set titlecolor black,white 3 | set statuscolor black,white 4 | set keycolor black,white 5 | set tabsize 4 6 | include "/usr/share/nano/*.nanorc" 7 | -------------------------------------------------------------------------------- /land/gfxcompd/src/text.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | cairo_font_face_t* font; 6 | cairo_font_face_t* font_light; 7 | cairo_font_face_t* font_bold; 8 | 9 | void text_init(); 10 | -------------------------------------------------------------------------------- /land/base/etc/motd: -------------------------------------------------------------------------------- 1 | Welcome to Xelix! This is an experimental operating system and things are 2 | likely to break. When they do, please let me know at , or in 3 | an issue at https://github.com/lutoma/xelix. 4 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "util/kconfiglib"] 2 | path = util/kconfiglib 3 | url = https://github.com/ulfalizer/Kconfiglib.git 4 | [submodule "ext/printf"] 5 | path = ext/printf 6 | url = https://github.com/eyalroz/printf.git 7 | -------------------------------------------------------------------------------- /land/xelix-utils/src/.gitignore: -------------------------------------------------------------------------------- 1 | basictest 2 | init 3 | ps 4 | uptime 5 | free 6 | util.o 7 | argparse.o 8 | libutil.a 9 | login 10 | dmesg 11 | su 12 | play 13 | strace 14 | host 15 | telnetd 16 | mount 17 | umount 18 | ld-xelix.so 19 | -------------------------------------------------------------------------------- /land/newlib/xelix/crti.s: -------------------------------------------------------------------------------- 1 | .section .init 2 | .global _init 3 | .type _init, @function 4 | _init: 5 | push %ebp 6 | movl %esp, %ebp 7 | 8 | .section .fini 9 | .global _fini 10 | .type _fini, @function 11 | _fini: 12 | push %ebp 13 | movl %esp, %ebp 14 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Xelix AUTHORS file 2 | 3 | Xelix has originally been written by Lukas Martini. Many 4 | people further contributed to Xelix by reporting problems, 5 | suggesting various improvements or submitting actual code. 6 | See the THANKS file for those awesome persons. 7 | -------------------------------------------------------------------------------- /land/newlib/xelix/sys/ioctl.h: -------------------------------------------------------------------------------- 1 | #ifndef _IOCTL_H 2 | #define _IOCTL_H 3 | 4 | #include 5 | 6 | #define IOCTLDTYPE 0x4F00 7 | 8 | #define IOCTL_DTYPE_UNKNOWN -1 9 | #define IOCTL_DTYPE_FILE 1 10 | #define IOCTL_DTYPE_TTY 2 11 | 12 | #endif -------------------------------------------------------------------------------- /docs/net.md: -------------------------------------------------------------------------------- 1 | # Networking 2 | 3 | Xelix uses the [PicoTCP network stack](https://github.com/tass-belgium/picotcp), which fully supports IP/ICMP/UDP/TCP. However, PicoTCP has its own interface and is not task-aware, so Xelix has a shim to translate between a BSD socket interface and PicoTCP. 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.log 3 | *~ 4 | .*.swp 5 | /*.img 6 | /*.raw 7 | /*.qcow2 8 | /*.vdi 9 | /Makefile 10 | xelix.bin 11 | tags 12 | *.sublime-* 13 | .gdb_history 14 | src/lib/config.h 15 | xelix.map 16 | .bochsrc 17 | /site 18 | /.config 19 | /.config.old 20 | /land/*/pkg 21 | /land/*/*.tar.* 22 | land/*/src 23 | /packages 24 | -------------------------------------------------------------------------------- /land/gfxcompd/src/mouse.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | struct mouse_event { 7 | int16_t x; 8 | int16_t y; 9 | uint8_t button_left:1; 10 | uint8_t button_right:1; 11 | uint8_t button_middle:1; 12 | }; 13 | 14 | void handle_mouse(); 15 | void mouse_render_cursor(cairo_t* cr); 16 | int mouse_init(); 17 | -------------------------------------------------------------------------------- /land/htop/xelix/ProcessField.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_XelixProcessField 2 | #define HEADER_XelixProcessField 3 | /* 4 | htop - Xelix/ProcessField.h 5 | (C) 2020 htop dev team 6 | Released under the GNU GPLv2, see the COPYING file 7 | in the source distribution for its full text. 8 | */ 9 | 10 | 11 | #define PLATFORM_PROCESS_FIELDS \ 12 | // End of list 13 | 14 | 15 | #endif /* HEADER_XelixProcessField */ 16 | -------------------------------------------------------------------------------- /land/newlib/xelix/include/endian.h: -------------------------------------------------------------------------------- 1 | #ifndef _ENDIAN_H 2 | #define _ENDIAN_H 1 3 | 4 | #include 5 | 6 | #define bswap16(_x) __bswap16(_x) 7 | #define bswap32(_x) __bswap32(_x) 8 | #define bswap64(_x) __bswap64(_x) 9 | 10 | #define htonl(_x) __htonl(_x) 11 | #define htons(_x) __htons(_x) 12 | #define ntohl(_x) __ntohl(_x) 13 | #define ntohs(_x) __ntohs(_x) 14 | 15 | #endif /* endian.h */ 16 | -------------------------------------------------------------------------------- /land/ca-certs/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=ca-certs 2 | pkgver=20231118 3 | pkgrel=1 4 | pkgdesc="The Mozilla CA certificates bundle" 5 | arch=('any') 6 | url="https://curl.se/docs/caextract.html" 7 | source=('https://curl.se/ca/cacert.pem') 8 | sha256sums=('SKIP') 9 | 10 | pkgver() { 11 | date -d @$(stat -c %Y cacert.pem) +%Y%m%d 12 | } 13 | 14 | package() { 15 | install -m 644 -D cacert.pem $pkgdir/etc/ssl/cert.pem 16 | } 17 | -------------------------------------------------------------------------------- /land/newlib/xelix/sys/utime.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_UTIME_H 2 | #define _SYS_UTIME_H 3 | 4 | #include 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | struct utimbuf 11 | { 12 | time_t actime; 13 | time_t modtime; 14 | }; 15 | 16 | 17 | int utime(const char *path, const struct utimbuf *times); 18 | 19 | #ifdef __cplusplus 20 | } /* C++ */ 21 | #endif 22 | #endif /* _SYS_UTIME_H */ 23 | -------------------------------------------------------------------------------- /land/xelix-utils/src/basictest.asm: -------------------------------------------------------------------------------- 1 | ; The most basic xelix executable possible. 2 | 3 | section .data 4 | hello: db 'Hello World.',10 5 | hellol: equ $-hello 6 | 7 | section .text 8 | global _start 9 | _start: 10 | ; Call the write syscall 11 | mov eax, 3 12 | mov ebx, 1 13 | mov ecx, hello 14 | mov edx, hellol 15 | int 80h 16 | 17 | ; Call the exit syscall 18 | mov eax, 1 19 | int 80h 20 | 21 | .il: 22 | jmp .il 23 | -------------------------------------------------------------------------------- /land/newlib/xelix/configure.in: -------------------------------------------------------------------------------- 1 | dnl This is the newlib/libc/sys/xelix configure.in file. 2 | dnl Process this file with autoconf to produce a configure script. 3 | 4 | AC_PREREQ(2.59) 5 | AC_INIT([newlib], [NEWLIB_VERSION]) 6 | AC_CONFIG_SRCDIR([crt0.c]) 7 | 8 | dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. 9 | AC_CONFIG_AUX_DIR(../../../..) 10 | 11 | NEWLIB_CONFIGURE(../../..) 12 | 13 | AC_CONFIG_FILES([Makefile]) 14 | AC_OUTPUT 15 | -------------------------------------------------------------------------------- /land/newlib/xelix/include/dlfcn.h: -------------------------------------------------------------------------------- 1 | #ifndef _DLFCN_H 2 | #define _DLFCN_H 1 3 | 4 | #define RTLD_LAZY 1 5 | #define RTLD_NOW 2 6 | #define RTLD_GLOBAL 3 7 | #define RTLD_LOCAL 4 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | int dlclose(void *); 14 | char *dlerror(void); 15 | void *dlopen(const char *, int); 16 | void *dlsym(void *, const char *); 17 | 18 | #ifdef __cplusplus 19 | } /* C++ */ 20 | #endif 21 | #endif /* dlfcn.h */ 22 | -------------------------------------------------------------------------------- /land/font-fira/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=font-fira 2 | pkgver=4.202 3 | pkgrel=1 4 | pkgdesc="The Fira font family." 5 | arch=('any') 6 | url="http://mozilla.github.io/Fira/" 7 | source=('https://github.com/mozilla/Fira/archive/4.202.tar.gz') 8 | sha256sums=('d86269657387f144d77ba12011124f30f423f70672e1576dc16f918bb16ddfe4') 9 | 10 | package() { 11 | cd Fira-4.202 12 | install -d -m 755 $pkgdir/usr/share/fonts 13 | install -D ttf/* -m 644 $pkgdir/usr/share/fonts 14 | } 15 | -------------------------------------------------------------------------------- /land/tzdb/tz.patch: -------------------------------------------------------------------------------- 1 | --- zic.c 2019-07-19 18:19:46.000000000 +0200 2 | +++ zic.c 2020-02-14 22:22:08.441814330 +0100 3 | @@ -146,7 +146,7 @@ extern int optind; 4 | # define symlink(from, to) (errno = ENOTSUP, -1) 5 | # define S_ISLNK(m) 0 6 | #endif 7 | -#ifndef AT_SYMLINK_FOLLOW 8 | +#if !defined(AT_SYMLINK_FOLLOW) || defined(__xelix__) 9 | # define linkat(fromdir, from, todir, to, flag) \ 10 | (itssymlink(from) ? (errno = ENOTSUP, -1) : link(from, to)) 11 | #endif 12 | -------------------------------------------------------------------------------- /land/font-fira-code/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=font-fira-code 2 | pkgver=2 3 | pkgrel=1 4 | pkgdesc="The Fira Code font family." 5 | arch=('any') 6 | url="https://github.com/tonsky/FiraCode" 7 | source=('https://github.com/tonsky/FiraCode/releases/download/2/FiraCode_2.zip') 8 | sha256sums=('60d5b1106b708cc134c521aae4e503bb1d2ec3c9bf8ad978f2c659820505d492') 9 | 10 | package() { 11 | install -d -m 755 $pkgdir/usr/share/fonts 12 | install -D ttf/* -m 644 $pkgdir/usr/share/fonts 13 | } 14 | -------------------------------------------------------------------------------- /land/font-roboto/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=font-roboto 2 | pkgver=2.138 3 | pkgrel=1 4 | pkgdesc="The Roboto font family." 5 | arch=('any') 6 | url="https://github.com/googlefonts/roboto" 7 | source=('https://github.com/googlefonts/roboto/releases/download/v2.138/roboto-unhinted.zip') 8 | sha256sums=('70f64c718510a601fbcf752aafe644314dacaeb85474dc689c89787c4a72a728') 9 | 10 | package() { 11 | install -d -m 755 $pkgdir/usr/share/fonts 12 | install -D *.ttf -m 644 $pkgdir/usr/share/fonts 13 | } 14 | -------------------------------------------------------------------------------- /land/font-dejavu/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=font-dejavu 2 | pkgver=2.37 3 | pkgrel=1 4 | pkgdesc="The DejaVu font family." 5 | arch=('any') 6 | url="https://dejavu-fonts.github.io/" 7 | source=('http://sourceforge.net/projects/dejavu/files/dejavu/2.37/dejavu-fonts-ttf-2.37.tar.bz2') 8 | sha256sums=('fa9ca4d13871dd122f61258a80d01751d603b4d3ee14095d65453b4e846e17d7') 9 | 10 | package() { 11 | cd dejavu-fonts-ttf-2.37 12 | install -d -m 755 $pkgdir/usr/share/fonts 13 | install -D ttf/* -m 644 $pkgdir/usr/share/fonts 14 | } 15 | -------------------------------------------------------------------------------- /land/fontconfig/fontconfig.patch: -------------------------------------------------------------------------------- 1 | --- /tmp/config.sub 2020-02-20 19:27:04.210636154 +0100 2 | +++ config.sub 2020-02-20 19:27:09.993967526 +0100 3 | @@ -1360,7 +1360,7 @@ case $os in 4 | | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ 5 | | skyos* | haiku* | rdos* | toppers* | drops* | es* \ 6 | | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ 7 | - | midnightbsd*) 8 | + | midnightbsd* | xelix*) 9 | # Remember, each alternative MUST END IN *, to match a version number. 10 | ;; 11 | qnx*) 12 | -------------------------------------------------------------------------------- /land/gfxcompd/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=gfxcompd 2 | pkgver=r2576.fb8939c5 3 | pkgrel=1 4 | epoch= 5 | pkgdesc="The graphics compositor of Xelix" 6 | arch=('i786') 7 | url="https://github.com/lutoma/xelix/tree/main/land/gfxcompd" 8 | license=('GPL') 9 | depends=('font-roboto') 10 | makedepends=('cairo' 'freetype' 'libpng') 11 | source=() 12 | 13 | pkgver() { 14 | printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" 15 | } 16 | 17 | build() { 18 | make 19 | } 20 | 21 | package() { 22 | make DESTDIR=$pkgdir install 23 | } 24 | -------------------------------------------------------------------------------- /land/openssl-quic/50-xelix.conf: -------------------------------------------------------------------------------- 1 | ## -*- mode: perl; -*- 2 | 3 | ( 4 | "xelix-x86" => { 5 | inherit_from => [ "BASE_unix" ], 6 | CC => "gcc", 7 | CFLAGS => "-fomit-frame-pointer -O3 -Wall", 8 | bn_ops => "BN_LLONG", 9 | asm_arch => 'x86', 10 | perlasm_scheme => "elf", 11 | thread_scheme => undef, 12 | dso_scheme => undef, 13 | shared_target => "gnu-shared", 14 | shared_cflag => "-fPIC" 15 | } 16 | ); 17 | -------------------------------------------------------------------------------- /land/xelix-utils/src/xelix-loader.ld: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("binary") 2 | 3 | ENTRY(_start) 4 | 5 | PHDRS { 6 | text PT_LOAD ; 7 | data PT_LOAD ; 8 | rodata PT_LOAD ; 9 | } 10 | 11 | SECTIONS { 12 | . = 0x500000; 13 | 14 | .text : { 15 | *(.text) 16 | } :text 17 | 18 | .data ALIGN(4096) : { 19 | *(.data) 20 | } :data 21 | 22 | .bss ALIGN(4096) : { 23 | *(.bss) 24 | } :data 25 | 26 | .rodata ALIGN(4096) : { 27 | *(.rodata*) 28 | } :rodata 29 | 30 | .eh_frame ALIGN(4096) : { 31 | *(.eh_frame) 32 | } :rodata 33 | } 34 | 35 | -------------------------------------------------------------------------------- /land/gmp/gmp-6.2.0.patch: -------------------------------------------------------------------------------- 1 | --- configfsf.sub 2020-09-28 17:42:17.794472809 +0200 2 | +++ configfsf.sub 2020-09-28 17:43:12.077392269 +0200 3 | @@ -1366,7 +1366,7 @@ case $os in 4 | | skyos* | haiku* | rdos* | toppers* | drops* | es* \ 5 | | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ 6 | | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ 7 | - | nsk* | powerunix) 8 | + | nsk* | powerunix | xelix*) 9 | # Remember, each alternative MUST END IN *, to match a version number. 10 | ;; 11 | qnx*) 12 | -------------------------------------------------------------------------------- /land/libpng/libpng.patch: -------------------------------------------------------------------------------- 1 | --- config.sub 2020-01-26 02:29:15.016380282 +0100 2 | +++ config.sub 2020-01-26 02:29:22.063092942 +0100 3 | @@ -1390,7 +1390,7 @@ case $os in 4 | | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ 5 | | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ 6 | | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ 7 | - | -midnightbsd*) 8 | + | -midnightbsd* | -xelix*) 9 | # Remember, each alternative MUST END IN *, to match a version number. 10 | ;; 11 | -qnx*) 12 | -------------------------------------------------------------------------------- /docs/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.poetry] 2 | name = "xelix-docs" 3 | version = "0.1.0" 4 | description = "Dependencies for Xelix documentation generation" 5 | authors = ["Lukas Martini "] 6 | license = "GPLv3" 7 | 8 | [tool.poetry.dependencies] 9 | python = "^3.10" 10 | mkdocs = "^1.2.3" 11 | mkdocs-material = "^8.1.1" 12 | mkdocs-minify-plugin = "^0.5.0" 13 | mkdocs-mermaid2-plugin = "^0.5.2" 14 | 15 | [tool.poetry.dev-dependencies] 16 | 17 | [build-system] 18 | requires = ["poetry-core>=1.0.0"] 19 | build-backend = "poetry.core.masonry.api" 20 | -------------------------------------------------------------------------------- /land/bzip2/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=bzip2 2 | pkgver=1.0.2 3 | pkgrel=2 4 | pkgdesc="bzip2 is a freely available, patent free (see below), high-quality data compressor." 5 | arch=('i786') 6 | url="https://sourceware.org/bzip2/" 7 | source=('https://sourceware.org/pub/bzip2/bzip2-1.0.2.tar.gz') 8 | sha256sums=('4b526afa73ca1ccd6f5f1f5fd23813f159f715c3d0e00688f1df54b51f443cdd') 9 | 10 | build() { 11 | cd $pkgname-$pkgver 12 | make CC=i786-pc-xelix-gcc libbz2.a bzip2 13 | } 14 | 15 | package() { 16 | cd $pkgname-$pkgver 17 | make PREFIX=$pkgdir/usr install 18 | } 19 | -------------------------------------------------------------------------------- /land/mpfr/mpfr-4.1.0.patch: -------------------------------------------------------------------------------- 1 | --- config.sub 2019-01-31 21:43:20.000000000 +0100 2 | +++ config.sub 2019-02-06 17:06:50.956368522 +0100 3 | @@ -1390,7 +1390,7 @@ case $os in 4 | | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ 5 | | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ 6 | | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ 7 | - | -midnightbsd*) 8 | + | -midnightbsd* | -xelix*) 9 | # Remember, each alternative MUST END IN *, to match a version number. 10 | ;; 11 | -qnx*) 12 | -------------------------------------------------------------------------------- /land/zlib/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=zlib 2 | pkgver=1.2.11 3 | pkgrel=1 4 | pkgdesc="A Massively Spiffy Yet Delicately Unobtrusive Compression Library" 5 | arch=('i786') 6 | url="https://zlib.net" 7 | source=('https://zlib.net/fossils/zlib-1.2.11.tar.gz') 8 | 9 | sha256sums=('c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1') 10 | 11 | build() { 12 | cd $pkgname-$pkgver 13 | CC=i786-pc-xelix-gcc ./configure --static --prefix=/usr --sysconfdir=/etc 14 | } 15 | 16 | package() { 17 | cd $pkgname-$pkgver 18 | make DESTDIR=$pkgdir install 19 | } 20 | -------------------------------------------------------------------------------- /land/bash/bash-5.0.patch: -------------------------------------------------------------------------------- 1 | --- bash-5.0/support/config.sub 2018-11-16 21:34:44.000000000 +0100 2 | +++ bash-5.0/support/config.sub 2019-05-24 19:56:36.696395231 +0200 3 | @@ -1360,7 +1360,7 @@ case $os in 4 | | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ 5 | | skyos* | haiku* | rdos* | toppers* | drops* | es* \ 6 | | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ 7 | - | midnightbsd*) 8 | + | midnightbsd* | xelix*) 9 | # Remember, each alternative MUST END IN *, to match a version number. 10 | ;; 11 | qnx*) 12 | -------------------------------------------------------------------------------- /land/cairo/cairo.patch: -------------------------------------------------------------------------------- 1 | --- build/config.sub 2020-02-21 07:00:31.563396850 +0100 2 | +++ build/config.sub 2020-02-21 07:00:40.313338313 +0100 3 | @@ -1390,7 +1390,7 @@ case $os in 4 | | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ 5 | | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ 6 | | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ 7 | - | -midnightbsd*) 8 | + | -midnightbsd* | -xelix*) 9 | # Remember, each alternative MUST END IN *, to match a version number. 10 | ;; 11 | -qnx*) 12 | -------------------------------------------------------------------------------- /land/mpc/mpc-1.2.0.patch: -------------------------------------------------------------------------------- 1 | --- build-aux/config.sub 2020-09-28 17:49:12.801388710 +0200 2 | +++ build-aux/config.sub 2020-09-28 17:49:21.704657781 +0200 3 | @@ -1366,7 +1366,7 @@ case $os in 4 | | skyos* | haiku* | rdos* | toppers* | drops* | es* \ 5 | | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ 6 | | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ 7 | - | nsk* | powerunix) 8 | + | nsk* | powerunix | xelix*) 9 | # Remember, each alternative MUST END IN *, to match a version number. 10 | ;; 11 | qnx*) 12 | -------------------------------------------------------------------------------- /land/nano/nano-4.2.patch: -------------------------------------------------------------------------------- 1 | --- nano-4.2/config.sub 2018-11-10 07:30:37.000000000 +0100 2 | +++ nano-4.2/config.sub 2019-05-18 16:27:00.177915782 +0200 3 | @@ -1390,7 +1390,7 @@ case $os in 4 | | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ 5 | | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ 6 | | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ 7 | - | -midnightbsd*) 8 | + | -midnightbsd* | -xelix*) 9 | # Remember, each alternative MUST END IN *, to match a version number. 10 | ;; 11 | -qnx*) 12 | -------------------------------------------------------------------------------- /land/flac/flac-1.3.3.patch: -------------------------------------------------------------------------------- 1 | --- flac-1.3.3/config.sub 2020-01-08 01:33:45.254539277 +0100 2 | +++ flac-1.3.3/config.sub 2020-01-08 01:33:54.567852499 +0100 3 | @@ -1390,7 +1390,7 @@ case $os in 4 | | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ 5 | | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ 6 | | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ 7 | - | -midnightbsd*) 8 | + | -midnightbsd* | -xelix*) 9 | # Remember, each alternative MUST END IN *, to match a version number. 10 | ;; 11 | -qnx*) 12 | -------------------------------------------------------------------------------- /land/dialog/dialog-1.3-20191210.patch: -------------------------------------------------------------------------------- 1 | --- dialog-1.3-20191210/config.sub 2019-09-12 01:56:40.000000000 +0200 2 | +++ dialog-1.3-20191210/config.sub 2020-01-10 09:01:40.126426022 +0100 3 | @@ -1366,7 +1366,7 @@ case $os in 4 | | skyos* | haiku* | rdos* | toppers* | drops* | es* \ 5 | | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ 6 | | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ 7 | - | nsk* | powerunix) 8 | + | nsk* | powerunix | xelix*) 9 | # Remember, each alternative MUST END IN *, to match a version number. 10 | ;; 11 | qnx*) 12 | -------------------------------------------------------------------------------- /land/xelix-kernel/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=xelix-kernel 2 | pkgver=git 3 | pkgrel=1 4 | epoch= 5 | pkgdesc="The Xelix kernel binary" 6 | arch=('i786') 7 | url="https://github.com/lutoma/xelix" 8 | license=('GPL') 9 | source=('xelix::git+https://github.com/lutoma/xelix.git') 10 | sha256sums=('SKIP') 11 | 12 | pkgver() { 13 | cd xelix 14 | printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" 15 | } 16 | 17 | build() { 18 | cd xelix 19 | ./configure 20 | make 21 | } 22 | 23 | package() { 24 | cd xelix 25 | install -d $pkgdir/boot 26 | install -D xelix.bin $pkgdir/boot 27 | } 28 | -------------------------------------------------------------------------------- /src/lib/md5.h: -------------------------------------------------------------------------------- 1 | #ifndef MD5_H 2 | #define MD5_H 3 | 4 | typedef struct{ 5 | uint64_t size; // Size of input in bytes 6 | uint32_t buffer[4]; // Current accumulation of hash 7 | uint8_t input[64]; // Input to be used in the next step 8 | uint8_t digest[16]; // Result of algorithm 9 | }MD5Context; 10 | 11 | void md5Init(MD5Context *ctx); 12 | void md5Update(MD5Context *ctx, uint8_t *input, size_t input_len); 13 | void md5Finalize(MD5Context *ctx); 14 | void md5Step(uint32_t *buffer, uint32_t *input); 15 | 16 | void md5String(char *input, uint8_t *result); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /land/dropbear/dropbear.patch: -------------------------------------------------------------------------------- 1 | --- config.sub 2021-07-15 05:12:08.905027042 +0200 2 | +++ config.sub 2021-07-15 05:12:18.031626875 +0200 3 | @@ -1365,7 +1365,7 @@ case $os in 4 | | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ 5 | | skyos* | haiku* | rdos* | toppers* | drops* | es* \ 6 | | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ 7 | - | midnightbsd* | amdhsa* | unleashed* | emscripten*) 8 | + | midnightbsd* | amdhsa* | unleashed* | emscripten* | xelix*) 9 | # Remember, each alternative MUST END IN *, to match a version number. 10 | ;; 11 | qnx*) 12 | -------------------------------------------------------------------------------- /land/less/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=less 2 | pkgver=551 3 | pkgrel=1 4 | pkgdesc="Less is a free, open-source file pager." 5 | arch=('i786') 6 | depends=('ncurses') 7 | url="http://greenwoodsoftware.com/less/" 8 | source=('http://www.greenwoodsoftware.com/less/less-551.tar.gz') 9 | sha256sums=('ff165275859381a63f19135a8f1f6c5a194d53ec3187f94121ecd8ef0795fe3d') 10 | 11 | build() { 12 | cd $pkgname-$pkgver 13 | ./configure \ 14 | --host=i786-pc-xelix \ 15 | --prefix=/usr \ 16 | --sysconfdir=/etc 17 | 18 | make 19 | } 20 | 21 | package() { 22 | cd $pkgname-$pkgver 23 | make DESTDIR=$pkgdir install 24 | } 25 | -------------------------------------------------------------------------------- /land/pixman/pixman.patch: -------------------------------------------------------------------------------- 1 | --- config.sub 2020-02-21 07:05:21.671499442 +0100 2 | +++ config.sub 2020-02-21 07:05:27.878126325 +0100 3 | @@ -1427,7 +1427,7 @@ case $os in 4 | | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ 5 | | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ 6 | | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ 7 | - | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*) 8 | + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -xelix*) 9 | # Remember, each alternative MUST END IN *, to match a version number. 10 | ;; 11 | -qnx*) 12 | -------------------------------------------------------------------------------- /land/darkhttpd/darkhttpd-1.13.patch: -------------------------------------------------------------------------------- 1 | --- darkhttpd-1.13/darkhttpd.c 2016-01-29 15:21:13.000000000 +0100 2 | +++ darkhttpd-1.13/darkhttpd.c 2020-01-11 01:46:25.995398608 +0100 3 | @@ -855,11 +855,13 @@ static void init_sockin(void) { 4 | if (sockin == -1) 5 | err(1, "socket()"); 6 | 7 | +#ifndef __xelix__ 8 | /* reuse address */ 9 | sockopt = 1; 10 | if (setsockopt(sockin, SOL_SOCKET, SO_REUSEADDR, 11 | &sockopt, sizeof(sockopt)) == -1) 12 | err(1, "setsockopt(SO_REUSEADDR)"); 13 | +#endif 14 | 15 | #if 0 16 | /* disable Nagle since we buffer everything ourselves */ 17 | -------------------------------------------------------------------------------- /land/libtextstyle/libtextstyle.patch: -------------------------------------------------------------------------------- 1 | --- build-aux/config.sub 2020-01-15 13:17:21.998107664 +0100 2 | +++ build-aux/config.sub 2020-01-15 13:17:31.561360301 +0100 3 | @@ -1367,7 +1367,7 @@ case $os in 4 | | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ 5 | | skyos* | haiku* | rdos* | toppers* | drops* | es* \ 6 | | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ 7 | - | midnightbsd* | amdhsa* | unleashed* | emscripten*) 8 | + | midnightbsd* | amdhsa* | unleashed* | emscripten* | xelix*) 9 | # Remember, each alternative MUST END IN *, to match a version number. 10 | ;; 11 | qnx*) 12 | -------------------------------------------------------------------------------- /util/setenv.sh: -------------------------------------------------------------------------------- 1 | if test "$#" -ne 1; then 2 | echo "Usage: source setenv.sh >image root>" 3 | else 4 | export SYSROOT=$1 5 | export PKG_CONFIG_DIR="$SYSROOT" 6 | export PKG_CONFIG_LIBDIR="$SYSROOT/usr/lib/pkgconfig:$SYSROOT/usr/share/pkgconfig" 7 | export PKG_CONFIG_SYSROOT_DIR="$SYSROOT" 8 | export CFLAGS="-O3 -I$SYSROOT/usr/include --sysroot $SYSROOT" 9 | export CPPFLAGS="$CFLAGS -D__STDC_ISO_10646__ -D_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC=0 -D_GLIBCXX_USE_C99_STDLIB=0" 10 | export LDFLAGS="-L$SYSROOT/usr/lib" 11 | 12 | fix_config_sub() { 13 | echo "Replacing file $1" 14 | echo -e "#!/bin/sh\necho i786-pc-xelix" 15 | } 16 | fi 17 | -------------------------------------------------------------------------------- /land/xelix-utils/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=xelix-utils 2 | pkgver=r. 3 | pkgrel=1 4 | epoch= 5 | pkgdesc="A suite of Xelix-specific standard system utilities." 6 | arch=('i786') 7 | url="https://github.com/lutoma/xelix/tree/main/land/xelix-utils" 8 | license=('GPL') 9 | depend=('font-fira-code' 'gfxcompd' 'zlib') 10 | makedepend=('flac' 'freetype' 'libpng' 'bzip2') 11 | source=() 12 | 13 | pkgver() { 14 | printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" 15 | } 16 | 17 | build() { 18 | CFLAGS="$CFLAGS -I$SYSROOT/usr/include/freetype2" make 19 | } 20 | 21 | package() { 22 | make DESTDIR=$pkgdir install 23 | } 24 | -------------------------------------------------------------------------------- /ext/picotcp/Makefile: -------------------------------------------------------------------------------- 1 | PACKAGE_VERSION := 1.7.0 2 | PACKAGE_NAME := picotcp-$(PACKAGE_VERSION) 3 | PACKAGE_URL := https://github.com/tass-belgium/picotcp/archive/v$(PACKAGE_VERSION).tar.gz 4 | 5 | .PHONY: all 6 | all: $(PACKAGE_NAME).tar.gz 7 | tar xf $(PACKAGE_NAME).tar.gz 8 | cp pico_xelix.h $(PACKAGE_NAME)/include/arch 9 | patch -p0 < ${PACKAGE_NAME}.patch 10 | make PLATFORM_CFLAGS="-ffreestanding -I$(abspath ../../src) -I$(abspath ../../src/lib) -include $(abspath ../../src/lib/generic.h)" CROSS_COMPILE=i786-pc-xelix- -C $(PACKAGE_NAME) 11 | 12 | $(PACKAGE_NAME).tar.gz: 13 | wget --continue $(PACKAGE_URL) -O $(PACKAGE_NAME).tar.gz 14 | -------------------------------------------------------------------------------- /land/pcre2/pcre2-10.32.patch: -------------------------------------------------------------------------------- 1 | --- pcre2-10.32/config.sub 2019-01-30 01:05:47.537823025 +0100 2 | +++ pcre2-10.32/config.sub 2019-01-30 01:05:57.694429171 +0100 3 | @@ -1417,7 +1417,7 @@ 4 | | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ 5 | | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ 6 | | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ 7 | - | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*) 8 | + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -xelix*) 9 | # Remember, each alternative MUST END IN *, to match a version number. 10 | ;; 11 | -qnx*) 12 | -------------------------------------------------------------------------------- /land/ncurses/ncurses-6.1.patch: -------------------------------------------------------------------------------- 1 | --- ncurses-6.1/config.sub 2017-11-25 21:49:31.000000000 +0100 2 | +++ ../../../ncurses-6.1/config.sub 2018-10-05 01:22:49.419433703 +0200 3 | @@ -1416,7 +1416,7 @@ 4 | | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ 5 | | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ 6 | | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ 7 | - | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*) 8 | + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -xelix*) 9 | # Remember, each alternative MUST END IN *, to match a version number. 10 | ;; 11 | -qnx*) 12 | -------------------------------------------------------------------------------- /land/libxml2/libxml2-2.9.9.patch: -------------------------------------------------------------------------------- 1 | --- libxml2-2.9.9/config.sub 2019-01-03 19:12:35.000000000 +0100 2 | +++ libxml2-2.9.9/config.sub 2019-05-29 06:55:41.932750355 +0200 3 | @@ -1417,7 +1417,7 @@ case $os in 4 | | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ 5 | | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ 6 | | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ 7 | - | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*) 8 | + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -xelix*) 9 | # Remember, each alternative MUST END IN *, to match a version number. 10 | ;; 11 | -qnx*) 12 | -------------------------------------------------------------------------------- /land/xz/xz-5.2.4.patch: -------------------------------------------------------------------------------- 1 | --- xz-5.2.4/build-aux/config.sub 2018-04-29 18:01:26.000000000 +0200 2 | +++ xz-5.2.4/build-aux/config.sub 2019-05-29 06:48:20.907372708 +0200 3 | @@ -1417,7 +1417,7 @@ case $os in 4 | | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ 5 | | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ 6 | | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ 7 | - | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*) 8 | + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -xelix*) 9 | # Remember, each alternative MUST END IN *, to match a version number. 10 | ;; 11 | -qnx*) 12 | -------------------------------------------------------------------------------- /land/which/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=which 2 | pkgver=2.21 3 | pkgrel=1 4 | pkgdesc="A utility that is used to find which executable (or alias or shell function) is executed when entered on the shell prompt. " 5 | arch=('i786') 6 | url="https://savannah.gnu.org/projects/which" 7 | source=('https://ftp.gnu.org/gnu/which/which-2.21.tar.gz') 8 | sha256sums=('f4a245b94124b377d8b49646bf421f9155d36aa7614b6ebf83705d3ffc76eaad') 9 | 10 | build() { 11 | cd $pkgname-$pkgver 12 | ./configure \ 13 | --host=i786-pc-xelix \ 14 | --prefix=/usr \ 15 | --sysconfdir=/etc 16 | 17 | make 18 | } 19 | 20 | package() { 21 | cd $pkgname-$pkgver 22 | make DESTDIR=$pkgdir install 23 | } 24 | -------------------------------------------------------------------------------- /land/freetype/freetype-2.9.patch: -------------------------------------------------------------------------------- 1 | --- freetype-2.9/builds/unix/config.sub 2018-01-08 12:30:22.000000000 +0100 2 | +++ freetype-2.9/builds/unix/config.sub 2018-10-16 15:19:09.178695643 +0200 3 | @@ -1416,7 +1416,7 @@ 4 | | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ 5 | | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ 6 | | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ 7 | - | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme*) 8 | + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* | -xelix*) 9 | # Remember, each alternative MUST END IN *, to match a version number. 10 | ;; 11 | -qnx*) 12 | -------------------------------------------------------------------------------- /land/libexpat/libexpat.patch: -------------------------------------------------------------------------------- 1 | --- conftools/config.sub 2020-02-20 19:29:17.090577184 +0100 2 | +++ conftools/config.sub 2020-02-20 19:29:29.253903782 +0100 3 | @@ -1434,7 +1434,8 @@ case $os in 4 | | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ 5 | | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ 6 | | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ 7 | - | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme*) 8 | + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ 9 | + | -xelix*) 10 | # Remember, each alternative MUST END IN *, to match a version number. 11 | ;; 12 | -qnx*) 13 | -------------------------------------------------------------------------------- /land/htop/xelix/XelixProcessList.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_XelixProcessList 2 | #define HEADER_XelixProcessList 3 | /* 4 | htop - XelixProcessList.h 5 | (C) 2014 Hisham H. Muhammad 6 | (C) 2017 Diederik de Groot 7 | Released under the GNU GPLv2, see the COPYING file 8 | in the source distribution for its full text. 9 | */ 10 | 11 | #include "XelixProcess.h" 12 | 13 | 14 | typedef struct XelixProcessList_ { 15 | ProcessList super; 16 | } XelixProcessList; 17 | 18 | ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidMatchList, uid_t userId); 19 | 20 | void ProcessList_delete(ProcessList* this); 21 | 22 | void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /land/darkhttpd/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=darkhttpd 2 | pkgver=1.13 3 | pkgrel=1 4 | pkgdesc="When you need a web server in a hurry." 5 | arch=('i786') 6 | url="https://github.com/emikulic/darkhttpd" 7 | source=( 8 | 'https://github.com/emikulic/darkhttpd/archive/refs/tags/v1.13.tar.gz' 9 | 'darkhttpd-1.13.patch' 10 | ) 11 | sha256sums=( 12 | '1d88c395ac79ca9365aa5af71afe4ad136a4ed45099ca398168d4a2014dc0fc2' 13 | 'SKIP' 14 | ) 15 | 16 | prepare() { 17 | patch -p0 < $pkgname-$pkgver.patch 18 | } 19 | 20 | build() { 21 | cd $pkgname-$pkgver 22 | CC=i786-pc-xelix-gcc CFLAGS="-O3 -DNO_IPV6" make 23 | } 24 | 25 | package() { 26 | cd $pkgname-$pkgver 27 | install -d $pkgdir/usr/bin/ 28 | install -D darkhttpd $pkgdir/usr/bin/ 29 | } 30 | -------------------------------------------------------------------------------- /land/openlibm/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=openlibm 2 | pkgver=0.8.1 3 | pkgrel=1 4 | pkgdesc="OpenLibm is an effort to have a high quality, portable, standalone C mathematical library (libm)" 5 | arch=('i786') 6 | url="https://openlibm.org/" 7 | source=('https://github.com/JuliaMath/openlibm/archive/refs/tags/v0.8.1.tar.gz') 8 | sha256sums=('ba8a282ecd92d0033f5656bb20dfc6ea3fb83f90ba69291ac8f7beba42dcffcf') 9 | 10 | build() { 11 | cd $pkgname-$pkgver 12 | CFLAGS="" CPPFLAGS="" CC=i786-pc-xelix-gcc ARCH=i386 prefix=/usr make 13 | } 14 | 15 | package() { 16 | cd $pkgname-$pkgver 17 | CFLAGS="" CPPFLAGS="" CC=i786-pc-xelix-gcc ARCH=i386 prefix=/usr make DESTDIR=$pkgdir install 18 | ln -s libopenlibm.so.4.0 $pkgdir/usr/lib/libm.so 19 | } 20 | -------------------------------------------------------------------------------- /land/xz/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=xz 2 | pkgver=5.2.4 3 | pkgrel=1 4 | pkgdesc="XZ Utils is free general-purpose data compression software with a high compression ratio." 5 | arch=('i786') 6 | url="https://tukaani.org/xz/" 7 | source=( 8 | 'https://tukaani.org/xz/xz-5.2.4.tar.xz' 9 | "$pkgname-$pkgver.patch" 10 | ) 11 | sha256sums=( 12 | '9717ae363760dedf573dad241420c5fea86256b65bc21d2cf71b2b12f0544f4b' 13 | 'SKIP' 14 | ) 15 | 16 | prepare() { 17 | patch -p0 < $pkgname-$pkgver.patch 18 | } 19 | 20 | build() { 21 | cd $pkgname-$pkgver 22 | ./configure \ 23 | --host=i786-pc-xelix \ 24 | --prefix=/usr \ 25 | --sysconfdir=/etc 26 | 27 | make 28 | } 29 | 30 | package() { 31 | cd $pkgname-$pkgver 32 | make DESTDIR=$pkgdir install 33 | } 34 | -------------------------------------------------------------------------------- /land/dash/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=dash 2 | pkgver=0.5.10.2 3 | pkgrel=1 4 | pkgdesc="DASH is a POSIX-compliant implementation of /bin/sh that aims to be as small as possible." 5 | arch=('i786') 6 | url="http://gondor.apana.org.au/~herbert/dash/" 7 | source=( 8 | 'http://gondor.apana.org.au/~herbert/dash/files/dash-0.5.10.2.tar.gz' 9 | 'dash-0.5.10.2.patch' 10 | ) 11 | sha256sums=( 12 | '3c663919dc5c66ec991da14c7cf7e0be8ad00f3db73986a987c118862b5f6071' 13 | 'SKIP' 14 | ) 15 | 16 | build() { 17 | cd $pkgname-$pkgver 18 | ./configure \ 19 | --host=i786-pc-xelix \ 20 | --prefix=/usr \ 21 | --sysconfdir=/etc 22 | 23 | patch -p1 < ../dash-0.5.10.2.patch 24 | make 25 | } 26 | 27 | package() { 28 | cd $pkgname-$pkgver 29 | make DESTDIR=$pkgdir install 30 | } 31 | -------------------------------------------------------------------------------- /land/tar/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=tar 2 | pkgver=1.32 3 | pkgrel=1 4 | pkgdesc="GNU Tar provides the ability to create tar archives, as well as various other kinds of manipulation." 5 | arch=('i786') 6 | url="https://www.gnu.org/software/tar/" 7 | source=( 8 | 'https://ftp.gnu.org/gnu/tar/tar-1.32.tar.xz' 9 | "$pkgname-$pkgver.patch" 10 | ) 11 | sha256sums=( 12 | 'd0d3ae07f103323be809bc3eac0dcc386d52c5262499fe05511ac4788af1fdd8' 13 | 'SKIP' 14 | ) 15 | 16 | prepare() { 17 | patch -p0 < $pkgname-$pkgver.patch 18 | } 19 | 20 | build() { 21 | cd $pkgname-$pkgver 22 | ./configure \ 23 | --host=i786-pc-xelix \ 24 | --prefix=/usr \ 25 | --sysconfdir=/etc 26 | 27 | make 28 | } 29 | 30 | package() { 31 | cd $pkgname-$pkgver 32 | make DESTDIR=$pkgdir install 33 | } 34 | -------------------------------------------------------------------------------- /land/gzip/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=gzip 2 | pkgver=1.9 3 | pkgrel=1 4 | pkgdesc="gzip is a single-file/stream lossless data compression utility, where the resulting compressed file generally has the suffix .gz." 5 | arch=('i786') 6 | url="https://www.gzip.org/" 7 | source=( 8 | 'https://ftp.gnu.org/gnu/gzip/gzip-1.9.tar.xz' 9 | 'gzip-1.9.patch' 10 | ) 11 | sha256sums=( 12 | 'ae506144fc198bd8f81f1f4ad19ce63d5a2d65e42333255977cf1dcf1479089a' 13 | 'SKIP' 14 | ) 15 | 16 | prepare() { 17 | patch -p0 < gzip-1.9.patch 18 | } 19 | 20 | build() { 21 | cd $pkgname-$pkgver 22 | ./configure \ 23 | --host=i786-pc-xelix \ 24 | --prefix=/usr \ 25 | --sysconfdir=/etc 26 | 27 | make 28 | } 29 | 30 | package() { 31 | cd $pkgname-$pkgver 32 | make DESTDIR=$pkgdir install 33 | } 34 | -------------------------------------------------------------------------------- /land/libexpat/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=libexpat 2 | pkgver=2.2.9 3 | pkgrel=1 4 | pkgdesc="Fast streaming XML parser written in C99 with >90% test coverage" 5 | arch=('i786') 6 | url="https://libexpat.github.io/" 7 | source=( 8 | 'https://github.com/libexpat/libexpat/releases/download/R_2_2_9/expat-2.2.9.tar.xz' 9 | 'libexpat.patch' 10 | ) 11 | sha256sums=( 12 | '1ea6965b15c2106b6bbe883397271c80dfa0331cdf821b2c319591b55eadc0a4' 13 | 'SKIP' 14 | ) 15 | 16 | prepare() { 17 | cd expat-2.2.9 18 | patch -p0 < ../libexpat.patch 19 | } 20 | 21 | build() { 22 | cd expat-2.2.9 23 | ./configure \ 24 | --host=i786-pc-xelix \ 25 | --prefix=/usr \ 26 | --sysconfdir=/etc 27 | 28 | make 29 | } 30 | 31 | package() { 32 | cd expat-2.2.9 33 | make DESTDIR=$pkgdir install 34 | } 35 | -------------------------------------------------------------------------------- /land/zsh/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=zsh 2 | pkgver=5.9 3 | pkgrel=1 4 | pkgdesc="Zsh is a shell designed for interactive use, although it is also a powerful scripting language." 5 | arch=('i786') 6 | url="ttps://www.zsh.org" 7 | source=( 8 | 'https://www.zsh.org/pub/zsh-5.9.tar.xz' 9 | "$pkgname-$pkgver.patch" 10 | ) 11 | sha256sums=( 12 | '9b8d1ecedd5b5e81fbf1918e876752a7dd948e05c1a0dba10ab863842d45acd5' 13 | 'SKIP' 14 | ) 15 | 16 | prepare() { 17 | cd $pkgname-$pkgver 18 | patch -p0 < ../$pkgname-$pkgver.patch 19 | } 20 | 21 | build() { 22 | cd $pkgname-$pkgver 23 | ./configure \ 24 | --host=i786-pc-xelix \ 25 | --prefix=/usr \ 26 | --sysconfdir=/etc 27 | 28 | make 29 | } 30 | 31 | package() { 32 | cd $pkgname-$pkgver 33 | make DESTDIR=$pkgdir install 34 | } 35 | -------------------------------------------------------------------------------- /land/freetype/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=freetype 2 | pkgver=2.9 3 | pkgrel=1 4 | pkgdesc="FreeType is a freely available software library to render fonts." 5 | arch=('i786') 6 | url="https://freetype.org/" 7 | makedepends=('zlib' 'libpng') 8 | source=( 9 | 'https://download.savannah.gnu.org/releases/freetype/freetype-2.9.tar.gz' 10 | 'freetype-2.9.patch' 11 | ) 12 | sha256sums=( 13 | 'bf380e4d7c4f3b5b1c1a7b2bf3abb967bda5e9ab480d0df656e0e08c5019c5e6' 14 | 'SKIP' 15 | ) 16 | 17 | prepare() { 18 | patch -p0 < freetype-2.9.patch 19 | } 20 | 21 | build() { 22 | cd $pkgname-$pkgver 23 | ./configure \ 24 | --host=i786-pc-xelix \ 25 | --prefix=/usr \ 26 | --sysconfdir=/etc 27 | 28 | make 29 | } 30 | 31 | package() { 32 | cd $pkgname-$pkgver 33 | make DESTDIR=$pkgdir install 34 | } 35 | -------------------------------------------------------------------------------- /ext/picotcp/pico_xelix.h: -------------------------------------------------------------------------------- 1 | #ifndef PICO_SUPPORT_XELIX 2 | #define PICO_SUPPORT_XELIX 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | // #define dbg(args...) log(LOG_INFO, "picotcp: " args); 9 | #define dbg(...) 10 | 11 | #define stack_fill_pattern(...) do {} while(0) 12 | #define stack_count_free_words(...) do {} while(0) 13 | #define stack_get_free_words() (0) 14 | 15 | #define pico_zalloc(x) zmalloc(x) 16 | #define pico_free(x) kfree(x) 17 | 18 | static inline uint32_t PICO_TIME(void) { 19 | return time_get(); 20 | } 21 | 22 | static inline uint64_t PICO_TIME_MS(void) { 23 | return (uint64_t)(time_get() * 1000); 24 | } 25 | 26 | static inline void PICO_IDLE(void) { 27 | //usleep(5000); 28 | } 29 | 30 | #endif /* PICO_SUPPORT_XELIX */ 31 | 32 | -------------------------------------------------------------------------------- /land/dialog/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=dialog 2 | pkgver=1.3.20191210 3 | pkgrel=1 4 | pkgdesc="Display dialog boxes from shell scripts." 5 | arch=('i786') 6 | depends=('ncurses') 7 | source=( 8 | 'https://invisible-island.net/archives/dialog/dialog-1.3-20191210.tgz' 9 | 'dialog-1.3-20191210.patch' 10 | ) 11 | sha256sums=( 12 | '10f7c02ee5dea311e61b0d3e29eb6e18bcedd6fb6672411484c1a37729cbd7a6' 13 | 'SKIP' 14 | ) 15 | 16 | prepare() { 17 | patch -p0 < dialog-1.3-20191210.patch 18 | } 19 | 20 | build() { 21 | cd dialog-1.3-20191210 22 | ./configure \ 23 | --host=i786-pc-xelix \ 24 | --disable-shared \ 25 | --enable-static \ 26 | --prefix=/usr \ 27 | --sysconfdir=/etc 28 | 29 | make 30 | } 31 | 32 | package() { 33 | cd dialog-1.3-20191210 34 | make DESTDIR=$pkgdir install 35 | } 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Xelix kernel 2 | 3 | Xelix is a hobby POSIX kernel and operating system for x86. It has a largely GNU-based userland and can run many common \*nix programs. 4 | 5 | Releases, build instructions and code documentation can be found at https://xelix.org (or in the `docs` folder). 6 | 7 | ## Features 8 | 9 | * Preemptive multitasking with privilege and memory separation 10 | * POSIX process API with fork/execve/wait and signal handling 11 | * VFS with support for dynamic mount points, poll, pipes, and in-memory file trees 12 | * Read/write ext2 implementation, IDE and virtio-block drivers 13 | * BSD socket API for TCP/IP support using the [PicoTCP network stack](https://github.com/tass-belgium/picotcp) 14 | * Terminal framework with support for multiple TTYs, pseudo terminals & ECMA48 escape sequences 15 | -------------------------------------------------------------------------------- /land/base/etc/profile: -------------------------------------------------------------------------------- 1 | # /etc/profile 2 | 3 | # If not running interactively, don't do anything 4 | [ -z "$PS1" ] && return 5 | 6 | # don't put duplicate lines or lines starting with space in the history. 7 | # See bash(1) for more options 8 | HISTCONTROL=ignoreboth 9 | 10 | # append to the history file, don't overwrite it 11 | shopt -s histappend 12 | 13 | # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) 14 | HISTSIZE=1000 15 | HISTFILESIZE=2000 16 | 17 | # check the window size after each command and, if necessary, 18 | # update the values of LINES and COLUMNS. 19 | shopt -s checkwinsize 20 | 21 | export PATH="/usr/bin" 22 | export PS1='[\u@\h \W]\$ ' 23 | export TERM='xelix' 24 | export HOME=~ 25 | export LANG='EN_US.utf-8' 26 | export TZ='Europe/Brussels' 27 | 28 | alias ls='ls --color=auto' 29 | -------------------------------------------------------------------------------- /THANKS: -------------------------------------------------------------------------------- 1 | Xelix THANKS file 2 | 3 | Xelix has originally been written by Lukas Martini. Many 4 | people further contributed to Xelix by reporting problems, 5 | suggesting various improvements or submitting actual code. 6 | Here is a list of these people. Help me keep it complete and 7 | exempt of errors. 8 | 9 | - Christoph Sünderhauf (Christoph) 10 | - Benjamin Richter (Waldteufel) 11 | - Jan Zaeske (Tagkaffee) 12 | - Fritz Grimpen (Fritz) 13 | - Tom Bock (Barbers) 14 | - Simon Elsbrock (Else) 15 | - Nick Johnson (nickbjohnson4224) 16 | – Marco Paland for the printf() implementation 17 | - Eyal Rozenberg for printf improvements 18 | -------------------------------------------------------------------------------- /land/grep/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=grep 2 | pkgver=3.1 3 | pkgrel=2 4 | pkgdesc="Grep searches one or more input files for lines containing a match to a specified pattern." 5 | arch=('i786') 6 | url="https://www.gnu.org/software/grep/" 7 | source=( 8 | 'https://ftp.gnu.org/gnu/grep/grep-3.1.tar.xz' 9 | 'grep-3.1.patch' 10 | ) 11 | sha256sums=( 12 | 'db625c7ab3bb3ee757b3926a5cfa8d9e1c3991ad24707a83dde8a5ef2bf7a07e' 13 | 'SKIP' 14 | ) 15 | 16 | prepare() { 17 | patch -p0 < ../grep-3.1.patch 18 | } 19 | 20 | build() { 21 | cd $pkgname-$pkgver 22 | ./configure \ 23 | --host=i786-pc-xelix \ 24 | --prefix=/usr \ 25 | --sysconfdir=/etc 26 | make 27 | } 28 | 29 | package() { 30 | cd $pkgname-$pkgver 31 | make DESTDIR=$pkgdir install 32 | 33 | # Empty and conflicts with diffutils 34 | rm $pkgdir/usr/lib/charset.alias 35 | } 36 | -------------------------------------------------------------------------------- /land/libpng/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=libpng 2 | pkgver=1.6.37 3 | pkgrel=1 4 | pkgdesc="libpng is the official PNG reference library." 5 | arch=('i786') 6 | makedepend=('zlib') 7 | url="http://www.libpng.org/pub/png/libpng.html" 8 | source=( 9 | 'http://prdownloads.sourceforge.net/libpng/libpng-1.6.37.tar.xz?download' 10 | 'libpng.patch' 11 | ) 12 | sha256sums=( 13 | '505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca' 14 | 'SKIP' 15 | ) 16 | 17 | prepare() { 18 | cd $pkgname-$pkgver 19 | patch -p0 < ../$pkgname.patch 20 | } 21 | 22 | build() { 23 | cd $pkgname-$pkgver 24 | ./configure \ 25 | --host=i786-pc-xelix \ 26 | --prefix=/usr \ 27 | --sysconfdir=/etc \ 28 | --enable-hardware-optimizations 29 | 30 | make 31 | } 32 | 33 | package() { 34 | cd $pkgname-$pkgver 35 | make DESTDIR=$pkgdir install 36 | } 37 | -------------------------------------------------------------------------------- /land/tzdb/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=tzdb 2 | pkgver=2019a 3 | pkgrel=2 4 | pkgdesc="The Time Zone Database (often called tz or zoneinfo) contains code and data that represent the history of local time for many representative locations around the globe." 5 | arch=('i786') 6 | url="https://www.iana.org/time-zones" 7 | source=( 8 | "https://data.iana.org/time-zones/releases/tzdb-$pkgver.tar.lz" 9 | "tz.patch" 10 | ) 11 | sha256sums=( 12 | '16d10794dd8de8eb21abbf21e74020b5e1b0227ea1f094299b0b4467954eecc7' 13 | 'SKIP' 14 | ) 15 | 16 | prepare() { 17 | cd $pkgname-$pkgver 18 | patch -p0 < ../tz.patch 19 | } 20 | 21 | build() { 22 | cd $pkgname-$pkgver 23 | make CC=i786-pc-xelix-gcc ZICDIR=/usr/bin 24 | } 25 | 26 | package() { 27 | cd $pkgname-$pkgver 28 | make CC=i786-pc-xelix-gcc ZIC=zic ZICDIR=/usr/bin DESTDIR=$pkgdir install 29 | } 30 | -------------------------------------------------------------------------------- /src/tty/pty.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2019 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | void pty_init(void); 22 | -------------------------------------------------------------------------------- /src/gfx/mouse.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2020 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | void gfx_mouse_init(void); 22 | -------------------------------------------------------------------------------- /src/int/i386-idt.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2018 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | void idt_init(void); 22 | -------------------------------------------------------------------------------- /src/lib/version.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2019 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | void version_init(void); 22 | -------------------------------------------------------------------------------- /docs/int.md: -------------------------------------------------------------------------------- 1 | # Interrupts 2 | 3 | x86 interrupt gates are set up during early startup in `int/i386-idt.c`. Since x86 interrupts do not pass their number in a register, we need to set each interrupt gate to a different handler so we can figure out which interrupt was invoked. The handlers for each interrupt gate are generated in `src/int/i386-interrupts.asm` using a preprocessor loop. 4 | 5 | Some interrupts/exceptions also automatically push an additional error code on the stack. To make sure we can store the data for interrupts that don't push an error code in the same struct, their handlers push a placeholder 0 here. 6 | 7 | Afterwards, these interrupt-specific handlers pass control to the generic assembly interrupt handler `int_i386_dispatch`, which in turn invokes the C interrupt handler `int_dispatch`. 8 | 9 | ## Context switching 10 | -------------------------------------------------------------------------------- /src/block/null.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2018 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | void block_null_init(void); 22 | -------------------------------------------------------------------------------- /src/block/virtio.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2019 Luaks Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | void virtio_block_init(void); 22 | -------------------------------------------------------------------------------- /src/gfx/gfxbus.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2020 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | void tty_gfxbus_init(void); 22 | -------------------------------------------------------------------------------- /src/net/virtio_net.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2019 Luaks Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | void virtio_net_init(void); 22 | -------------------------------------------------------------------------------- /land/gmp/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=gmp 2 | pkgver=6.2.0 3 | pkgrel=1 4 | pkgdesc="GMP is a free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating-point numbers." 5 | arch=('i786') 6 | url="https://gmplib.org" 7 | source=( 8 | 'https://gmplib.org/download/gmp/gmp-6.2.0.tar.xz' 9 | 'gmp-6.2.0.patch' 10 | ) 11 | sha256sums=( 12 | '258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526' 13 | 'SKIP' 14 | ) 15 | 16 | prepare() { 17 | cd $pkgname-$pkgver 18 | patch -p0 < ../gmp-6.2.0.patch 19 | } 20 | 21 | build() { 22 | cd $pkgname-$pkgver 23 | CC=i786-pc-xelix-gcc ./configure \ 24 | --host=i786-pc-xelix \ 25 | --prefix=/usr \ 26 | --sysconfdir=/etc \ 27 | --disable-shared 28 | make 29 | } 30 | 31 | package() { 32 | cd $pkgname-$pkgver 33 | make DESTDIR=$pkgdir install 34 | } 35 | -------------------------------------------------------------------------------- /land/tmux/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=tmux 2 | pkgver=3.3a 3 | pkgrel=1 4 | pkgdesc="tmux is a terminal multiplexer: it enables a number of terminals to be created, accessed, and controlled from a single screen." 5 | arch=('i786') 6 | url="https://github.com/tmux/tmux" 7 | source=( 8 | 'https://github.com/tmux/tmux/releases/download/3.3a/tmux-3.3a.tar.gz' 9 | "$pkgname-$pkgver.patch" 10 | ) 11 | sha256sums=( 12 | 'e4fd347843bd0772c4f48d6dde625b0b109b7a380ff15db21e97c11a4dcdf93f' 13 | 'SKIP' 14 | ) 15 | 16 | prepare() { 17 | cd $pkgname-$pkgver 18 | patch -p0 < ../$pkgname-$pkgver.patch 19 | } 20 | 21 | build() { 22 | cd $pkgname-$pkgver 23 | ./configure \ 24 | --host=i786-pc-xelix \ 25 | --prefix=/usr \ 26 | --sysconfdir=/etc 27 | 28 | make 29 | } 30 | 31 | package() { 32 | cd $pkgname-$pkgver 33 | make DESTDIR=$pkgdir install 34 | } 35 | -------------------------------------------------------------------------------- /src/net/i386-rtl8139.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2011 Fritz Grimpen 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | 22 | void rtl8139_init(void); 23 | -------------------------------------------------------------------------------- /land/newlib/xelix/include/err.h: -------------------------------------------------------------------------------- 1 | #ifndef _ERR_H 2 | #define _ERR_H 1 3 | 4 | #include 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | void err(int eval, const char *fmt, ...); 11 | void verr(int eval, const char *fmt, va_list args); 12 | void errc(int eval, int code, const char *fmt, ...); 13 | void verrc(int eval, int code, const char *fmt, va_list args); 14 | void errx(int eval, const char *fmt, ...); 15 | void verrx(int eval, const char *fmt, va_list args); 16 | void warn(const char *fmt, ...); 17 | void vwarn(const char *fmt, va_list args); 18 | void warnc(int code, const char *fmt, ...); 19 | void vwarnc(int code, const char *fmt, va_list args); 20 | void warnx(const char *fmt, ...); 21 | void vwarnx(const char *fmt, va_list args); 22 | 23 | #ifdef __cplusplus 24 | } /* C++ */ 25 | #endif 26 | #endif /* err.h */ 27 | -------------------------------------------------------------------------------- /src/tasks/exception.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2010-2020 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | void task_exception_init(void); 22 | -------------------------------------------------------------------------------- /land/mpfr/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=mpfr 2 | pkgver=4.1.0 3 | pkgrel=1 4 | pkgdesc="The MPFR library is a C library for multiple-precision floating-point computations with correct rounding." 5 | arch=('i786') 6 | depend=('gmp') 7 | url="https://www.mpfr.org" 8 | source=( 9 | "https://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver/$pkgname-$pkgver.tar.xz" 10 | "$pkgname-$pkgver.patch" 11 | ) 12 | sha256sums=( 13 | '0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f' 14 | 'SKIP' 15 | ) 16 | 17 | prepare() { 18 | cd $pkgname-$pkgver 19 | patch -p0 < ../$pkgname-$pkgver.patch 20 | } 21 | 22 | build() { 23 | cd $pkgname-$pkgver 24 | ./configure \ 25 | --host=i786-pc-xelix \ 26 | --prefix=/usr \ 27 | --sysconfdir=/etc \ 28 | --disable-shared 29 | make 30 | } 31 | 32 | package() { 33 | cd $pkgname-$pkgver 34 | make DESTDIR=$pkgdir install 35 | } 36 | -------------------------------------------------------------------------------- /land/nghttp2/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=nghttp2 2 | pkgver=1.58.0 3 | pkgrel=1 4 | epoch= 5 | pkgdesc="This is an implementation of the Hypertext Transfer Protocol version 2 in C." 6 | arch=('i786') 7 | arch_override=('i786') 8 | url="https://nghttp2.org" 9 | license=('GPL') 10 | makedepend=() 11 | source=('https://github.com/nghttp2/nghttp2/releases/download/v1.58.0/nghttp2-1.58.0.tar.xz') 12 | sha256sums=('4a68a3040da92fd9872c056d0f6b0cd60de8410de10b578f8ade9ecc14d297e0') 13 | 14 | prepare() { 15 | cd $pkgname-$pkgver 16 | echo -e "#!/bin/sh\necho i786-pc-xelix" > config.sub 17 | } 18 | 19 | build() { 20 | cd $pkgname-$pkgver 21 | ./configure \ 22 | --host=i786-pc-xelix \ 23 | --prefix=/usr \ 24 | --sysconfdir=/etc \ 25 | --enable-lib-only 26 | 27 | make 28 | } 29 | 30 | package() { 31 | cd $pkgname-$pkgver 32 | make DESTDIR=$pkgdir install 33 | } 34 | -------------------------------------------------------------------------------- /land/pcre2/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=pcre2 2 | pkgver=10.32 3 | pkgrel=1 4 | pkgdesc="The PCRE2 library is a set of C functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5." 5 | arch=('i786') 6 | url="https://github.com/PCRE2Project/pcre2" 7 | source=( 8 | 'https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.32/pcre2-10.32.tar.bz2' 9 | "$pkgname-$pkgver.patch" 10 | ) 11 | sha256sums=( 12 | 'f29e89cc5de813f45786580101aaee3984a65818631d4ddbda7b32f699b87c2e' 13 | 'SKIP' 14 | ) 15 | 16 | prepare() { 17 | patch -p0 < $pkgname-$pkgver.patch 18 | } 19 | 20 | build() { 21 | cd $pkgname-$pkgver 22 | ./configure \ 23 | --host=i786-pc-xelix \ 24 | --prefix=/usr \ 25 | --sysconfdir=/etc 26 | 27 | make 28 | } 29 | 30 | package() { 31 | cd $pkgname-$pkgver 32 | make DESTDIR=$pkgdir install 33 | } 34 | -------------------------------------------------------------------------------- /land/diffutils/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=diffutils 2 | pkgver=3.6 3 | pkgrel=2 4 | pkgdesc="GNU Diffutils is a package of several programs related to finding differences between files." 5 | arch=('i786') 6 | url="https://www.gnu.org/software/diffutils/" 7 | source=( 8 | 'https://ftp.gnu.org/gnu/diffutils/diffutils-3.6.tar.xz' 9 | 'diffutils-3.6.patch' 10 | ) 11 | sha256sums=( 12 | 'd621e8bdd4b573918c8145f7ae61817d1be9deb4c8d2328a65cea8e11d783bd6' 13 | 'SKIP' 14 | ) 15 | 16 | prepare() { 17 | patch -p0 < diffutils-3.6.patch 18 | } 19 | 20 | build() { 21 | cd $pkgname-$pkgver 22 | ./configure \ 23 | --host=i786-pc-xelix \ 24 | --prefix=/usr \ 25 | --sysconfdir=/etc 26 | 27 | make 28 | } 29 | 30 | package() { 31 | cd $pkgname-$pkgver 32 | make DESTDIR=$pkgdir install 33 | 34 | # Empty and conflicts with grep 35 | rm $pkgdir/usr/lib/charset.alias 36 | } 37 | -------------------------------------------------------------------------------- /land/libedit/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=libedit 2 | pkgver=20191231.3.1 3 | pkgrel=1 4 | pkgdesc="This is an autotool- and libtoolized port of the NetBSD Editline library (libedit)." 5 | arch=('i786') 6 | depends=('ncurses') 7 | url="https://thrysoee.dk/editline/" 8 | source=( 9 | 'https://thrysoee.dk/editline/libedit-20191231-3.1.tar.gz' 10 | 'libedit-20191231-3.1.patch' 11 | ) 12 | sha256sums=( 13 | 'dbb82cb7e116a5f8025d35ef5b4f7d4a3cdd0a3909a146a39112095a2d229071' 14 | 'SKIP' 15 | ) 16 | 17 | prepare() { 18 | patch -p0 < libedit-20191231-3.1.patch 19 | } 20 | 21 | build() { 22 | cd libedit-20191231-3.1 23 | ./configure \ 24 | --host=i786-pc-xelix \ 25 | --prefix=/usr \ 26 | --sysconfdir=/etc \ 27 | --disable-shared \ 28 | --disable-widec 29 | 30 | make 31 | } 32 | 33 | package() { 34 | cd libedit-20191231-3.1 35 | make DESTDIR=$pkgdir install 36 | } 37 | -------------------------------------------------------------------------------- /land/nghttp3/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=nghttp3 2 | pkgver=1.0.0 3 | pkgrel=2 4 | epoch= 5 | pkgdesc="HTTP/3 library written in C" 6 | arch=('i786') 7 | arch_override=('i786') 8 | url="https://nghttp2.org/nghttp3/" 9 | license=('GPL') 10 | makedepend=('openssl-quic') 11 | source=('https://github.com/ngtcp2/nghttp3/releases/download/v1.0.0/nghttp3-1.0.0.tar.xz') 12 | sha256sums=('2d982fadb92ba6488cd5ef3dadc9d2c901084c812553aea9ab1c4bfa1215f77a') 13 | 14 | prepare() { 15 | cd $pkgname-$pkgver 16 | echo -e "#!/bin/sh\necho i786-pc-xelix" > config.sub 17 | } 18 | 19 | build() { 20 | cd $pkgname-$pkgver 21 | CPPFLAGS="$CPPFLAGS -D__int64_t_defined" ./configure \ 22 | --host=i786-pc-xelix \ 23 | --prefix=/usr \ 24 | --sysconfdir=/etc \ 25 | --enable-lib-only 26 | 27 | make 28 | } 29 | 30 | package() { 31 | cd $pkgname-$pkgver 32 | make DESTDIR=$pkgdir install 33 | } 34 | -------------------------------------------------------------------------------- /land/e2fsprogs/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=e2fsprogs 2 | pkgver=1.45.5 3 | pkgrel=1 4 | pkgdesc="Filesystem utilities for use with the ext2 filesystem." 5 | arch=('i786') 6 | url="https://e2fsprogs.sourceforge.net/" 7 | source=( 8 | 'https://mirrors.edge.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v1.45.5/e2fsprogs-1.45.5.tar.xz' 9 | 'e2fsprogs.patch' 10 | ) 11 | sha256sums=( 12 | 'f9faccc0d90f73556e797dc7cc5979b582bd50d3f8609c0f2ad48c736d44aede' 13 | 'SKIP' 14 | ) 15 | 16 | prepare() { 17 | cd $pkgname-$pkgver 18 | patch -p0 < ../e2fsprogs.patch 19 | } 20 | 21 | build() { 22 | cd $pkgname-$pkgver 23 | 24 | autoconf 25 | ./configure \ 26 | --host=i786-pc-xelix \ 27 | --prefix=/usr \ 28 | --sysconfdir=/etc \ 29 | --sbindir=/usr/bin \ 30 | --disable-nls 31 | make 32 | } 33 | 34 | package() { 35 | cd $pkgname-$pkgver 36 | make DESTDIR=$pkgdir install 37 | } 38 | -------------------------------------------------------------------------------- /land/nano/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=nano 2 | pkgver=4.2 3 | pkgrel=1 4 | pkgdesc="GNU nano is a small and friendly text editor." 5 | arch=('i786') 6 | depend=('ncurses') 7 | url="https://www.nano-editor.org" 8 | source=( 9 | 'https://www.nano-editor.org/dist/v4/nano-4.2.tar.xz' 10 | "$pkgname-$pkgver.patch" 11 | 'nanorc' 12 | ) 13 | sha256sums=( 14 | '1143defce62e391b241252ffdb6e5c1ded56cfe26d46ee81b796abe0ccc45df9' 15 | 'SKIP' 16 | 'SKIP' 17 | ) 18 | 19 | prepare() { 20 | patch -p0 < $pkgname-$pkgver.patch 21 | } 22 | 23 | build() { 24 | cd $pkgname-$pkgver 25 | ./configure \ 26 | --host=i786-pc-xelix \ 27 | --prefix=/usr \ 28 | --sysconfdir=/etc \ 29 | --disable-largefile \ 30 | --disable-threads \ 31 | --disable-speller \ 32 | --disable-mouse 33 | 34 | make 35 | } 36 | 37 | package() { 38 | cd $pkgname-$pkgver 39 | make DESTDIR=$pkgdir install 40 | } 41 | -------------------------------------------------------------------------------- /src/sound/i386-ac97.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2015, 2016 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | void ac97_play(char* file); 22 | void ac97_init(void); 23 | -------------------------------------------------------------------------------- /src/block/random.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2019 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | void block_random_seed(uint64_t seed); 22 | void block_random_init(void); 23 | -------------------------------------------------------------------------------- /src/fs/pipe.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2019 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | #include 22 | 23 | int vfs_pipe(task_t* task, int fildes[2]); 24 | -------------------------------------------------------------------------------- /land/mpc/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=mpc 2 | pkgver=1.2.0 3 | pkgrel=1 4 | pkgdesc="GNU MPC is a C library for the arithmetic of complex numbers with arbitrarily high precision and correct rounding of the result." 5 | arch=('i786') 6 | makedepend=('gmp' 'mpfr') 7 | url="https://www.multiprecision.org" 8 | source=( 9 | "https://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.gz" 10 | "$pkgname-$pkgver.patch" 11 | ) 12 | sha256sums=( 13 | 'e90f2d99553a9c19911abdb4305bf8217106a957e3994436428572c8dfe8fda6' 14 | 'SKIP' 15 | ) 16 | 17 | prepare() { 18 | cd $pkgname-$pkgver 19 | patch -p0 < ../$pkgname-$pkgver.patch 20 | } 21 | 22 | build() { 23 | cd $pkgname-$pkgver 24 | ./configure \ 25 | --host=i786-pc-xelix \ 26 | --prefix=/usr \ 27 | --sysconfdir=/etc \ 28 | --disable-shared 29 | 30 | make 31 | } 32 | 33 | package() { 34 | cd $pkgname-$pkgver 35 | make DESTDIR=$pkgdir install 36 | } 37 | -------------------------------------------------------------------------------- /src/lib/variadic.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2019 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | uintptr_t variadic_call(syscall_cb handler, int num_args, uintptr_t* args); 22 | -------------------------------------------------------------------------------- /src/net/i386-ne2k.h: -------------------------------------------------------------------------------- 1 | /* Copyright © 2018 Lukas Martini 2 | * 3 | * This file is part of Xelix. 4 | * 5 | * Xelix is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * Xelix is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with Xelix. If not, see . 17 | */ 18 | 19 | #ifdef CONFIG_ENABLE_NE2K 20 | 21 | void ne2k_init(void); 22 | 23 | #endif /* CONFIG_ENABLE_NE2K */ 24 | -------------------------------------------------------------------------------- /src/tasks/execdata.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2018 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | #include 22 | 23 | void task_setup_execdata(task_t* task); 24 | -------------------------------------------------------------------------------- /land/libarchive/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=libarchive 2 | pkgver=3.7.2 3 | pkgrel=1 4 | pkgdesc="Multi-format archive and compression library" 5 | arch=('i786') 6 | makedepends=('libxml2' 'openssl' 'bzip2' 'zlib' 'libiconv' 'xz') 7 | url="https://www.libarchive.org/" 8 | source=( 9 | 'https://github.com/libarchive/libarchive/releases/download/v3.7.2/libarchive-3.7.2.tar.xz' 10 | 'libarchive-3.7.2.patch' 11 | ) 12 | sha256sums=( 13 | '04357661e6717b6941682cde02ad741ae4819c67a260593dfb2431861b251acb' 14 | 'SKIP' 15 | ) 16 | 17 | prepare() { 18 | cd $pkgname-$pkgver 19 | patch -p0 < ../libarchive-3.7.2.patch 20 | } 21 | 22 | build() { 23 | cd $pkgname-$pkgver 24 | LIBS="-lxml2 -lz -llzma -lm" ./configure \ 25 | --host=i786-pc-xelix \ 26 | --prefix=/usr \ 27 | --sysconfdir=/etc 28 | 29 | make 30 | } 31 | 32 | package() { 33 | cd $pkgname-$pkgver 34 | make DESTDIR=$pkgdir install 35 | } 36 | -------------------------------------------------------------------------------- /land/ngtcp2/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=ngtcp2 2 | pkgver=1.0.1 3 | pkgrel=1 4 | epoch= 5 | pkgdesc="ngtcp2 project is an effort to implement IETF QUIC protocol." 6 | arch=('i786') 7 | arch_override=('i786') 8 | url="https://nghttp2.org/ngtcp2/" 9 | license=('GPL') 10 | makedepend=('openssl-quic') 11 | source=('https://github.com/ngtcp2/ngtcp2/releases/download/v1.0.1/ngtcp2-1.0.1.tar.xz') 12 | sha256sums=('21c898fa5543d3f2dc203fd0a300a8a7cb70fec21ad7f7a3ec6e119ba4850451') 13 | 14 | prepare() { 15 | cd $pkgname-$pkgver 16 | echo -e "#!/bin/sh\necho i786-pc-xelix" > config.sub 17 | } 18 | 19 | build() { 20 | cd $pkgname-$pkgver 21 | CPPFLAGS="$CPPFLAGS -D__int64_t_defined" ./configure \ 22 | --host=i786-pc-xelix \ 23 | --prefix=/usr \ 24 | --sysconfdir=/etc \ 25 | --with-openssl 26 | 27 | make 28 | } 29 | 30 | package() { 31 | cd $pkgname-$pkgver 32 | make DESTDIR=$pkgdir install 33 | } 34 | -------------------------------------------------------------------------------- /land/htop/xelix/XelixProcess.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_XelixProcess 2 | #define HEADER_XelixProcess 3 | /* 4 | htop - Xelix/XelixProcess.h 5 | (C) 2015 Hisham H. Muhammad 6 | (C) 2017 Diederik de Groot 7 | Released under the GNU GPLv2, see the COPYING file 8 | in the source distribution for its full text. 9 | */ 10 | 11 | typedef struct XelixProcess_ { 12 | Process super; 13 | } XelixProcess; 14 | 15 | #define Process_isKernelThread(_process) (false) 16 | 17 | //#define Process_isUserlandThread(_process) (_process->pid != _process->tgid) 18 | #define Process_isUserlandThread(_process) (false) 19 | 20 | extern const ProcessClass XelixProcess_class; 21 | 22 | extern const ProcessFieldData Process_fields[LAST_PROCESSFIELD]; 23 | 24 | Process* XelixProcess_new(const Settings* settings); 25 | 26 | void Process_delete(Object* cast); 27 | 28 | bool Process_isThread(const Process* this); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /land/libtextstyle/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=libtextstyle 2 | pkgver=0.8 3 | pkgrel=1 4 | pkgdesc="GNU libtextstyle provides an easy way to add styling to programs that produce output to a console or terminal emulator window." 5 | arch=('i786') 6 | depend=('ncurses') 7 | url="https://www.gnu.org/software/gettext/libtextstyle/manual/libtextstyle.html" 8 | source=( 9 | 'https://alpha.gnu.org/gnu/gettext/libtextstyle-0.8.tar.gz' 10 | "$pkgname.patch" 11 | ) 12 | sha256sums=( 13 | '5cd91ef7683111af2734095e00f4ee4995c916cf32ea38e314aee251f8683216' 14 | 'SKIP' 15 | ) 16 | 17 | prepare() { 18 | cd $pkgname-$pkgver 19 | patch -p0 < ../$pkgname.patch 20 | } 21 | 22 | build() { 23 | cd $pkgname-$pkgver 24 | ./configure \ 25 | --host=i786-pc-xelix \ 26 | --prefix=/usr \ 27 | --sysconfdir=/etc 28 | 29 | make 30 | } 31 | 32 | package() { 33 | cd $pkgname-$pkgver 34 | make DESTDIR=$pkgdir install 35 | } 36 | -------------------------------------------------------------------------------- /src/tty/console.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2023 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | extern struct term* term_console; 22 | 23 | void tty_console_init(int cols, int rows); 24 | -------------------------------------------------------------------------------- /src/fs/ext2.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2013-2020 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | #include 22 | 23 | int ext2_mount(struct vfs_block_dev* dev, const char* path); 24 | -------------------------------------------------------------------------------- /land/pixman/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=pixman 2 | pkgver=0.38.4 3 | pkgrel=1 4 | pkgdesc="Pixman is a low-level software library for pixel manipulation, providing features such as image compositing and trapezoid rasterization." 5 | arch=('i786') 6 | url="https://pixman.org" 7 | source=( 8 | 'https://cairographics.org/releases/pixman-0.38.4.tar.gz' 9 | "$pkgname.patch" 10 | ) 11 | sha256sums=( 12 | 'da66d6fd6e40aee70f7bd02e4f8f76fc3f006ec879d346bae6a723025cfbdde7' 13 | 'SKIP' 14 | ) 15 | 16 | prepare() { 17 | cd $pkgname-$pkgver 18 | patch -p0 < ../$pkgname.patch 19 | } 20 | 21 | build() { 22 | cd $pkgname-$pkgver 23 | CFLAGS="-DPIXMAN_NO_TLS" ./configure \ 24 | --host=i786-pc-xelix \ 25 | --prefix=/usr \ 26 | --sysconfdir=/etc \ 27 | --localstatedir=/var \ 28 | --disable-mmx \ 29 | --disable-vmx 30 | 31 | make 32 | } 33 | 34 | package() { 35 | cd $pkgname-$pkgver 36 | make DESTDIR=$pkgdir install 37 | } 38 | -------------------------------------------------------------------------------- /land/base/etc/inputrc: -------------------------------------------------------------------------------- 1 | # do not bell on tab-completion 2 | set bell-style none 3 | 4 | set meta-flag on 5 | set input-meta on 6 | set convert-meta off 7 | set output-meta on 8 | 9 | $if mode=emacs 10 | 11 | Control-l: clear-screen 12 | 13 | # for linux console and RH/Debian xterm 14 | "\e[1~": beginning-of-line 15 | "\e[4~": end-of-line 16 | "\e[5~": beginning-of-history 17 | "\e[6~": end-of-history 18 | "\e[7~": beginning-of-line 19 | "\e[3~": delete-char 20 | "\e[2~": quoted-insert 21 | "\e[5C": forward-word 22 | "\e[5D": backward-word 23 | "\e\e[C": forward-word 24 | "\e\e[D": backward-word 25 | "\e[1;5C": forward-word 26 | "\e[1;5D": backward-word 27 | 28 | # for rxvt 29 | "\e[8~": end-of-line 30 | 31 | # for non RH/Debian xterm, can't hurt for RH/DEbian xterm 32 | "\eOH": beginning-of-line 33 | "\eOF": end-of-line 34 | 35 | # for freebsd console 36 | "\e[H": beginning-of-line 37 | "\e[F": end-of-line 38 | $endif 39 | -------------------------------------------------------------------------------- /land/libxml2/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=libxml2 2 | pkgver=2.9.9 3 | pkgrel=2 4 | pkgdesc="libxml2 is an XML toolkit implemented in C, originally developed for the GNOME Project." 5 | arch=('i786') 6 | makedepend=('zlib' 'xz') 7 | url="https://gitlab.gnome.org/GNOME/libxml2" 8 | source=( 9 | 'https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.9.tar.xz' 10 | "$pkgname-$pkgver.patch" 11 | ) 12 | sha256sums=( 13 | '58a5c05a2951f8b47656b676ce1017921a29f6b1419c45e3baed0d6435ba03f5' 14 | 'SKIP' 15 | ) 16 | 17 | prepare() { 18 | patch -p0 < $pkgname-$pkgver.patch 19 | } 20 | 21 | build() { 22 | cd $pkgname-$pkgver 23 | ./configure \ 24 | --host=i786-pc-xelix \ 25 | --prefix=/usr \ 26 | --sysconfdir=/etc \ 27 | --without-threads \ 28 | --without-http \ 29 | --without-ftp \ 30 | --without-python 31 | 32 | make -j$(nproc) 33 | } 34 | 35 | package() { 36 | cd $pkgname-$pkgver 37 | make DESTDIR=$pkgdir install 38 | } 39 | -------------------------------------------------------------------------------- /land/newlib/xelix/include/netinet/tcp.h: -------------------------------------------------------------------------------- 1 | /* Copyright © 2019 Lukas Martini 2 | * 3 | * This file is part of Xelix. 4 | * 5 | * Xelix is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * Xelix is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with Xelix. If not, see . 17 | */ 18 | 19 | #ifndef _NETINET_TCP_H 20 | #define _NETINET_TCP_H 21 | 22 | #define TCP_NODELAY 1 23 | 24 | #endif /* _NETINET_TCP_H */ 25 | -------------------------------------------------------------------------------- /land/htop/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=htop 2 | pkgver=3.0.5 3 | pkgrel=1 4 | pkgdesc="An interactive process viewer" 5 | arch=('i786') 6 | url="https://htop.dev/" 7 | depend=('ncurses') 8 | source=( 9 | 'https://github.com/htop-dev/htop/archive/refs/tags/3.0.5.tar.gz' 10 | 'htop.patch' 11 | ) 12 | sha256sums=( 13 | '4c2629bd50895bd24082ba2f81f8c972348aa2298cc6edc6a21a7fa18b73990c' 14 | 'SKIP' 15 | ) 16 | 17 | prepare() { 18 | cd $pkgname-$pkgver 19 | patch -p0 < ../htop.patch 20 | 21 | cp -r ../../xelix . 22 | } 23 | 24 | build() { 25 | cd $pkgname-$pkgver 26 | ./autogen.sh 27 | echo -e "#!/bin/sh\necho i786-pc-xelix" > config.sub 28 | ./configure \ 29 | --host=i786-pc-xelix \ 30 | --prefix=/usr \ 31 | --sysconfdir=/etc \ 32 | --program-transform-name= \ 33 | --disable-unicode \ 34 | --disable-linux_affinity 35 | 36 | make 37 | } 38 | 39 | package() { 40 | cd $pkgname-$pkgver 41 | make DESTDIR=$pkgdir install 42 | } 43 | -------------------------------------------------------------------------------- /src/lib/endian.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2011 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | 22 | #define endian_swap16 __builtin_bswap16 23 | #define endian_swap32 __builtin_bswap32 24 | #define endian_swap64 __builtin_bswap64 25 | -------------------------------------------------------------------------------- /land/ncurses/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=ncurses 2 | pkgver=6.1 3 | pkgrel=1 4 | pkgdesc="The ncurses (new curses) library is a free software emulation of curses in System V Release 4.0 (SVr4), and more." 5 | arch=('i786') 6 | url="https://invisible-island.net/ncurses/announce.html" 7 | source=( 8 | 'https://invisible-island.net/archives/ncurses/ncurses-6.1.tar.gz' 9 | "$pkgname-$pkgver.patch" 10 | 'xelix.terminfo' 11 | ) 12 | sha256sums=( 13 | 'aa057eeeb4a14d470101eff4597d5833dcef5965331be3528c08d99cebaa0d17' 14 | 'SKIP' 15 | 'SKIP' 16 | ) 17 | 18 | prepare() { 19 | patch -p0 < $pkgname-$pkgver.patch 20 | } 21 | 22 | build() { 23 | cd $pkgname-$pkgver 24 | ./configure \ 25 | --host=i786-pc-xelix \ 26 | --prefix=/usr \ 27 | --sysconfdir=/etc \ 28 | --without-cxx-binding 29 | 30 | make 31 | } 32 | 33 | package() { 34 | cd $pkgname-$pkgver 35 | make DESTDIR=$pkgdir install 36 | tic -o $pkgdir/usr/share/terminfo ../xelix.terminfo 37 | } 38 | -------------------------------------------------------------------------------- /util/buildpkgs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | 4 | SCRIPT_DIR="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 5 | LAND_DIR="$SCRIPT_DIR/../land" 6 | source $SCRIPT_DIR/setenv.sh "/tmp/image" 7 | 8 | mkdir "$SCRIPT_DIR/../packages" || true 9 | 10 | for dir in "$@"; do 11 | # Create a new empty sysroot 12 | sudo rm -rf "$SYSROOT" 13 | mkdir -p "$SYSROOT/var/lib/pacman" 14 | 15 | makedepend=() 16 | depend=() 17 | source "$LAND_DIR/$dir/PKGBUILD" 18 | echo -e "Building $pkgname-$pkgver: $pkgdesc\n" 19 | 20 | # Install package build dependencies to the sysroot 21 | need_packages=('base' ${depend[@]} ${makedepend[@]}) 22 | sudo pacman --config "$LAND_DIR/pacman/pacman.linux.conf" --root "$SYSROOT" --noconfirm -Sy "${need_packages[@]}" 23 | sudo rm -vf "$SYSROOT"/usr/lib/*.la 24 | 25 | # Build package 26 | cd "$LAND_DIR/$dir" 27 | makepkg -fAd --sign 28 | mv *.pkg.* "$SCRIPT_DIR/../packages" 29 | cd .. 30 | done 31 | -------------------------------------------------------------------------------- /land/bash/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=bash 2 | pkgver=5.0 3 | pkgrel=1 4 | epoch= 5 | pkgdesc="" 6 | arch=('i786') 7 | url="https://www.gnu.org/software/bash/" 8 | license=('GPL') 9 | source=('https://ftp.gnu.org/gnu/bash/bash-5.0.tar.gz' 'bash-5.0.patch') 10 | sha256sums=( 11 | 'b4a80f2ac66170b2913efbfb9f2594f1f76c7b1afd11f799e22035d63077fb4d' 12 | 'bcf1b6c4e9c5075aae1d2330b9512b714837597fc86e3048284bdadbfb1b2881') 13 | 14 | prepare() { 15 | patch -p0 < $pkgname-$pkgver.patch 16 | 17 | cd $pkgname-$pkgver 18 | # Multiple definitions needed due to conflicting definitions in termcap/libreadline 19 | LDFLAGS="-Wl,--allow-multiple-definition" ./configure \ 20 | --host=i786-pc-xelix \ 21 | --prefix=/usr \ 22 | --sysconfdir=/etc \ 23 | --without-bash-malloc \ 24 | --disable-job-control 25 | } 26 | 27 | build() { 28 | cd $pkgname-$pkgver 29 | make -j$(nproc) 30 | } 31 | 32 | package() { 33 | cd $pkgname-$pkgver 34 | make DESTDIR=$pkgdir install 35 | } 36 | -------------------------------------------------------------------------------- /land/flac/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=flac 2 | pkgver=1.3.3 3 | pkgrel=2 4 | pkgdesc="Free Lossless Audio Codec" 5 | arch=('i786') 6 | url="https://github.com/xiph/flac" 7 | source=( 8 | 'https://ftp.osuosl.org/pub/xiph/releases/flac/flac-1.3.3.tar.xz' 9 | 'flac-1.3.3.patch' 10 | ) 11 | sha256sums=( 12 | '213e82bd716c9de6db2f98bcadbc4c24c7e2efe8c75939a1a84e28539c4e1748' 13 | 'SKIP' 14 | ) 15 | 16 | prepare() { 17 | patch -p0 < flac-1.3.3.patch 18 | } 19 | 20 | build() { 21 | cd $pkgname-$pkgver 22 | CPPFLAGS="$CPPFLAGS -D_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC=0 -D_GLIBCXX_USE_C99_STDLIB=0 -mno-sse" CFLAGS="$CFLAGS -mno-sse" ./configure \ 23 | --host=i786-pc-xelix \ 24 | --prefix=/usr \ 25 | --sysconfdir=/etc \ 26 | --enable-shared \ 27 | --disable-static \ 28 | --disable-asm-optimizations \ 29 | --disable-cpplibs \ 30 | --without-ogg 31 | 32 | make 33 | } 34 | 35 | package() { 36 | cd $pkgname-$pkgver 37 | make DESTDIR=$pkgdir install 38 | } 39 | -------------------------------------------------------------------------------- /land/fontconfig/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=fontconfig 2 | pkgver=2.13.92 3 | pkgrel=1 4 | pkgdesc="Fontconfig is a library for configuring and customizing font access." 5 | arch=('i786') 6 | url="https://www.freedesktop.org/wiki/Software/fontconfig/" 7 | makedepend=('libexpat' 'freetype' 'libpng' 'zlib' 'bzip2') 8 | source=( 9 | 'https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.13.92.tar.xz' 10 | 'fontconfig.patch' 11 | ) 12 | sha256sums=( 13 | '506e61283878c1726550bc94f2af26168f1e9f2106eac77eaaf0b2cdfad66e4e' 14 | 'SKIP' 15 | ) 16 | 17 | prepare() { 18 | cd $pkgname-$pkgver 19 | patch -p0 < ../fontconfig.patch 20 | } 21 | 22 | build() { 23 | cd $pkgname-$pkgver 24 | FREETYPE_LIBS="-lfreetype -lpng -lz -lbz2 -lm" ./configure \ 25 | --host=i786-pc-xelix \ 26 | --prefix=/usr \ 27 | --sysconfdir=/etc \ 28 | --localstatedir=/var 29 | 30 | make 31 | } 32 | 33 | package() { 34 | cd $pkgname-$pkgver 35 | make DESTDIR=$pkgdir install 36 | } 37 | -------------------------------------------------------------------------------- /land/gfxcompd/src/util.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | 9 | FILE* serial; 10 | 11 | static inline void *memset32(uint32_t *s, uint32_t v, size_t n) { 12 | long d0, d1; 13 | asm volatile("rep stosl" 14 | : "=&c" (d0), "=&D" (d1) 15 | : "a" (v), "1" (s), "0" (n) 16 | : "memory"); 17 | return s; 18 | } 19 | 20 | static inline uint32_t rgba_interp(uint32_t src, uint32_t dst, uint32_t t) { 21 | const uint32_t s = 255 - t; 22 | return ( 23 | (((((src >> 0) & 0xff) * s + 24 | ((dst >> 0) & 0xff) * t) >> 8)) | 25 | (((((src >> 8) & 0xff) * s + 26 | ((dst >> 8) & 0xff) * t) ) & ~0xff) | 27 | (((((src >> 16) & 0xff) * s + 28 | ((dst >> 16) & 0xff) * t) << 8) & ~0xffff) | 29 | (((((src >> 24) & 0xff) * s + 30 | ((dst >> 24) & 0xff) * t) << 16) & ~0xffffff) 31 | ); 32 | } 33 | -------------------------------------------------------------------------------- /land/curl/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=curl 2 | pkgver=8.4.0 3 | pkgrel=3 4 | epoch= 5 | pkgdesc="command line tool and library for transferring data with URLs" 6 | arch=('i786') 7 | makedepend=('openssl-quic' 'zlib' 'nghttp2' 'ngtcp2' 'nghttp3') 8 | url="https://curl.se/" 9 | license=('GPL') 10 | source=('https://curl.se/download/curl-8.4.0.tar.xz') 11 | sha256sums=('16c62a9c4af0f703d28bda6d7bbf37ba47055ad3414d70dec63e2e6336f2a82d') 12 | 13 | prepare() { 14 | cd $pkgname-$pkgver 15 | echo -e "#!/bin/sh\necho i786-pc-xelix" > config.sub 16 | } 17 | 18 | build() { 19 | cd $pkgname-$pkgver 20 | ./configure \ 21 | --host=i786-pc-xelix \ 22 | --prefix=/usr \ 23 | --sysconfdir=/etc \ 24 | --disable-threaded-resolver \ 25 | --disable-socketpair \ 26 | --with-openssl \ 27 | --with-zlib \ 28 | --with-nghttp2 \ 29 | --with-ngtcp2 \ 30 | --with-nghttp3 31 | 32 | make 33 | } 34 | 35 | package() { 36 | cd $pkgname-$pkgver 37 | make DESTDIR=$pkgdir install 38 | } 39 | -------------------------------------------------------------------------------- /land/gfxcompd/src/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "util.h" 5 | #include "window.h" 6 | #include "mouse.h" 7 | #include "bus.h" 8 | #include "text.h" 9 | #include "render.h" 10 | #include "bar.h" 11 | 12 | int main(int argc, char* argv[]) { 13 | serial = fopen("/dev/serial1", "w"); 14 | setvbuf(serial, NULL, _IONBF, 0); 15 | 16 | text_init(); 17 | window_init(); 18 | render_init(); 19 | bar_init(); 20 | 21 | int gfxbus_fd = bus_init(); 22 | int mouse_fd = mouse_init(); 23 | 24 | struct pollfd pfds[2] = { 25 | {.fd = mouse_fd, .events = POLLIN}, 26 | {.fd = gfxbus_fd, .events = POLLIN}, 27 | }; 28 | 29 | while(1) { 30 | pfds[0].revents = 0; 31 | pfds[1].revents = 0; 32 | if(poll(pfds, 2, -1) < 1) { 33 | continue; 34 | } 35 | 36 | if(pfds[0].revents & POLLIN) { 37 | handle_mouse(); 38 | } 39 | 40 | if(pfds[1].revents & POLLIN) { 41 | bus_handle_msg(); 42 | update_bar(); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /land/gfxcompd/src/window.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include "render.h" 6 | 7 | struct window { 8 | uint32_t id; 9 | struct window* next; 10 | uint32_t* buffer; 11 | char title[1024]; 12 | 13 | // Window size _excluding_ decoration 14 | size_t width; 15 | size_t height; 16 | 17 | int32_t x; 18 | int32_t y; 19 | int32_t z; 20 | 21 | struct surface* surface; 22 | struct surface* decoration; 23 | }; 24 | 25 | struct window* windows; 26 | struct window* active_window; 27 | 28 | struct window* window_new(uint32_t wid, const char* title, size_t width, size_t height, uint32_t* data); 29 | struct window* window_get(uint32_t id); 30 | void window_toggle_show(struct window* win, int show); 31 | void window_blit(struct window* win, size_t width, size_t height, size_t x, size_t y); 32 | void window_set_position(struct window* win, int32_t x, int32_t y); 33 | void window_add(struct window* window); 34 | void window_init(); 35 | -------------------------------------------------------------------------------- /land/dropbear/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=dropbear 2 | pkgver=2020.81 3 | pkgrel=1 4 | pkgdesc="Dropbear is a relatively small SSH server and client." 5 | arch=('i786') 6 | url="https://matt.ucc.asn.au/dropbear/dropbear.html" 7 | makedepends=('zlib') 8 | source=( 9 | 'https://matt.ucc.asn.au/dropbear/releases/dropbear-2020.81.tar.bz2' 10 | 'dropbear.patch' 11 | ) 12 | sha256sums=( 13 | '48235d10b37775dbda59341ac0c4b239b82ad6318c31568b985730c788aac53b' 14 | 'SKIP' 15 | ) 16 | 17 | prepare() { 18 | cd $pkgname-$pkgver 19 | patch -p0 < ../dropbear.patch 20 | } 21 | 22 | build() { 23 | cd $pkgname-$pkgver 24 | CFLAGS="$CFLAGS -DDROPBEAR_SVR_PASSWORD_AUTH=0" ./configure \ 25 | --host=i786-pc-xelix \ 26 | --prefix=/usr \ 27 | --sysconfdir=/etc \ 28 | --sbindir=/usr/bin \ 29 | --disable-syslog \ 30 | --disable-lastlog \ 31 | --disable-harden \ 32 | --enable-static 33 | 34 | make 35 | } 36 | 37 | package() { 38 | cd $pkgname-$pkgver 39 | make DESTDIR=$pkgdir install 40 | } 41 | -------------------------------------------------------------------------------- /land/vim/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=vim 2 | pkgver=8.1 3 | pkgrel=1 4 | pkgdesc="Vim is a highly configurable text editor built to make creating and changing any kind of text very efficient." 5 | arch=('i786') 6 | makedepend=('ncurses') 7 | url="https://www.vim.org/" 8 | source=('ftp://ftp.vim.org/pub/vim/unix/vim-8.1.tar.bz2') 9 | sha256sums=('8b69fbd01c877dd8ecbbeca1dc66e5e927228d631ac4c2174b9307eb5c827c86') 10 | 11 | build() { 12 | cd vim81 13 | 14 | ac_cv_sizeof_int=4 \ 15 | vim_cv_getcwd_broken=no \ 16 | vim_cv_memmove_handles_overlap=yes \ 17 | vim_cv_stat_ignores_slash=yes \ 18 | vim_cv_tgetent=zero \ 19 | vim_cv_terminfo=yes \ 20 | vim_cv_toupper_broken=no \ 21 | vim_cv_tty_group=world \ 22 | ./configure \ 23 | --host=i786-pc-xelix \ 24 | --prefix=/usr \ 25 | --sysconfdir=/etc \ 26 | --with-tlib=ncurses 27 | 28 | cd src && sh osdef.sh && cd .. 29 | make 30 | } 31 | 32 | package() { 33 | cd vim81 34 | make DESTDIR=$pkgdir install 35 | ln -s vim $pkgdir/usr/bin/vi 36 | } 37 | -------------------------------------------------------------------------------- /src/block/part.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2018 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | #include 22 | 23 | bool part_read(uint32_t lba, uint8_t * buf); 24 | void part_write(uint32_t lba, uint8_t * buf); 25 | void vfs_part_probe(struct vfs_block_dev* dev); 26 | -------------------------------------------------------------------------------- /land/base/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=base 2 | pkgver=1 3 | pkgrel=3 4 | pkgdesc="The basic components of the Xelix operating system." 5 | arch=('any') 6 | url="https://xelix.org" 7 | license=('GPL') 8 | depends=('xelix-kernel' 'newlib' 'openlibm' 'xelix-utils' 'gcc-libs') 9 | makedepends=() 10 | source=() 11 | sha256sums=() 12 | 13 | package() { 14 | install -d $pkgdir/boot 15 | install -d $pkgdir/dev 16 | install -d $pkgdir/etc 17 | install -d $pkgdir/etc/init.d 18 | install -d $pkgdir/home 19 | install -d $pkgdir/home/root -m 700 20 | install -d $pkgdir/sys 21 | install -d $pkgdir/tmp 22 | install -d $pkgdir/usr 23 | install -d $pkgdir/usr/bin 24 | install -d $pkgdir/usr/include 25 | install -d $pkgdir/usr/lib 26 | install -d $pkgdir/usr/share 27 | install -d $pkgdir/var 28 | install -d $pkgdir/var/run 29 | 30 | rm $pkgdir/bin || true 31 | ln -s usr/bin $pkgdir/bin 32 | 33 | rm $pkgdir/etc/mtab || true 34 | ln -s /sys/mounts $pkgdir/etc/mtab 35 | 36 | cp -r ../etc $pkgdir/ 37 | } 38 | -------------------------------------------------------------------------------- /src/lib/cmdline.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2019 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | #include 22 | 23 | #define cmdline_string multiboot_get_cmdline 24 | 25 | char* cmdline_get(const char* key); 26 | bool cmdline_get_bool(const char* key); 27 | void cmdline_init(void); 28 | -------------------------------------------------------------------------------- /land/wget/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=wget 2 | pkgver=1.20.3 3 | pkgrel=3 4 | pkgdesc="GNU Wget is a free software package for retrieving files using HTTP, HTTPS, FTP and FTPS, the most widely used Internet protocols. " 5 | arch=('i786') 6 | makedepend=('zlib' 'pcre2' 'openssl') 7 | url="https://www.gnu.org/software/wget/" 8 | source=( 9 | 'https://ftp.gnu.org/gnu/wget/wget-1.20.3.tar.gz' 10 | "$pkgname-$pkgver.patch" 11 | "$pkgname-$pkgver-two.patch" 12 | ) 13 | sha256sums=( 14 | '31cccfc6630528db1c8e3a06f6decf2a370060b982841cfab2b8677400a5092e' 15 | 'SKIP' 16 | 'SKIP' 17 | ) 18 | 19 | prepare() { 20 | patch -p0 < $pkgname-$pkgver.patch 21 | } 22 | 23 | build() { 24 | cd $pkgname-$pkgver 25 | ./configure \ 26 | --host=i786-pc-xelix \ 27 | --prefix=/usr \ 28 | --sysconfdir=/etc \ 29 | --with-ssl=openssl \ 30 | --disable-threads \ 31 | --without-libpsl 32 | 33 | patch -p1 < ../$pkgname-$pkgver-two.patch 34 | make -j$(nproc) 35 | } 36 | 37 | package() { 38 | cd $pkgname-$pkgver 39 | make DESTDIR=$pkgdir install 40 | } 41 | -------------------------------------------------------------------------------- /src/tasks/wait.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2011-2019 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | #include 22 | 23 | int task_waitpid(task_t* task, int32_t child_pid, int* stat_loc, int options); 24 | void wait_finish(task_t* task, task_t* child); 25 | int task_sleep(task_t* task, struct timeval* tv); 26 | -------------------------------------------------------------------------------- /src/lib/stdlib.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2010-2018 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | #include 22 | 23 | #define is_digit(C) ((C) >= '0' && (C) <= '9') 24 | static inline uint32_t atoi(const char* s) { 25 | uint32_t n = 0; 26 | while (is_digit(*s)) n = 10 * n + *s++ - '0'; 27 | return n; 28 | } 29 | -------------------------------------------------------------------------------- /src/tasks/i386-signal.asm: -------------------------------------------------------------------------------- 1 | ; signal.asm: Signal injection 2 | ; Copyright © 2019 Lukas Martini 3 | 4 | ; This file is part of Xelix. 5 | ; 6 | ; Xelix is free software: you can redistribute it and/or modify 7 | ; it under the terms of the GNU General Public License as published by 8 | ; the Free Software Foundation, either version 3 of the License, or 9 | ; (at your option) any later version. 10 | ; 11 | ; Xelix is distributed in the hope that it will be useful, 12 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ; GNU General Public License for more details. 15 | ; 16 | ; You should have received a copy of the GNU General Public License 17 | ; along with Xelix. If not, see . 18 | 19 | [section .text.ul_visible] 20 | [GLOBAL task_sigjmp_crt0] 21 | task_sigjmp_crt0: 22 | ; Call signal handler 23 | pop eax 24 | call eax 25 | add esp, 4 26 | 27 | ; Restore original state 28 | popa 29 | add esp, 4 30 | jmp [esp-4] 31 | -------------------------------------------------------------------------------- /src/bsp/timer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2010-2018 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | #include 22 | 23 | #define timer_tick (timer_get_tick()) 24 | #define timer_rate (timer_get_rate()) 25 | 26 | void timer_init(void); 27 | void timer_init2(void); 28 | uint32_t timer_get_tick(void); 29 | uint32_t timer_get_rate(void); 30 | -------------------------------------------------------------------------------- /src/mem/i386-gdt.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2010 Christoph Sünderhauf 4 | * Copyright © 2018 Lukas Martini 5 | * 6 | * This file is part of Xelix. 7 | * 8 | * Xelix is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * Xelix is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with Xelix. If not, see . 20 | */ 21 | 22 | #define GDT_SEG_CODE_PL0 0x08 23 | #define GDT_SEG_DATA_PL0 0x10 24 | #define GDT_SEG_CODE_PL3 0x1b 25 | #define GDT_SEG_DATA_PL3 0x23 26 | 27 | void gdt_set_tss(void* addr); 28 | void gdt_init(void); 29 | -------------------------------------------------------------------------------- /src/tty/serial.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2010 Benjamin Richter 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | #include 22 | 23 | #define serial_printf(fmt, args...) fctprintf(serial_send, NULL, fmt, ## args) 24 | 25 | void serial_init(void); 26 | void serial_init2(void); 27 | char serial_recv(void); 28 | void serial_send(const char c, void* unused); 29 | -------------------------------------------------------------------------------- /land/libevent/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=libevent 2 | pkgver=2.1.12 3 | pkgrel=2 4 | pkgdesc="The libevent API provides a mechanism to execute a callback function when a specific event occurs on a file descriptor or after a timeout has been reached" 5 | arch=('i786') 6 | url="https://libevent.org/" 7 | makedepend=('openssl') 8 | source=( 9 | 'https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz' 10 | 'libevent-2.1.12.patch' 11 | ) 12 | sha256sums=( 13 | '92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb' 14 | 'SKIP' 15 | ) 16 | 17 | prepare() { 18 | cd libevent-2.1.12-stable 19 | patch -p0 < ../libevent-2.1.12.patch 20 | } 21 | 22 | build() { 23 | cd libevent-2.1.12-stable 24 | ./configure \ 25 | --host=i786-pc-xelix \ 26 | --prefix=/usr \ 27 | --sysconfdir=/etc \ 28 | --disable-shared \ 29 | --disable-samples \ 30 | --disable-thread-support \ 31 | --disable-libevent-regress 32 | 33 | make 34 | } 35 | 36 | package() { 37 | cd libevent-2.1.12-stable 38 | make DESTDIR=$pkgdir install 39 | } 40 | -------------------------------------------------------------------------------- /land/openssl-quic/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=openssl-quic 2 | pkgver=3.1.4 3 | pkgrel=4 4 | pkgdesc="A robust, commercial-grade, full-featured toolkit for general-purpose cryptography and secure communication." 5 | arch=('i786') 6 | provides=('openssl') 7 | replaces=('openssl') 8 | makedepend=('zlib') 9 | url="https://www.openssl.org/" 10 | source=( 11 | 'https://github.com/quictls/openssl/archive/refs/tags/openssl-3.1.4-quic1.tar.gz' 12 | "$pkgname-$pkgver.patch" 13 | '50-xelix.conf' 14 | ) 15 | sha256sums=( 16 | '4bf990243d6aa39b8befa0c399834415842912ef67f88bef98e74dc619469618' 17 | 'SKIP' 18 | 'SKIP' 19 | ) 20 | 21 | prepare() { 22 | cd openssl-openssl-3.1.4-quic1 23 | patch -p0 < ../$pkgname-$pkgver.patch 24 | cp ../50-xelix.conf Configurations 25 | } 26 | 27 | build() { 28 | cd openssl-openssl-3.1.4-quic1 29 | CROSS_COMPILE=i786-pc-xelix- ./Configure xelix-x86 no-threads no-dso 386 no-sse2 no-tests --prefix=/usr --openssldir=/etc/ssl -DDSO_NONE 30 | make -j$(nproc) 31 | } 32 | 33 | package() { 34 | cd openssl-openssl-3.1.4-quic1 35 | make DESTDIR=$pkgdir install 36 | } 37 | -------------------------------------------------------------------------------- /src/lib/log.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2010 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | #include "generic.h" 22 | 23 | #define LOG_DEBUG 1 24 | #define LOG_INFO 2 25 | #define LOG_WARN 3 26 | #define LOG_ERR 4 27 | 28 | void log(uint8_t level, const char *fmt, ...); 29 | void log_dump(void); 30 | void log_set_console_level(int level); 31 | void log_init(void); 32 | -------------------------------------------------------------------------------- /land/libedit/libedit-20191231-3.1.patch: -------------------------------------------------------------------------------- 1 | --- libedit-20191231-3.1/config.sub 2019-12-31 11:58:29.000000000 +0100 2 | +++ libedit-20191231-3.1/config.sub 2020-01-11 04:49:23.639185758 +0100 3 | @@ -1390,7 +1390,7 @@ case $os in 4 | | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ 5 | | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ 6 | | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ 7 | - | -midnightbsd*) 8 | + | -midnightbsd* | -xelix*) 9 | # Remember, each alternative MUST END IN *, to match a version number. 10 | ;; 11 | -qnx*) 12 | --- libedit-20191231-3.1/src/editline/readline.h 2019-10-25 22:12:05.000000000 +0200 13 | +++ libedit-20191231-3.1/src/editline/readline.h 2020-01-11 04:49:16.439196264 +0100 14 | @@ -76,7 +76,7 @@ typedef KEYMAP_ENTRY *Keymap; 15 | 16 | #ifndef CTRL 17 | #include 18 | -#if !defined(__sun) && !defined(__hpux) && !defined(_AIX) 19 | +#if !defined(__sun) && !defined(__hpux) && !defined(_AIX) && !defined(__xelix__) 20 | #include 21 | #endif 22 | #ifndef CTRL 23 | -------------------------------------------------------------------------------- /land/pacman/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=pacman 2 | pkgver=6.0.2 3 | pkgrel=4 4 | pkgdesc="Pacman - package management combining a simple binary package format with an easy-to-use build system." 5 | arch=('i786') 6 | makedepend=('libarchive' 'curl' 'openssl' 'nghttp2' 'nghttp3' 'ngtcp2' 'bzip2' 'libxml2' 'xz' 'zlib') 7 | url="https://gitlab.archlinux.org/pacman/pacman" 8 | source=( 9 | 'https://gitlab.archlinux.org/pacman/pacman/-/archive/v6.0.2/pacman-v6.0.2.tar.gz' 10 | "$pkgname-$pkgver.patch" 11 | 'Makefile.xelix' 12 | 'xelixconfig.h' 13 | 'pacman.conf' 14 | ) 15 | sha256sums=( 16 | 'e39eab7f2cbd7cd802f56bc33e677df22a31caf7887ec4fae4d2b1649a95e410' 17 | 'SKIP' 18 | 'SKIP' 19 | 'SKIP' 20 | 'SKIP' 21 | ) 22 | 23 | prepare() { 24 | cd $pkgname-v$pkgver 25 | patch -p1 < ../$pkgname-$pkgver.patch 26 | cp ../Makefile.xelix ../xelixconfig.h . 27 | } 28 | 29 | build() { 30 | cd $pkgname-v$pkgver 31 | make -f Makefile.xelix 32 | } 33 | 34 | package() { 35 | cd $pkgname-v$pkgver 36 | make -f Makefile.xelix DESTDIR=$pkgdir install 37 | install -d $pkgdir/etc 38 | install -D ../pacman.conf $pkgdir/etc 39 | } 40 | -------------------------------------------------------------------------------- /land/newlib/xelix/sys/un.h: -------------------------------------------------------------------------------- 1 | /* Copyright © 2018 Lukas Martini 2 | * 3 | * This file is part of Xelix. 4 | * 5 | * Xelix is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * Xelix is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with Xelix. If not, see . 17 | */ 18 | 19 | #ifndef _SYS_UN_H 20 | #define _SYS_UN_H 21 | 22 | #include 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | struct sockaddr_un { 29 | sa_family_t sun_family; 30 | char sun_path[200]; 31 | }; 32 | 33 | #ifdef __cplusplus 34 | } /* C++ */ 35 | #endif 36 | #endif /* _SYS_UN_H */ 37 | -------------------------------------------------------------------------------- /src/tty/keyboard.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2019 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | #include 22 | 23 | struct tty_input_state { 24 | bool shift; 25 | bool shift_left; 26 | bool shift_right; 27 | bool capslock; 28 | bool control_left; 29 | bool control_right; 30 | bool alt_left; 31 | bool alt_right; 32 | bool super; 33 | uint16_t code; 34 | }; 35 | 36 | void tty_keyboard_init(void); 37 | -------------------------------------------------------------------------------- /land/newlib/xelix/bits/wordsize.h: -------------------------------------------------------------------------------- 1 | /* Copyright © 2015 Lukas Martini 2 | * 3 | * This file is part of Xelix. 4 | * 5 | * Xelix is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * Xelix is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with Xelix. If not, see . 17 | */ 18 | 19 | #ifndef _BITS_WORDSIZE_H_ 20 | #define _BITS_WORDSIZE_H_ 21 | 22 | // This is silly as we only support 32 bits anyways. Future compatibility I guess 23 | #if defined __x86_64__ 24 | # define __WORDSIZE 64 25 | # define __WORDSIZE_COMPAT32 1 26 | #else 27 | # define __WORDSIZE 32 28 | #endif 29 | 30 | #endif /* _BITS_WORDSIZE_H */ 31 | -------------------------------------------------------------------------------- /land/git/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=git 2 | pkgver=2.42.1 3 | pkgrel=3 4 | pkgdesc="Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency." 5 | arch=('i786') 6 | makedepend=('openssl' 'pcre2' 'curl' 'libexpat' 'zlib') 7 | url="https://git-scm.com/" 8 | source=( 9 | 'https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.42.1.tar.xz' 10 | "$pkgname-$pkgver.patch" 11 | ) 12 | sha256sums=( 13 | '8e46fa96bf35a65625d85fde50391e39bc0620d1bb39afb70b96c4a237a1a4f7' 14 | 'SKIP' 15 | ) 16 | 17 | prepare() { 18 | cd $pkgname-$pkgver 19 | patch -p0 < ../$pkgname-$pkgver.patch 20 | } 21 | 22 | 23 | build() { 24 | cd $pkgname-$pkgver 25 | ac_cv_fread_reads_directories=n \ 26 | ac_cv_snprintf_returns_bogus=n \ 27 | NO_MMAP=y \ 28 | ./configure \ 29 | --host=i786-pc-xelix \ 30 | --prefix=/usr \ 31 | --sysconfdir=/etc \ 32 | --disable-pthreads \ 33 | --with-openssl \ 34 | --with-libpcre2 \ 35 | --with-curl \ 36 | --with-expat 37 | 38 | make -j$(nproc) 39 | } 40 | 41 | package() { 42 | cd $pkgname-$pkgver 43 | make DESTDIR=$pkgdir install 44 | } 45 | -------------------------------------------------------------------------------- /land/newlib/xelix/sys/dirent.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_DIRENT_H 2 | #define _SYS_DIRENT_H 3 | 4 | #include 5 | #include 6 | #define _LIBC 1 7 | #define NOT_IN_libc 1 8 | #include 9 | #undef _LIBC 10 | 11 | #define HAVE_NO_D_NAMLEN /* no struct dirent->d_namlen */ 12 | #define HAVE_DD_LOCK /* have locking mechanism */ 13 | 14 | #define MAXNAMLEN 255 /* sizeof(struct dirent.d_name)-1 */ 15 | 16 | #define DT_UNKNOWN 0 17 | #define DT_REG 1 18 | #define DT_DIR 2 19 | #define DT_CHR 3 20 | #define DT_BLK 4 21 | #define DT_FIFO 5 22 | #define DT_SOCK 6 23 | #define DT_LNK 7 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | typedef struct { 30 | int dd_fd; /* directory file */ 31 | int dd_loc; /* position in buffer */ 32 | int dd_seek; 33 | char *dd_buf; /* buffer */ 34 | int dd_len; /* buffer length */ 35 | int dd_size; /* amount of data in buffer */ 36 | _LOCK_RECURSIVE_T dd_lock; 37 | } DIR; 38 | 39 | #ifdef __cplusplus 40 | } /* C++ */ 41 | #endif 42 | 43 | #define __dirfd(dir) (dir)->dd_fd 44 | 45 | #include 46 | #endif 47 | -------------------------------------------------------------------------------- /.github/workflows/docs.yml: -------------------------------------------------------------------------------- 1 | name: Build docs 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | paths: 9 | - 'docs/**' 10 | - 'mkdocs.yml' 11 | - '.github/workflows/docs.yml' 12 | 13 | defaults: 14 | run: 15 | working-directory: docs 16 | 17 | jobs: 18 | push: 19 | runs-on: ubuntu-latest 20 | if: github.event_name == 'push' 21 | 22 | steps: 23 | - uses: actions/checkout@v2 24 | 25 | - name: Install lftp 26 | run: sudo apt-get install -y lftp 27 | 28 | - name: Set up Python 29 | uses: actions/setup-python@v1 30 | with: 31 | python-version: '3.x' 32 | 33 | - name: Set up Poetry 34 | uses: abatilo/actions-poetry@v2.0.0 35 | with: 36 | poetry-version: 1.1.12 37 | 38 | - name: Install Python dependencies 39 | run: poetry install -n 40 | 41 | - name: Run mkdocs 42 | run: poetry run mkdocs build -f ../mkdocs.yml 43 | 44 | - name: Push site 45 | run: lftp sftp://ws309@w2.fnordserver.net --password ${{ secrets.SFTP_PASSWORD }} -e "mirror --reverse --delete ../site httpdocs; bye" 46 | -------------------------------------------------------------------------------- /land/binutils/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=binutils 2 | pkgver=2.40 3 | pkgrel=1 4 | pkgdesc="The GNU Binutils are a collection of binary tools." 5 | arch=('i786') 6 | url="https://www.gnu.org/software/binutils/" 7 | license=('GPL') 8 | source=( 9 | 'https://ftp.gnu.org/gnu/binutils/binutils-2.40.tar.gz' 10 | 'binutils-2.40.patch' 11 | 'elf_i386_xelix.sh' 12 | 'elf_x86_64_xelix.sh' 13 | ) 14 | sha256sums=( 15 | 'd7f82c4047decf43a6f769ac32456a92ddb6932409a585c633cdd4e9df23d956' 16 | 'SKIP' 17 | 'SKIP' 18 | 'SKIP' 19 | ) 20 | 21 | prepare() { 22 | cd $pkgname-$pkgver 23 | patch -p0 < ../$pkgname-$pkgver.patch 24 | cp ../elf_i386_xelix.sh ../elf_x86_64_xelix.sh ld/emulparams 25 | find . -name "config.cache" -delete 26 | } 27 | 28 | build() { 29 | cd $pkgname-$pkgver 30 | cd ld 31 | aclocal 32 | automake 33 | cd .. 34 | autoreconf-2.69 35 | 36 | ./configure \ 37 | --host=i786-pc-xelix \ 38 | --prefix=/usr \ 39 | --sysconfdir=/etc \ 40 | --disable-werror \ 41 | --disable-plugins \ 42 | --disable-nls 43 | 44 | make CPPFLAGS="$CPPFLAGS -D__int64_t_defined" 45 | } 46 | 47 | package() { 48 | cd $pkgname-$pkgver 49 | make DESTDIR=$pkgdir install 50 | } 51 | -------------------------------------------------------------------------------- /src/net/conv.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2019 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | #include 22 | #include 23 | 24 | int net_bsd_to_pico_addr(union pico_address *addr, const struct sockaddr *_saddr, socklen_t socklen); 25 | uint16_t net_bsd_to_pico_port(const struct sockaddr *_saddr, socklen_t socklen); 26 | int net_conv_pico2bsd(struct sockaddr *_saddr, socklen_t socklen, union pico_address *addr, uint16_t port); 27 | -------------------------------------------------------------------------------- /land/grep/grep-3.1.patch: -------------------------------------------------------------------------------- 1 | diff -ruPN grep-3.1/build-aux/config.sub /home/lutoma/code/grep-3.1/build-aux/config.sub 2 | --- grep-3.1/build-aux/config.sub 2017-05-14 03:09:51.000000000 +0200 3 | +++ /home/lutoma/code/grep-3.1/build-aux/config.sub 2018-10-16 15:58:45.981554529 +0200 4 | @@ -1417,7 +1417,7 @@ 5 | | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ 6 | | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ 7 | | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ 8 | - | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*) 9 | + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -xelix*) 10 | # Remember, each alternative MUST END IN *, to match a version number. 11 | ;; 12 | -qnx*) 13 | diff -ruPN grep-3.1/lib/getprogname.c /home/lutoma/code/grep-3.1/lib/getprogname.c 14 | --- grep-3.1/lib/getprogname.c 2017-01-16 18:29:13.000000000 +0100 15 | +++ /home/lutoma/code/grep-3.1/lib/getprogname.c 2018-10-16 16:00:53.478222244 +0200 16 | @@ -178,7 +178,7 @@ 17 | } 18 | return NULL; 19 | # else 20 | -# error "getprogname module not ported to this OS" 21 | +return "grep"; 22 | # endif 23 | } 24 | -------------------------------------------------------------------------------- /land/newlib/xelix/sys/resource.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_RESOURCE_H_ 2 | #define _SYS_RESOURCE_H_ 3 | 4 | #include 5 | 6 | #define RUSAGE_SELF 0 /* calling process */ 7 | #define RUSAGE_CHILDREN -1 /* terminated child processes */ 8 | 9 | #define RLIM_INFINITY 0 10 | #define RLIM_NLIMITS 0 11 | 12 | #define RLIMIT_CORE 1 13 | #define RLIMIT_CPU 2 14 | #define RLIMIT_DATA 3 15 | #define RLIMIT_FSIZE 4 16 | #define RLIMIT_NOFILE 5 17 | #define RLIMIT_STACK 6 18 | #define RLIMIT_AS 7 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | struct rusage { 25 | struct timeval ru_utime; /* user time used */ 26 | struct timeval ru_stime; /* system time used */ 27 | long ru_maxrss; 28 | }; 29 | 30 | typedef uint32_t rlim_t; 31 | 32 | struct rlimit { 33 | rlim_t rlim_cur; /* Soft limit */ 34 | rlim_t rlim_max; /* Hard limit (ceiling for rlim_cur) */ 35 | }; 36 | 37 | int getpriority(int, id_t); 38 | int getrlimit(int, struct rlimit *); 39 | int getrusage(int, struct rusage *); 40 | int setpriority(int, id_t, int); 41 | int setrlimit(int, const struct rlimit *); 42 | 43 | #ifdef __cplusplus 44 | } /* C++ */ 45 | #endif 46 | #endif 47 | 48 | -------------------------------------------------------------------------------- /src/tasks/worker.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2023 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | typedef struct worker { 26 | char name[VFS_NAME_MAX]; 27 | bool stopped; 28 | isf_t* state; 29 | void* entry; 30 | void* stack; 31 | } worker_t; 32 | 33 | worker_t* worker_new(char* name, void* entry); 34 | int worker_stop(worker_t* worker); 35 | int worker_exit(worker_t* worker); 36 | -------------------------------------------------------------------------------- /land/newlib/xelix/include/net/if.h: -------------------------------------------------------------------------------- 1 | /* Copyright © 2018 Lukas Martini 2 | * 3 | * This file is part of Xelix. 4 | * 5 | * Xelix is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * Xelix is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with Xelix. If not, see . 17 | */ 18 | 19 | #ifndef _NET_IF_H 20 | #define _NET_IF_H 21 | 22 | #define IF_NAMESIZE 20 23 | 24 | struct if_nameindex { 25 | unsigned if_index; 26 | char* if_name; 27 | }; 28 | 29 | unsigned if_nametoindex(const char*); 30 | char* if_indextoname(unsigned, char*); 31 | struct if_nameindex* if_nameindex(void); 32 | void if_freenameindex(struct if_nameindex*); 33 | 34 | #endif /* _NET_IF_H */ 35 | -------------------------------------------------------------------------------- /src/gfx/fbtext.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2019 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | #include 22 | 23 | void gfx_fbtext_init(void); 24 | void gfx_fbtext_show(void); 25 | void gfx_fbtext_write(uint32_t x, uint32_t y, wchar_t chr, uint32_t col_fg, uint32_t col_bg); 26 | void gfx_fbtext_draw_cursor(uint32_t x, uint32_t y); 27 | void gfx_fbtext_clear(uint32_t x, uint32_t y, uint32_t cols, uint32_t rows); 28 | void gfx_fbtext_scroll(unsigned int num); 29 | -------------------------------------------------------------------------------- /src/lib/i386-variadic.asm: -------------------------------------------------------------------------------- 1 | ; variadic.asm: Variadic function calls 2 | ; Copyright © 2019 Lukas Martini 3 | 4 | ; This file is part of Xelix. 5 | ; 6 | ; Xelix is free software: you can redistribute it and/or modify 7 | ; it under the terms of the GNU General Public License as published by 8 | ; the Free Software Foundation, either version 3 of the License, or 9 | ; (at your option) any later version. 10 | ; 11 | ; Xelix is distributed in the hope that it will be useful, 12 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ; GNU General Public License for more details. 15 | ; 16 | ; You should have received a copy of the GNU General Public License 17 | ; along with Xelix. If not, see . 18 | 19 | ; Only works with dword arguments 20 | [GLOBAL variadic_call] 21 | variadic_call: 22 | push ebp 23 | mov ebp, esp 24 | mov ecx, [ebp + 12] ; num_args 25 | mov eax, [ebp + 16] ; args 26 | jecxz .call 27 | 28 | .adl: 29 | push dword [eax] 30 | add eax, 4 31 | dec ecx 32 | jnz .adl 33 | 34 | .call: 35 | call [ebp + 8] 36 | mov esp, ebp 37 | pop ebp 38 | ret 39 | -------------------------------------------------------------------------------- /land/gzip/gzip-1.9.patch: -------------------------------------------------------------------------------- 1 | diff -ruPN gzip-1.9/build-aux/config.sub /home/lutoma/code/gzip-1.9/build-aux/config.sub 2 | --- gzip-1.9/build-aux/config.sub 2018-01-04 01:38:53.000000000 +0100 3 | +++ /home/lutoma/code/gzip-1.9/build-aux/config.sub 2018-10-16 16:19:20.077780570 +0200 4 | @@ -1416,7 +1416,7 @@ 5 | | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ 6 | | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ 7 | | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ 8 | - | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme*) 9 | + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* | -xelix*) 10 | # Remember, each alternative MUST END IN *, to match a version number. 11 | ;; 12 | -qnx*) 13 | diff -ruPN gzip-1.9/lib/getprogname.c /home/lutoma/code/gzip-1.9/lib/getprogname.c 14 | --- gzip-1.9/lib/getprogname.c 2018-01-07 01:03:28.000000000 +0100 15 | +++ /home/lutoma/code/gzip-1.9/lib/getprogname.c 2018-10-16 16:19:50.351095193 +0200 16 | @@ -177,7 +177,7 @@ 17 | } 18 | return NULL; 19 | # else 20 | -# error "getprogname module not ported to this OS" 21 | +return "gzip"; 22 | # endif 23 | } 24 | -------------------------------------------------------------------------------- /land/newlib/xelix/sys/utsname.h: -------------------------------------------------------------------------------- 1 | /* Copyright © 2018 Lukas Martini 2 | * 3 | * This file is part of Xelix. 4 | * 5 | * Xelix is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * Xelix is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with Xelix. If not, see . 17 | */ 18 | 19 | #ifndef _SYS_UTSNAME_H 20 | #define _SYS_UTSNAME_H 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | struct utsname { 26 | char sysname[50]; 27 | char nodename[300]; 28 | char release[50]; 29 | char version[300]; 30 | char machine[50]; 31 | }; 32 | 33 | int uname(struct utsname *); 34 | 35 | #ifdef __cplusplus 36 | } /* C++ */ 37 | #endif 38 | #endif /* SYS_UTSNAME_H */ 39 | -------------------------------------------------------------------------------- /land/newlib/xelix/sys/uio.h: -------------------------------------------------------------------------------- 1 | /* Copyright © 2019 Lukas Martini 2 | * 3 | * This file is part of Xelix. 4 | * 5 | * Xelix is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * Xelix is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with Xelix. If not, see . 17 | */ 18 | 19 | #ifndef _SYS_UIO_H 20 | #define _SYS_UIO_H 21 | 22 | #include 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | struct iovec { 29 | void *iov_base; 30 | size_t iov_len; 31 | }; 32 | 33 | ssize_t readv(int, const struct iovec *, int); 34 | ssize_t writev(int, const struct iovec *, int); 35 | 36 | #ifdef __cplusplus 37 | } /* C++ */ 38 | #endif 39 | #endif /* SYS_UIO_H */ 40 | -------------------------------------------------------------------------------- /src/fs/ext2_misc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2013-2019 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | #include 22 | 23 | enum inode_check_op { 24 | PERM_CHECK_READ = 2, 25 | PERM_CHECK_WRITE = 1, 26 | PERM_CHECK_EXEC = 0 27 | }; 28 | int ext2_inode_check_perm(enum inode_check_op, struct inode* inode, task_t* task); 29 | 30 | uint32_t ext2_bitmap_search_and_claim(struct ext2_fs* fs, uint32_t bitmap_block); 31 | void ext2_bitmap_free(struct ext2_fs* fs, uint32_t bitmap_block, uint32_t bit); 32 | -------------------------------------------------------------------------------- /land/diffutils/diffutils-3.6.patch: -------------------------------------------------------------------------------- 1 | diff -ruPN diffutils-3.6/build-aux/config.sub /home/lutoma/code/diffutils-3.6/build-aux/config.sub 2 | --- diffutils-3.6/build-aux/config.sub 2017-05-14 03:09:51.000000000 +0200 3 | +++ /home/lutoma/code/diffutils-3.6/build-aux/config.sub 2018-10-16 15:58:45.981554529 +0200 4 | @@ -1417,7 +1417,7 @@ 5 | | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ 6 | | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ 7 | | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ 8 | - | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*) 9 | + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -xelix*) 10 | # Remember, each alternative MUST END IN *, to match a version number. 11 | ;; 12 | -qnx*) 13 | diff -ruPN diffutils-3.6/lib/getprogname.c /home/lutoma/code/diffutils-3.6/lib/getprogname.c 14 | --- diffutils-3.6/lib/getprogname.c 2017-01-16 18:29:13.000000000 +0100 15 | +++ /home/lutoma/code/diffutils-3.6/lib/getprogname.c 2018-10-16 16:00:53.478222244 +0200 16 | @@ -178,7 +178,7 @@ 17 | } 18 | return NULL; 19 | # else 20 | -# error "getprogname module not ported to this OS" 21 | +return "grep"; 22 | # endif 23 | } 24 | -------------------------------------------------------------------------------- /land/newlib/xelix/sys/wait.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_WAIT_H 2 | #define _SYS_WAIT_H 3 | 4 | #include 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | #define WNOHANG 1 11 | #define WUNTRACED 2 12 | 13 | /* A status looks like: 14 | <1 byte info> <1 byte code> 15 | 16 | == 0, child has exited, info is the exit value 17 | == 1..7e, child has exited, info is the signal number. 18 | == 7f, child has stopped, info was the signal number. 19 | == 80, there was a core dump. 20 | */ 21 | 22 | #define WIFEXITED(w) (((w) & 0xff) == 0) 23 | #define WIFSIGNALED(w) (((w) & 0x7f) > 0 && (((w) & 0x7f) < 0x7f)) 24 | #define WIFSTOPPED(w) (((w) & 0xff) == 0x7f) 25 | #define WEXITSTATUS(w) (((w) >> 8) & 0xff) 26 | #define WTERMSIG(w) ((w) & 0x7f) 27 | #define WSTOPSIG WEXITSTATUS 28 | #define WCOREDUMP(w) 0 29 | 30 | pid_t wait (int *); 31 | pid_t waitpid (pid_t, int *, int); 32 | 33 | #ifdef _COMPILING_NEWLIB 34 | pid_t _wait (int *); 35 | #endif 36 | 37 | /* Provide prototypes for most of the _ names that are 38 | provided in newlib for some compilers. */ 39 | pid_t _wait (int *); 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | #endif 45 | -------------------------------------------------------------------------------- /src/mem/mem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2019-2021 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | extern struct mem_page_alloc_ctx mem_phys_alloc_ctx; 27 | 28 | #define palloc(size) (mem_page_alloc(&mem_phys_alloc_ctx, size)) 29 | //#define pfree(num, size) (mem_page_free(&mem_phys_alloc_ctx, num, size)) 30 | #define pfree(num, size) 31 | 32 | void mem_init(void); 33 | void mem_late_init(void); 34 | -------------------------------------------------------------------------------- /land/cairo/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=cairo 2 | pkgver=1.16.0 3 | pkgrel=2 4 | pkgdesc="Cairo is a 2D graphics library with support for multiple output devices." 5 | arch=('i786') 6 | url="https://www.cairographics.org/" 7 | makedepend=('zlib' 'libpng' 'freetype' 'pixman') 8 | source=( 9 | 'https://www.cairographics.org/releases/cairo-1.16.0.tar.xz' 10 | 'cairo.patch' 11 | ) 12 | sha256sums=( 13 | '5e7b29b3f113ef870d1e3ecf8adf21f923396401604bda16d44be45e66052331' 14 | 'SKIP' 15 | ) 16 | 17 | prepare() { 18 | cd $pkgname-$pkgver 19 | patch -p0 < ../cairo.patch 20 | } 21 | 22 | build() { 23 | cd $pkgname-$pkgver 24 | CFLAGS="$CFLAGS -DCAIRO_NO_MUTEX=1" ./configure \ 25 | --host=i786-pc-xelix \ 26 | --prefix=/usr \ 27 | --sysconfdir=/etc \ 28 | --localstatedir=/var \ 29 | --disable-xcb \ 30 | --disable-xcb-shm \ 31 | --disable-xlib \ 32 | --disable-xlib-xrender \ 33 | --disable-gobject \ 34 | --disable-fc 35 | 36 | # Disable tests that won't work in non-native environment 37 | echo -e 'all:\n\ttrue\ninstall:\n\ttrue' > test/Makefile 38 | echo -e 'all:\n\ttrue\ninstall:\n\ttrue' > perf/Makefile 39 | 40 | make 41 | } 42 | 43 | package() { 44 | cd $pkgname-$pkgver 45 | make DESTDIR=$pkgdir install 46 | } 47 | -------------------------------------------------------------------------------- /land/xelix-utils/src/xelix-loader-i386.asm: -------------------------------------------------------------------------------- 1 | ; ld-xelix.asm: Trampoline functions for ld-xelix 2 | ; Copyright © 2023 Lukas Martini 3 | 4 | ; This file is part of Xelix. 5 | ; 6 | ; Xelix is free software: you can redistribute it and/or modify 7 | ; it under the terms of the GNU General Public License as published by 8 | ; the Free Software Foundation, either version 3 of the License, or 9 | ; (at your option) any later version. 10 | ; 11 | ; Xelix is distributed in the hope that it will be useful, 12 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ; GNU General Public License for more details. 15 | ; 16 | ; You should have received a copy of the GNU General Public License 17 | ; along with Xelix. If not, see . 18 | 19 | [EXTERN resolve_callback] 20 | [GLOBAL plt_trampoline] 21 | 22 | plt_trampoline: 23 | pop edx 24 | pop ecx 25 | 26 | ; push ebp 27 | ; mov ebp, esp 28 | 29 | push eax 30 | ; push ebx 31 | ; push esi 32 | ; push edi 33 | 34 | call resolve_callback 35 | mov ecx, eax 36 | 37 | ; pop edi 38 | ; pop esi 39 | ; pop ebx 40 | pop eax 41 | 42 | ; mov esp, ebp 43 | ; pop ebp 44 | jmp ecx 45 | -------------------------------------------------------------------------------- /land/gfxcompd/src/text.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include FT_FREETYPE_H 5 | #include 6 | #include 7 | 8 | #include "util.h" 9 | #include "window.h" 10 | #include "text.h" 11 | 12 | FT_Library ft_library; 13 | 14 | static void load_font(cairo_font_face_t** fdesc, const char* path) { 15 | static FT_Face ft_font; 16 | if(FT_New_Face(ft_library, path, 0, &ft_font)) { 17 | printf("Font %s: ", path); 18 | perror("Could not read font"); 19 | exit(EXIT_FAILURE); 20 | } 21 | 22 | static const cairo_user_data_key_t key; 23 | *fdesc = cairo_ft_font_face_create_for_ft_face(ft_font, 0); 24 | if(cairo_font_face_set_user_data(*fdesc, &key, 25 | ft_font, (cairo_destroy_func_t)FT_Done_Face)) { 26 | 27 | cairo_font_face_destroy(*fdesc); 28 | FT_Done_Face(ft_font); 29 | exit(EXIT_FAILURE); 30 | } 31 | } 32 | 33 | void text_init() { 34 | if(FT_Init_FreeType(&ft_library)) { 35 | perror("Could not initialize freetype"); 36 | exit(EXIT_FAILURE); 37 | } 38 | 39 | load_font(&font, "/usr/share/fonts/Roboto-Regular.ttf"); 40 | load_font(&font_light, "/usr/share/fonts/Roboto-Light.ttf"); 41 | load_font(&font_bold, "/usr/share/fonts/Roboto-Bold.ttf"); 42 | } 43 | -------------------------------------------------------------------------------- /land/ffmpeg/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=ffmpeg 2 | pkgver=4.4 3 | pkgrel=1 4 | pkgdesc="FFmpeg is a collection of libraries and tools to process multimedia content such as audio, video, subtitles and related metadata." 5 | arch=('i786') 6 | url="https://ffmpeg.org/" 7 | license=('GPL') 8 | makedepends=('flac' 'openssl' 'zlib' 'bzip2') 9 | source=( 10 | 'https://ffmpeg.org/releases/ffmpeg-4.4.tar.xz' 11 | 'ffmpeg.patch' 12 | 'xelixsnd.c' 13 | 'xelixsnd.h' 14 | 'xelixsnd_enc.c') 15 | sha256sums=( 16 | '06b10a183ce5371f915c6bb15b7b1fffbe046e8275099c96affc29e17645d909' 17 | 'SKIP' 18 | 'SKIP' 19 | 'SKIP' 20 | 'SKIP') 21 | 22 | prepare() { 23 | cp xelixsnd.c $pkgname-$pkgver/libavdevice/ 24 | cp xelixsnd.h $pkgname-$pkgver/libavdevice/ 25 | cp xelixsnd_enc.c $pkgname-$pkgver/libavdevice/ 26 | cd $pkgname-$pkgver 27 | patch -p0 < ../ffmpeg.patch 28 | } 29 | 30 | build() { 31 | cd $pkgname-$pkgver 32 | CFLAGS="-D__have_long64=0 -D__int64_t_defined" ./configure \ 33 | --arch=x86 \ 34 | --target-os=xelix \ 35 | --cross-prefix=i786-pc-xelix- \ 36 | --prefix=/usr \ 37 | --disable-shared \ 38 | --disable-network \ 39 | --disable-iconv 40 | make 41 | } 42 | 43 | package() { 44 | cd $pkgname-$pkgver 45 | make DESTDIR=$pkgdir install 46 | } 47 | -------------------------------------------------------------------------------- /src/lib/printf.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2019-2022 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | extern void fbtext_write_char(char); 28 | #define PRINTF_ALIAS_STANDARD_FUNCTION_NAMES 1 29 | 30 | static inline void putchar_(char c) { 31 | if(term_console) { 32 | term_write(term_console, &c, 1); 33 | } 34 | } 35 | 36 | #include 37 | -------------------------------------------------------------------------------- /land/gfxcompd/src/Makefile: -------------------------------------------------------------------------------- 1 | PATH += :../../toolchain/local/bin/ 2 | CC := i786-pc-xelix-gcc 3 | LD := i786-pc-xelix-ld 4 | MAKE_CFLAGS += -std=gnu18 -fcommon -O3 -g -D_GNU_SOURCE -I$(DESTDIR)/usr/include/freetype2 5 | DESTDIR ?= ../../../mnt 6 | 7 | .PHONY: all 8 | all: gfxcompd libxelixgfx.a 9 | 10 | .PHONY: clean 11 | clean: 12 | rm -f gfxcompd 13 | 14 | gfxcompd: main.o mouse.o window.o bus.o text.o render.o bar.o 15 | $(CC) $(CFLAGS) $(MAKE_CFLAGS) -o $@ $^ $(LDFLAGS) -lcairo -lpixman-1 -lfreetype -lpng -lz -lm -lbz2 16 | 17 | libxelixgfx.a: libxelixgfx.o 18 | ar rcs $@ $^ 19 | 20 | %.o: %.c 21 | $(CC) $(CFLAGS) -o $@ -c $< 22 | 23 | .PHONY: install 24 | install: 25 | install -d $(DESTDIR)/usr/bin/ 26 | install -D gfxcompd $(DESTDIR)/usr/bin/ 27 | install -d $(DESTDIR)/usr/lib/ 28 | install -m 644 -D libxelixgfx.a $(DESTDIR)/usr/lib/ 29 | install -d $(DESTDIR)/usr/include/ 30 | install -m 644 -D libxelixgfx.h $(DESTDIR)/usr/include/xelixgfx.h 31 | install -d $(DESTDIR)/usr/share/icons 32 | install -m 644 -D view-app-grid-symbolic.png $(DESTDIR)/usr/share/icons/view-app-grid-symbolic.png 33 | install -d $(DESTDIR)/usr/share/gfxcompd 34 | install -m 644 -D cursor.png $(DESTDIR)/usr/share/gfxcompd 35 | install -m 644 -D bg.png $(DESTDIR)/usr/share/gfxcompd 36 | -------------------------------------------------------------------------------- /src/lib/prof.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2019 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | static inline uint64_t profile_read_rdtsc() { 22 | register uint32_t timer_low asm("eax"); 23 | register uint32_t timer_high asm("edx"); 24 | asm volatile("rdtsc;" : "=r" (timer_low), "=r" (timer_high)); 25 | return timer_low | (uint64_t)timer_high << 32; 26 | } 27 | 28 | static inline uint64_t profile_start() { 29 | return profile_read_rdtsc(); 30 | } 31 | 32 | static inline uint64_t profile_stop(uint64_t start) { 33 | return profile_read_rdtsc() - start; 34 | } 35 | -------------------------------------------------------------------------------- /land/newlib/xelix/include/pty.h: -------------------------------------------------------------------------------- 1 | /* Copyright © 2019-2020 Lukas Martini 2 | * 3 | * This file is part of Xelix. 4 | * 5 | * Xelix is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * Xelix is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with Xelix. If not, see . 17 | */ 18 | 19 | #ifndef _PTY_H 20 | #define _PTY_H 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | #include 26 | 27 | #define TIOCGPTN 0x4016 28 | 29 | int openpty(int* ptm, int* pts, char *name, const struct termios* termios, 30 | const struct winsize* winsize); 31 | 32 | pid_t forkpty(int* ptm, char* name, const struct termios* termios, 33 | const struct winsize* winsize); 34 | 35 | #ifdef __cplusplus 36 | } /* C++ */ 37 | #endif 38 | #endif /* _PTY_H */ 39 | -------------------------------------------------------------------------------- /land/xelix-utils/src/util.h: -------------------------------------------------------------------------------- 1 | /* Copyright © 2019 Lukas Martini 2 | * 3 | * This file is part of Xelix. 4 | * 5 | * Xelix is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * Xelix is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with Xelix. If not, see . 17 | */ 18 | 19 | #include 20 | #include 21 | 22 | char* shortname(char* in); 23 | char* readable_fs(uint64_t size); 24 | char* time2str(time_t rtime, char* fmt); 25 | struct passwd* do_auth(char* user); 26 | void run_shell(struct passwd* pwd, bool print_motd); 27 | 28 | static inline void *memset32(uint32_t *s, uint32_t v, size_t n) { 29 | long d0, d1; 30 | asm volatile("rep stosl" 31 | : "=&c" (d0), "=&D" (d1) 32 | : "a" (v), "1" (s), "0" (n) 33 | : "memory"); 34 | return s; 35 | } 36 | -------------------------------------------------------------------------------- /src/boot/i386-linker.ld: -------------------------------------------------------------------------------- 1 | ENTRY(_start) 2 | gfx_font = _binary_src_gfx_Tamsyn8x16r_psf_start; 3 | 4 | PHDRS { 5 | headers PT_PHDR PHDRS ; 6 | multiboot PT_LOAD FILEHDR PHDRS; 7 | text PT_LOAD ; 8 | data PT_LOAD ; 9 | rodata PT_LOAD ; 10 | ul_visible PT_LOAD ; 11 | ul_visible_data PT_LOAD ; 12 | } 13 | 14 | SECTIONS { 15 | /* The first section should be at 0x100000 */ 16 | . = 0x100000; 17 | __kernel_start = .; 18 | 19 | /* The multiboot header has to be in the first 8kb */ 20 | .multiboot : { 21 | *(.multiboot) 22 | } :multiboot 23 | 24 | .text ALIGN(4096) : { 25 | *(.text) 26 | } :text 27 | 28 | .data ALIGN(4096) : { 29 | *(.data) 30 | } :data 31 | 32 | .bss ALIGN(4096) : { 33 | *(.bss) 34 | } :data 35 | 36 | .rodata ALIGN(4096) : { 37 | *(.rodata*) 38 | } :rodata 39 | 40 | .eh_frame ALIGN(4096) : { 41 | *(.eh_frame) 42 | } :rodata 43 | 44 | /* Userland visible kernel functions and data */ 45 | .text.ul_visible ALIGN(4096) : { 46 | __ul_visible_start = .; 47 | *(.text.ul_visible) 48 | } :ul_visible 49 | 50 | .data.ul_visible ALIGN(4096) : { 51 | *(.data.ul_visible) 52 | } :ul_visible_data 53 | 54 | .bss.ul_visible ALIGN(4096) : { 55 | *(.bss.ul_visible) 56 | } :ul_visible_data 57 | 58 | __ul_visible_end = .; 59 | __kernel_end = .; 60 | } 61 | -------------------------------------------------------------------------------- /src/lib/version.c: -------------------------------------------------------------------------------- 1 | /* version.c: uname / version information 2 | * Copyright © 2019 Lukas Martini 3 | * 4 | * This file is part of Xelix. 5 | * 6 | * Xelix is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Xelix is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with Xelix. If not, see . 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | static size_t sfs_read(struct vfs_callback_ctx* ctx, void* dest, size_t size) { 24 | if(ctx->fp->offset) { 25 | return 0; 26 | } 27 | 28 | size_t rsize = 0; 29 | sysfs_printf("Xelix 0.3.0 \"" __DATE__ " " __TIME__ "\" i786\n"); 30 | return rsize; 31 | } 32 | 33 | void version_init(void) { 34 | struct vfs_callbacks sfs_cb = { 35 | .read = sfs_read, 36 | }; 37 | sysfs_add_file("version", &sfs_cb); 38 | } 39 | -------------------------------------------------------------------------------- /land/newlib/xelix/include/arpa/inet.h: -------------------------------------------------------------------------------- 1 | /* Copyright © 2015-2020 Lukas Martini 2 | * 3 | * This file is part of Xelix. 4 | * 5 | * Xelix is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * Xelix is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with Xelix. If not, see . 17 | */ 18 | 19 | #ifndef _ARPA_INET_H 20 | #define _ARPA_INET_H 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | in_addr_t inet_addr(const char *cp); 27 | in_addr_t inet_lnaof(struct in_addr in); 28 | struct in_addr inet_makeaddr(in_addr_t net, in_addr_t lna); 29 | in_addr_t inet_netof(struct in_addr in); 30 | in_addr_t inet_network(const char *cp); 31 | char* inet_ntoa(struct in_addr in); 32 | int inet_aton(const char *cp, struct in_addr *inp); 33 | 34 | #endif /* _ARPA_INET_H */ 35 | -------------------------------------------------------------------------------- /src/net/net.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2019 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | struct net_device { 26 | struct pico_device pico_dev; 27 | struct buffer* recv_buf; 28 | }; 29 | 30 | typedef int (net_send_callback_t)(struct pico_device* pico_dev, void* data, int size); 31 | extern spinlock_t net_pico_lock; 32 | 33 | void net_receive(struct net_device* dev, void* data, size_t len); 34 | struct net_device* net_add_device(char* name, uint8_t mac[6], net_send_callback_t* write_cb); 35 | 36 | void net_init(void); 37 | -------------------------------------------------------------------------------- /src/mem/i386-gdt.asm: -------------------------------------------------------------------------------- 1 | ; gdt.asm: GDT interaction 2 | ; Copyright © 2010 Christoph Sünderhauf 3 | 4 | ; This file is part of Xelix. 5 | ; 6 | ; Xelix is free software: you can redistribute it and/or modify 7 | ; it under the terms of the GNU General Public License as published by 8 | ; the Free Software Foundation, either version 3 of the License, or 9 | ; (at your option) any later version. 10 | ; 11 | ; Xelix is distributed in the hope that it will be useful, 12 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ; GNU General Public License for more details. 15 | ; 16 | ; You should have received a copy of the GNU General Public License 17 | ; along with Xelix. If not, see . 18 | 19 | [GLOBAL gdt_flush] 20 | 21 | gdt_flush: 22 | mov eax, [esp+4] ; Get the pointer to the GDT, passed as a parameter. 23 | lgdt [eax] ; Load the new GDT pointer 24 | 25 | mov ax, 0x10 ; 0x10 is the offset in the GDT to our data segment 26 | mov ds, ax ; Load all data segment selectors 27 | mov es, ax 28 | mov fs, ax 29 | mov gs, ax 30 | mov ss, ax 31 | 32 | jmp 0x08:.flush ; 0x08 is the offset to our code segment: Far jump! 33 | .flush: 34 | 35 | xor eax, eax 36 | mov ax, 0x28 37 | ltr ax 38 | ret 39 | -------------------------------------------------------------------------------- /src/lib/libgen.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2023 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | static inline char* basename(char* path) { 22 | if(!path || !*path) { 23 | return "."; 24 | } 25 | 26 | if(!strcmp(path, "/")) { 27 | return path; 28 | } 29 | 30 | char* name = strrchr(path, '/'); 31 | return name ? name + 1 : path; 32 | } 33 | 34 | 35 | static inline char* dirname(char* path) { 36 | if(!path) { 37 | return "."; 38 | } 39 | 40 | if(!strcmp(path, "/")) { 41 | return path; 42 | } 43 | 44 | char* end = strrchr(path, '/'); 45 | if(!end) { 46 | return "."; 47 | } 48 | 49 | *end = '\0'; 50 | return path; 51 | } 52 | -------------------------------------------------------------------------------- /land/pciutils/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=pciutils 2 | pkgver=3.6.2 3 | pkgrel=1 4 | pkgdesc="A library for portable access to PCI bus configuration registers and several utilities based on this library." 5 | arch=('i786') 6 | makedepend=('zlib') 7 | url="https://github.com/pciutils/pciutils" 8 | source=( 9 | 'https://github.com/pciutils/pciutils/archive/v3.6.2.tar.gz' 10 | "$pkgname-$pkgver.patch" 11 | 'xelix-device.c' 12 | ) 13 | sha256sums=( 14 | 'd84d7096a71890f0ddddc50e88ac5a3bc7412bf48d8100fc15857a411564687d' 15 | 'SKIP' 16 | 'SKIP' 17 | ) 18 | 19 | prepare() { 20 | patch -p0 < $pkgname-$pkgver.patch 21 | cp xelix-device.c $pkgname-$pkgver/lib 22 | } 23 | 24 | build() { 25 | cd $pkgname-$pkgver 26 | make \ 27 | CROSS_COMPILE=i786-pc-xelix- \ 28 | HOST=pc-xelix \ 29 | CFLAGS="$CFLAGS -I$SYSROOT/usr/include" \ 30 | LDFLAGS="$LDFLAGS -L$SYSROOT/usr/lib" \ 31 | DNS=no \ 32 | ZLIB=yes \ 33 | PREFIX=/usr \ 34 | BINDIR=/usr/bin \ 35 | SBINDIR=/usr/bin \ 36 | DESTDIR=$pkgdir 37 | } 38 | 39 | package() { 40 | cd $pkgname-$pkgver 41 | make \ 42 | CROSS_COMPILE=i786-pc-xelix- \ 43 | HOST=pc-xelix \ 44 | CFLAGS="$CFLAGS -I$SYSROOT/usr/include" \ 45 | LDFLAGS="$LDFLAGS -L$SYSROOT/usr/lib" \ 46 | DNS=no \ 47 | ZLIB=yes \ 48 | PREFIX=/usr \ 49 | BINDIR=/usr/bin \ 50 | SBINDIR=/usr/bin \ 51 | DESTDIR=$pkgdir \ 52 | install 53 | } 54 | -------------------------------------------------------------------------------- /land/gcc/xelix.h: -------------------------------------------------------------------------------- 1 | #undef TARGET_OS_CPP_BUILTINS 2 | #define TARGET_OS_CPP_BUILTINS() \ 3 | do { \ 4 | builtin_define_std("xelix"); \ 5 | builtin_define_std("unix"); \ 6 | builtin_define("__xelix__"); \ 7 | builtin_define("__unix__"); \ 8 | builtin_assert("system=xelix"); \ 9 | builtin_assert("system=unix"); \ 10 | builtin_assert("system=posix"); \ 11 | } while (0); 12 | 13 | #define DYNAMIC_LINKER "/usr/libexec/system/xelix-loader" 14 | 15 | #undef LIB_SPEC 16 | #define LIB_SPEC "-lc" 17 | 18 | #undef REAL_LIBGCC_SPEC 19 | #define REAL_LIBGCC_SPEC "%{static: -lgcc%s}%{!static: -lgcc_s%s}" 20 | 21 | #undef LINK_SPEC 22 | #define LINK_SPEC "%{shared:-shared} %{!shared: %{static:-static} %{!static: -dynamic-linker " DYNAMIC_LINKER "}}" 23 | 24 | /* Files that are linked before user code. 25 | The %s tells GCC to look for these files in the library directory. */ 26 | #undef STARTFILE_SPEC 27 | #define STARTFILE_SPEC "%{!shared: crt0.o%s} crti.o%s %{!shared: crtbegin.o%s} %{shared: crtbeginS.o%s}" 28 | 29 | #undef ENDFILE_SPEC 30 | #define ENDFILE_SPEC "%{!shared: crtend.o%s} %{shared: crtendS.o%s} crtn.o%s" 31 | 32 | /* Use --as-needed -lgcc_s for eh support. */ 33 | #ifdef HAVE_LD_AS_NEEDED 34 | #define USE_LD_AS_NEEDED 1 35 | #endif 36 | 37 | #undef OBJECT_FORMAT_ELF 38 | #define OBJECT_FORMAT_ELF 39 | -------------------------------------------------------------------------------- /src/fs/ftree.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2019 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | #include 22 | #include 23 | 24 | struct ftree_file { 25 | KAVL_HEAD(struct ftree_file) head; 26 | char path[512]; 27 | 28 | vfs_stat_t stat; 29 | struct ftree_file* children; 30 | }; 31 | 32 | struct ftree_file* vfs_ftree_insert(struct ftree_file* root, char* name, vfs_stat_t* stat); 33 | struct ftree_file* vfs_ftree_insert_path(char* path, vfs_stat_t* stat); 34 | const struct ftree_file* vfs_ftree_find(const struct ftree_file* root, char* name); 35 | const struct ftree_file* vfs_ftree_find_path(char* path); 36 | void vfs_ftree_init(void); 37 | -------------------------------------------------------------------------------- /src/lib/panic.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2011-2021 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | #define assert(b) if(!(b)) panic("Assertion \"" #b "\" in " __FILE__ ":%d failed.", __LINE__) 22 | #define assert_nc(qry) { if(!(qry)) { \ 23 | log(LOG_ERR, "Assertion \"" #qry "\" in " __FILE__ ":%d failed.\n", __LINE__); \ 24 | return; \ 25 | }} 26 | 27 | // lib/walk_stack.asm 28 | extern int walk_stack(intptr_t* addresses, int naddr); 29 | 30 | char* addr2name(intptr_t address); 31 | 32 | void __attribute__((optimize("O0"))) _panic(char* error, ...); 33 | #define panic(args...) { _panic(args); __builtin_unreachable(); } 34 | -------------------------------------------------------------------------------- /src/bsp/i386-walk_stack.asm: -------------------------------------------------------------------------------- 1 | ; Walks backwards through the call stack and builds a list of return addresses. 2 | ; Args: 3 | ; * Array of 32-bit addresses. 4 | ; * Maximum number of elements in array. 5 | ; Return value: The number of addresses stored in the array. 6 | ; Calling convention: cdecl 7 | [global walk_stack] 8 | walk_stack: 9 | ; Create stack frame & save caller's EDI and EBX. 10 | push ebp 11 | mov ebp, esp 12 | mov [ebp - 4], edi 13 | mov [ebp - 8], ebx 14 | ; Set up local registers. 15 | xor eax, eax ; EAX = return value (number of stack frames found). 16 | mov ebx, [esp + 0] ; EBX = old EBP. 17 | mov edi, [esp + 8] ; Destination array pointer in EDI. 18 | mov ecx, [esp + 12] ; Maximum array size in ECX. 19 | .walk: 20 | ; Walk backwards through EBP linked list, storing return addresses in EDI array. 21 | mov edx, [ebx + 4] ; EDX = previous stack frame's IP. 22 | test edx, edx 23 | jz .done ; Leave if it is 0. 24 | mov ebx, [ebx + 0] ; EBX = previous stack frame's BP. 25 | mov [edi], edx ; Copy IP. 26 | add edi, 4 27 | inc eax 28 | loop .walk 29 | .done: 30 | ; Restore caller's EDI and EBX, leave stack frame & return EAX. 31 | mov edi, [ebp - 4] 32 | mov ebx, [ebp - 8] 33 | mov esp, ebp 34 | pop ebp 35 | ret 36 | -------------------------------------------------------------------------------- /src/tasks/mem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2011-2020 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | #include 22 | #include 23 | 24 | // FIXME map below binary 25 | #define TASK_STACK_LOCATION 0xc0000000 26 | 27 | struct task_mmap_ctx { 28 | void *addr; 29 | size_t len; 30 | int prot; 31 | int flags; 32 | int fildes; 33 | size_t off; 34 | }; 35 | 36 | int task_page_fault_cb(task_t* task, void* addr); 37 | char** task_copy_strings(task_t* task, char** array, uint32_t* count); 38 | void* task_sbrk(task_t* task, int32_t length); 39 | void* task_mmap(task_t* task, struct task_mmap_ctx* ctx); 40 | void task_free(task_t* task); 41 | -------------------------------------------------------------------------------- /land/newlib/xelix/xelix.c: -------------------------------------------------------------------------------- 1 | /* xelix.c: Implementations for functions in sys/xelix.h 2 | * Copyright © 2023 Lukas Martini 3 | * 4 | * This file is part of Xelix. 5 | * 6 | * Xelix is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Xelix is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with Xelix. If not, see . 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | void _serial_printf(const char* format, ...) { 25 | if(!_xelix_serial) { 26 | _xelix_serial = fopen("/dev/serial1", "w"); 27 | setvbuf(_xelix_serial, NULL, _IONBF, 0); 28 | } 29 | 30 | va_list args; 31 | va_start (args, format); 32 | vfprintf(_xelix_serial, format, args); 33 | va_end (args); 34 | } 35 | 36 | __attribute__((destructor)) static void _xelix_serial_cleanup(void) { 37 | if(_xelix_serial) { 38 | fclose(_xelix_serial); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /land/coreutils/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=coreutils 2 | pkgver=8.32 3 | pkgrel=3 4 | pkgdesc="The GNU Core Utilities are the basic file, shell and text manipulation utilities of the GNU operating system." 5 | arch=('i786') 6 | arch_override=('i786') 7 | url="https://www.gnu.org/software/coreutils/" 8 | license=('GPL') 9 | makedepend=('openssl' 'libiconv' 'gmp') 10 | source=( 11 | 'https://ftp.gnu.org/gnu/coreutils/coreutils-8.32.tar.xz' 12 | 'coreutils-8.32.patch' 13 | 'coreutils-8.32-patch-two.patch') 14 | sha256sums=( 15 | '4458d8de7849df44ccab15e16b1548b285224dbba5f08fac070c1c0e0bcc4cfa' 16 | '927b1b9d90d09063e8e662e3b41f91f1d216cea0e97a5df247137b4970da1714' 17 | '74d85891fbfd578f779749febfee5a1ca0db65a2349a47b8c5f6b1a38808c1bb') 18 | 19 | prepare() { 20 | patch -p0 < $pkgname-$pkgver.patch 21 | cd $pkgname-$pkgver 22 | autoreconf 23 | ./configure \ 24 | --host=i786-pc-xelix \ 25 | --prefix=/usr \ 26 | --sysconfdir=/etc \ 27 | --disable-threads \ 28 | --disable-acl \ 29 | --disable-xattr \ 30 | --disable-largefile \ 31 | --enable-no-install-program=arch,coreutils,dmesg,mknod,uptime \ 32 | --with-openssl 33 | 34 | # Needs to be applied after configure 35 | patch -p1 < ../coreutils-8.32-patch-two.patch 36 | } 37 | 38 | build() { 39 | cd $pkgname-$pkgver 40 | make 41 | } 42 | 43 | package() { 44 | cd $pkgname-$pkgver 45 | make DESTDIR=$pkgdir install 46 | } 47 | -------------------------------------------------------------------------------- /land/pacman/xelixconfig.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define CACHEDIR "/var/cache/pacman/pkg/" 4 | 5 | #define CONFFILE "/etc/pacman.conf" 6 | 7 | #define DBPATH "/var/lib/pacman/" 8 | 9 | #undef ENABLE_NLS 10 | 11 | #define FSSTATSTYPE struct statvfs 12 | 13 | #define GPGDIR "/etc/pacman.d/gnupg/" 14 | 15 | #undef HAVE_GETMNTENT 16 | 17 | #define HAVE_LIBCURL 1 18 | 19 | #undef HAVE_LIBGPGME 20 | 21 | #define HAVE_LIBSSL 1 22 | 23 | #define HAVE_MNTENT_H 24 | 25 | #define HAVE_STRNDUP 1 26 | 27 | #define HAVE_STRNLEN 1 28 | 29 | #define HAVE_STRSEP 1 30 | 31 | #undef HAVE_STRUCT_STATFS_F_FLAGS 32 | 33 | #define HAVE_STRUCT_STATVFS_F_FLAG 34 | 35 | #define HAVE_STRUCT_STAT_ST_BLKSIZE 36 | 37 | #define HAVE_SWPRINTF 1 38 | 39 | #define HAVE_SYS_MOUNT_H 40 | 41 | #define HAVE_SYS_PARAM_H 42 | 43 | #undef HAVE_SYS_STATVFS_H 44 | 45 | #define HAVE_SYS_TYPES_H 46 | 47 | #define HAVE_TCFLUSH 1 48 | 49 | #define HAVE_TERMIOS_H 50 | 51 | #define HOOKDIR "/etc/pacman.d/hooks/" 52 | 53 | #define LDCONFIG "/sbin/ldconfig" 54 | 55 | #define LIB_VERSION "13.0.1" 56 | 57 | #define LOCALEDIR "/usr/share/locale" 58 | 59 | #define LOGFILE "/var/log/pacman.log" 60 | 61 | #define PACKAGE "pacman" 62 | 63 | #define PACKAGE_VERSION "6.0.1" 64 | 65 | #define PACMAN_DEBUG 1 66 | 67 | #define ROOTDIR "/" 68 | 69 | #define SCRIPTLET_SHELL "/bin/sh" 70 | 71 | #define SYSHOOKDIR "/usr/share/libalpm/hooks/" 72 | 73 | #define _GNU_SOURCE 74 | -------------------------------------------------------------------------------- /land/gfxcompd/src/libxelixgfx.h: -------------------------------------------------------------------------------- 1 | /* Copyright © 2020 Lukas Martini 2 | * 3 | * This file is part of Xelix. 4 | * 5 | * Xelix is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * Xelix is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with Xelix. If not, see . 17 | */ 18 | 19 | #ifndef LIBXELIXGFX_H 20 | #define LIBXELIXGFX_H 21 | 22 | #include 23 | #include 24 | 25 | #define gfx_window_blit_full(win) gfx_window_blit((win), 0, 0, (win)->width, (win)->height) 26 | 27 | struct gfx_window { 28 | uint32_t* addr; 29 | uint32_t bpp; 30 | uint32_t width; 31 | uint32_t height; 32 | uint32_t pitch; 33 | uint32_t size; 34 | uint32_t wid; 35 | }; 36 | 37 | int gfx_open(); 38 | int gfx_close(); 39 | int gfx_window_new(struct gfx_window* win, const char* title, size_t width, size_t height); 40 | int gfx_window_blit(struct gfx_window* win, size_t x, size_t y, size_t width, size_t height); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/lib/time.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2018 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | #include 22 | 23 | extern void scheduler_yield(void); 24 | 25 | struct task; 26 | typedef uint32_t time_t; 27 | struct timeval { 28 | int64_t tv_sec; 29 | int32_t tv_usec; 30 | }; 31 | 32 | uint32_t time_get(void); 33 | int time_get_timeval(struct task* task, struct timeval* tv); 34 | void time_init(void); 35 | 36 | #define sleep(t) sleep_ticks((t) * timer_rate) 37 | static inline void __attribute__((optimize("O0"))) sleep_ticks(time_t timeout) { 38 | const uint32_t until = timer_tick + timeout; 39 | while(timer_tick <= until) { 40 | scheduler_yield(); 41 | } 42 | } 43 | 44 | #define uptime() (timer_tick / timer_rate) 45 | -------------------------------------------------------------------------------- /ext/picotcp/picotcp-1.7.0.patch: -------------------------------------------------------------------------------- 1 | diff -ruPN -x docs picotcp-1.7.0/include/pico_config.h ../../../picotcp-1.7.0/include/pico_config.h 2 | --- picotcp-1.7.0/include/pico_config.h 2017-02-08 11:37:51.000000000 +0100 3 | +++ ../../../picotcp-1.7.0/include/pico_config.h 2018-09-20 18:48:47.729294662 +0200 4 | @@ -227,6 +227,8 @@ 5 | # include "arch/pico_generic_gcc.h" 6 | #elif defined __KERNEL__ 7 | # include "arch/pico_linux.h" 8 | +#elif defined __xelix__ 9 | +# include "arch/pico_xelix.h" 10 | /* #elif defined ... */ 11 | #else 12 | # include "arch/pico_posix.h" 13 | --- picotcp-1.7.0/Makefile 2017-02-08 11:37:51.000000000 +0100 14 | +++ picotcp-1.7.0/Makefile 2019-02-09 12:50:13.795152613 +0100 15 | @@ -22,7 +22,7 @@ 16 | RTOS?=0 17 | GENERIC?=0 18 | PTHREAD?=0 19 | -ADDRESS_SANITIZER?=1 20 | +ADDRESS_SANITIZER?=0 21 | GCOV?=0 22 | 23 | # Default compiled-in protocols 24 | @@ -39,23 +39,23 @@ 25 | DEVLOOP?=1 26 | PING?=1 27 | DHCP_CLIENT?=1 28 | -DHCP_SERVER?=1 29 | -DNS_CLIENT?=1 30 | -MDNS?=1 31 | -DNS_SD?=1 32 | -SNTP_CLIENT?=1 33 | -IPFILTER?=1 34 | +DHCP_SERVER?=0 35 | +DNS_CLIENT?=1 36 | +MDNS?=0 37 | +DNS_SD?=0 38 | +SNTP_CLIENT?=0 39 | +IPFILTER?=0 40 | CRC?=1 41 | OLSR?=0 42 | -SLAACV4?=1 43 | -TFTP?=1 44 | -AODV?=1 45 | +SLAACV4?=0 46 | +TFTP?=0 47 | +AODV?=0 48 | MEMORY_MANAGER?=0 49 | MEMORY_MANAGER_PROFILING?=0 50 | TUN?=0 51 | TAP?=0 52 | PCAP?=0 53 | -PPP?=1 54 | +PPP?=0 55 | 6LOWPAN?=0 56 | IEEE802154?=0 57 | IPC?=0 58 | -------------------------------------------------------------------------------- /land/gcc/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=gcc 2 | pkgver=13.1.0 3 | pkgrel=1 4 | pkgdesc="An optimizing compiler supporting various programming languages, hardware architectures and operating systems." 5 | arch=('i786') 6 | makedepend=('gmp' 'mpfr' 'mpc' 'zlib') 7 | url="https://gcc.gnu.org/" 8 | license=('GPL') 9 | source=( 10 | "https://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver/$pkgname-$pkgver.tar.xz" 11 | "$pkgname-$pkgver.patch" 12 | 'xelix.h' 13 | ) 14 | sha256sums=( 15 | '61d684f0aa5e76ac6585ad8898a2427aade8979ed5e7f85492286c4dfc13ee86' 16 | 'SKIP' 17 | 'SKIP' 18 | ) 19 | 20 | prepare() { 21 | patch -p0 < $pkgname-$pkgver.patch 22 | cp xelix.h $pkgname-$pkgver/gcc/config/ 23 | } 24 | 25 | build() { 26 | rm -r build || true 27 | mkdir build 28 | cd build 29 | 30 | unset CFLAGS CPPFLAGS CXXFLAGS 31 | export CFLAGS="-D__int64_t_defined" 32 | export CPPFLAGS="-D__int64_t_defined" 33 | ../gcc-$pkgver/configure \ 34 | --host=i786-pc-xelix \ 35 | --target=i786-pc-xelix \ 36 | --with-gmp=$SYSROOT/usr \ 37 | --with-mpfr=$SYSROOT/usr \ 38 | --with-mpc=$SYSROOT/usr \ 39 | --prefix=/usr \ 40 | --sysconfdir=/etc \ 41 | --libdir=/usr/lib \ 42 | --libexecdir=/usr/lib \ 43 | --mandir=/usr/share/man \ 44 | --infodir=/usr/share/info \ 45 | --enable-languages=c,c++ \ 46 | --with-system-zlib \ 47 | --enable-shared 48 | 49 | make -j$(nproc) all-gcc 50 | } 51 | 52 | package() { 53 | cd build 54 | make DESTDIR=$pkgdir install-gcc 55 | } 56 | -------------------------------------------------------------------------------- /land/ffmpeg/ffmpeg.patch: -------------------------------------------------------------------------------- 1 | --- configure 2021-07-12 15:50:31.741221429 +0200 2 | +++ configure 2021-07-12 15:50:43.227801363 +0200 3 | @@ -5579,6 +5579,8 @@ case $target_os in 4 | ;; 5 | minix) 6 | ;; 7 | + xelix) 8 | + ;; 9 | none) 10 | ;; 11 | *) 12 | --- libavdevice/Makefile 2021-07-12 16:37:00.934411449 +0200 13 | +++ libavdevice/Makefile 2021-07-12 16:37:26.164252390 +0200 14 | @@ -37,6 +37,7 @@ OBJS-$(CONFIG_OPENAL_INDEV) 15 | OBJS-$(CONFIG_OPENGL_OUTDEV) += opengl_enc.o 16 | OBJS-$(CONFIG_OSS_INDEV) += oss_dec.o oss.o 17 | OBJS-$(CONFIG_OSS_OUTDEV) += oss_enc.o oss.o 18 | +OBJS-$(CONFIG_XELIXSND_OUTDEV) += xelixsnd_enc.o xelixsnd.o 19 | OBJS-$(CONFIG_PULSE_INDEV) += pulse_audio_dec.o \ 20 | pulse_audio_common.o timefilter.o 21 | OBJS-$(CONFIG_PULSE_OUTDEV) += pulse_audio_enc.o \ 22 | --- libavdevice/alldevices.c 2021-07-12 16:38:35.433815146 +0200 23 | +++ libavdevice/alldevices.c 2021-07-12 16:38:49.030395898 +0200 24 | @@ -45,6 +45,7 @@ extern AVInputFormat ff_openal_demuxer; 25 | extern AVOutputFormat ff_opengl_muxer; 26 | extern AVInputFormat ff_oss_demuxer; 27 | extern AVOutputFormat ff_oss_muxer; 28 | +extern AVOutputFormat ff_xelixsnd_muxer; 29 | extern AVInputFormat ff_pulse_demuxer; 30 | extern AVOutputFormat ff_pulse_muxer; 31 | extern AVOutputFormat ff_sdl2_muxer; 32 | -------------------------------------------------------------------------------- /land/tar/tar-1.32.patch: -------------------------------------------------------------------------------- 1 | --- tar-1.32/build-aux/config.sub 2019-01-02 19:15:07.000000000 +0100 2 | +++ tar-1.32/build-aux/config.sub 2020-01-10 09:43:59.005268736 +0100 3 | @@ -1361,7 +1361,7 @@ case $os in 4 | | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ 5 | | skyos* | haiku* | rdos* | toppers* | drops* | es* \ 6 | | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ 7 | - | midnightbsd* | amdhsa* | unleashed* | emscripten*) 8 | + | midnightbsd* | amdhsa* | unleashed* | emscripten* | xelix*) 9 | # Remember, each alternative MUST END IN *, to match a version number. 10 | ;; 11 | qnx*) 12 | --- tar-1.32/src/list.c 2019-01-02 19:07:48.000000000 +0100 13 | +++ tar-1.32/src/list.c 2020-01-10 09:45:00.472065937 +0100 14 | @@ -681,9 +681,10 @@ decode_header (union block *header, stru 15 | { 16 | case BLKTYPE: 17 | case CHRTYPE: 18 | - stat_info->stat.st_rdev = 19 | +/* stat_info->stat.st_rdev = 20 | makedev (MAJOR_FROM_HEADER (header->header.devmajor), 21 | MINOR_FROM_HEADER (header->header.devminor)); 22 | +*/ 23 | break; 24 | 25 | default: 26 | --- tar-1.32/src/checkpoint.c 2019-01-13 20:44:05.000000000 +0100 27 | +++ tar-1.32/src/checkpoint.c 2020-01-10 09:47:29.799053223 +0100 28 | @@ -429,7 +429,7 @@ run_checkpoint_actions (bool do_write) 29 | case cop_wait: 30 | { 31 | int n; 32 | - sigwait (&sigs, &n); 33 | + //sigwait (&sigs, &n); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/lib/list.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2011 Fritz Grimpen 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | 22 | typedef struct list list_t; 23 | 24 | struct list *list_new(void); 25 | struct list *list_alloc(void * (*allocator)(int len)); 26 | 27 | void *list_append(struct list *l, void *data); 28 | void *list_prepend(struct list *l, void *data); 29 | void *list_insert(struct list *l, void *data, int offset); 30 | 31 | void *list_get(struct list *l, int offset); 32 | 33 | void **list_flush(struct list *l, int offset, void **data, int len); 34 | void *list_delete(struct list *l, int offset); 35 | void **list_del_range(struct list *l, int offset, int length, void **data, int len); 36 | 37 | void list_destroy(struct list *l); 38 | void list_clean(struct list *l); 39 | -------------------------------------------------------------------------------- /land/newlib/xelix/sys/limits.h: -------------------------------------------------------------------------------- 1 | /* Copyright © 2016-2018 Lukas Martini 2 | * 3 | * This file is part of Xelix. 4 | * 5 | * Xelix is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * Xelix is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with Xelix. If not, see . 17 | */ 18 | 19 | #ifndef _SYS_LIMITS_H 20 | #define _SYS_LIMITS_H 21 | 22 | #define PATH_MAX 1024 23 | #define CHAR_BIT 8 24 | #define SCHAR_MIN -127 25 | #define SCHAR_MAX 127 26 | #define UCHAR_MAX 255 27 | #define CHAR_MIN SCHAR_MIN 28 | #define CHAR_MAX SCHAR_MAX 29 | #define MB_LEN_MAX 1 30 | #define SHRT_MIN -32767 31 | #define SHRT_MAX 32767 32 | #define USHRT_MAX 65535 33 | #define INT_MIN -32767 34 | #define INT_MAX 32767 35 | #define UINT_MAX 65535 36 | #define LONG_MIN -2147483647 37 | #define LONG_MAX 2147483647 38 | #define ULONG_MAX 4294967295 39 | #define LLONG_MIN -9223372036854775807 40 | #define LLONG_MAX 9223372036854775807 41 | #define ULLONG_MAX 18446744073709551615 42 | 43 | #endif SYS_LIMITS_H 44 | -------------------------------------------------------------------------------- /util/findleaks.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # This is all quite hacky, but it's decent enough for quick debugging 3 | 4 | import sys 5 | import re 6 | 7 | allocs = dict() 8 | kmalloc_re = re.compile('^kmalloc\: (?P[^\:]+)\:(?P\d+) (?P\S+) (?P0x[\da-f]+).+ RESULT (?P0x[\da-f]+)$') 9 | kfree_re = re.compile('^kfree\: (?P[^\:]+)\:(?P\d+) (?P\S+) (?P0x[\da-f]+) size (?P0x[\da-f]+)$') 10 | 11 | def main(): 12 | for line in sys.stdin.readlines(): 13 | kfree_match = re.match(kfree_re, line.rstrip()) 14 | kmalloc_match = re.match(kmalloc_re, line.rstrip()) 15 | 16 | if not kfree_match and not kmalloc_match: 17 | if 'kfree' in line or 'kmallooc' in line: 18 | print('Could not match "{}"'.format(line)) 19 | continue 20 | 21 | if kfree_match: 22 | try: 23 | del allocs[kfree_match.group('addr')] 24 | except KeyError: 25 | pass 26 | continue 27 | 28 | allocs[kmalloc_match.group('addr')] = { 29 | 'file': kmalloc_match.group('file'), 30 | 'line': kmalloc_match.group('line'), 31 | 'func': kmalloc_match.group('func'), 32 | 'size': kmalloc_match.group('orig_size'), 33 | } 34 | 35 | 36 | if not len(allocs): 37 | print('No memory leaks found') 38 | else: 39 | print('Potential memory leaks found') 40 | 41 | for addr, arr in allocs.items(): 42 | print('{}:\tsize {}\t{} in {}:{}'.format(addr, arr['size'], arr['func'], arr['file'], arr['line'])) 43 | 44 | if __name__ == '__main__': 45 | main() 46 | -------------------------------------------------------------------------------- /land/newlib/xelix/sys/mman.h: -------------------------------------------------------------------------------- 1 | /* Copyright © 2023 Lukas Martini 2 | * 3 | * This file is part of Xelix. 4 | * 5 | * Xelix is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * Xelix is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with Xelix. If not, see . 17 | */ 18 | 19 | #ifndef _SYS_MMAN_H 20 | #define _SYS_MMAN_H 21 | 22 | #include 23 | 24 | #define PROT_NONE 1 25 | #define PROT_READ 2 26 | #define PROT_WRITE 4 27 | #define PROT_EXEC 8 28 | 29 | #define MAP_PRIVATE 1 30 | #define MAP_SHARED 2 31 | #define MAP_ANONYMOUS 4 32 | #define MAP_FIXED 8 33 | 34 | #define MAP_FAILED ((void*)NULL) 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | void* mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset); 41 | int munmap(void *addr, size_t length); 42 | 43 | int shm_open(const char *name, int oflag, mode_t mode); 44 | int shm_unlink(const char *name); 45 | 46 | #ifdef __cplusplus 47 | } /* C++ */ 48 | #endif 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /.github/workflows/kernel.yml: -------------------------------------------------------------------------------- 1 | name: Kernel binary build 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | paths: 9 | - 'src/**' 10 | - 'ext/**' 11 | - 'Makefile.static' 12 | - 'configure' 13 | - 'Kconfig' 14 | - '.github/workflows/kernel.yml' 15 | 16 | jobs: 17 | kernel: 18 | runs-on: ubuntu-latest 19 | container: 20 | image: ghcr.io/lutoma/xelix/toolchain:latest 21 | 22 | steps: 23 | - name: Download PKGBUILD 24 | run: 'wget -q https://raw.githubusercontent.com/lutoma/xelix/main/land/xelix-kernel/PKGBUILD' 25 | 26 | - name: Adjust dir permissions 27 | run: 'sudo chown -R dev: .' 28 | 29 | - name: Import signing key 30 | run: 'echo "${{ secrets.GPG_PRIVATE_KEY }}" | sudo -u dev gpg --import' 31 | 32 | - name: Run makepkg 33 | run: 'sudo -u dev makepkg -Ad --sign' 34 | 35 | - name: Adjust package name 36 | run: 'rename x86_64 i786 *' 37 | 38 | - name: 'Create package directory' 39 | run: 'mkdir kernel-pkg' 40 | 41 | - name: Import SSH key 42 | run: 'echo "${{ secrets.SSH_KEY }}" > /root/.ssh/id_ed25519 && chmod 600 /root/.ssh/id_ed25519' 43 | 44 | - name: Upload to repo server 45 | run: rsync *.pkg.tar.gz* repoupdate@pkgs.xelix.org:/var/www/pkgs.xelix.org/core/i786/ 46 | 47 | - name: Update repository 48 | run: ssh repoupdate@pkgs.xelix.org /usr/local/bin/repo-remote-update core i786 xelix-kernel *.pkg.tar.gz 49 | -------------------------------------------------------------------------------- /src/fs/poll.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2019-2020 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | #include 22 | 23 | // Poll events 24 | // Testable events (may be specified in events field) 25 | #define POLLIN 0x0001 26 | #define POLLPRI 0x0002 27 | #define POLLOUT 0x0004 28 | #define POLLRDNORM 0x0040 29 | #define POLLWRNORM POLLOUT 30 | #define POLLRDBAND 0x0080 31 | #define POLLWRBAND 0x0100 32 | // Non-testable events (may not be specified in events field). 33 | #define POLLERR 0x0008 34 | #define POLLHUP 0x0010 35 | #define POLLNVAL 0x0020 36 | 37 | struct pollfd { 38 | int fd; /* file descriptor */ 39 | short events; /* requested events */ 40 | short revents; /* returned events */ 41 | }; 42 | 43 | int vfs_poll(struct task* task, struct pollfd* fds, uint32_t nfds, int timeout); 44 | -------------------------------------------------------------------------------- /src/block/null.c: -------------------------------------------------------------------------------- 1 | /* null.c: /dev/null and /dev/zero 2 | * Copyright © 2018 Lukas Martini 3 | * 4 | * This file is part of Xelix. 5 | * 6 | * Xelix is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Xelix is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with Xelix. If not, see . 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | static size_t null_read(struct vfs_callback_ctx* ctx, void* dest, size_t size) { 25 | if(ctx->fp->meta == 1) { 26 | bzero(dest, size); 27 | return size; 28 | } else { 29 | return 0; 30 | } 31 | } 32 | 33 | static size_t null_write(struct vfs_callback_ctx* ctx, void* source, size_t size) { 34 | return size; 35 | } 36 | 37 | void block_null_init(void) { 38 | struct vfs_callbacks sfs_cb = { 39 | .read = null_read, 40 | .write = null_write, 41 | }; 42 | 43 | struct sysfs_file* null = sysfs_add_dev("null", &sfs_cb); 44 | struct sysfs_file* zero = sysfs_add_dev("zero", &sfs_cb); 45 | null->meta = (void*)0; 46 | zero->meta = (void*)1; 47 | } 48 | -------------------------------------------------------------------------------- /src/fs/mount.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2020 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | #include 22 | #include 23 | 24 | struct vfs_callback_ctx; 25 | struct vfs_mountpoint { 26 | struct vfs_mountpoint* prev; 27 | struct vfs_mountpoint* next; 28 | char path[265]; 29 | void* instance; 30 | char type[50]; 31 | struct vfs_block_dev* dev; 32 | struct vfs_callbacks callbacks; 33 | }; 34 | 35 | int vfs_mount_register(struct vfs_block_dev* dev, const char* path, void* instance, const char* type, 36 | struct vfs_callbacks* callbacks); 37 | struct vfs_mountpoint* vfs_mount_get(const char* path, char** mount_path); 38 | int vfs_mount(struct task* task, const char* source, const char* target, int flags); 39 | int vfs_umount(struct task* task, const char* target, int flags); 40 | void vfs_mount_init(const char* root_path); 41 | -------------------------------------------------------------------------------- /src/mem/page_alloc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2020 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #define PAGE_ALLOC_BITMAP_SIZE 0xfffff000 / PAGE_SIZE 28 | 29 | struct mem_page_alloc_ctx { 30 | spinlock_t lock; 31 | uint32_t bitmap_data[bitmap_size(PAGE_ALLOC_BITMAP_SIZE)]; 32 | struct bitmap bitmap; 33 | }; 34 | 35 | void* mem_page_alloc(struct mem_page_alloc_ctx* ctx, size_t size); 36 | int mem_page_alloc_at(struct mem_page_alloc_ctx* ctx, void* addr, size_t size); 37 | int mem_page_free(struct mem_page_alloc_ctx* ctx, uint32_t num, size_t size); 38 | int mem_page_alloc_stats(struct mem_page_alloc_ctx* ctx, uint32_t* total, uint32_t* used); 39 | int mem_page_alloc_new(struct mem_page_alloc_ctx* ctx); 40 | -------------------------------------------------------------------------------- /land/gfxcompd/src/render.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include "mouse.h" 6 | 7 | int gfx_fd; 8 | 9 | struct { 10 | unsigned int id; 11 | bool used; 12 | 13 | uintptr_t _kernel_int; 14 | void* addr; 15 | uintptr_t _kernel_int2; 16 | 17 | int bpp; 18 | int width; 19 | int height; 20 | int pitch; 21 | size_t size; 22 | } gfx_handle; 23 | 24 | struct surface { 25 | uint32_t id; 26 | struct surface* next; 27 | struct surface* prev; 28 | cairo_surface_t* cs; 29 | 30 | size_t width; 31 | size_t height; 32 | 33 | int32_t x; 34 | int32_t y; 35 | int32_t z; 36 | 37 | bool show:1; 38 | 39 | void* mouse_ev_meta; 40 | void (*mouse_ev_handler)(void* meta, uint32_t x, uint32_t y, struct mouse_event* ev); 41 | 42 | // For debugging only 43 | const char* name; 44 | }; 45 | 46 | struct window; 47 | struct surface* surfaces; 48 | 49 | static inline bool surface_intersect(struct surface* surface, size_t width, size_t height, size_t x, size_t y) { 50 | return (surface->x < (x + width) && (surface->x + surface->width) > x && 51 | surface->y < (y + height) && (surface->y + surface->height) > y); 52 | } 53 | 54 | #define surface_blit_full(s) surface_blit(s, (s)->width, (s)->height, 0, 0) 55 | void surface_blit(struct surface* surface, size_t width, size_t height, size_t x, size_t y); 56 | 57 | struct surface* surface_new(cairo_surface_t* cs, size_t width, size_t height); 58 | void surface_move(struct surface* surface, int32_t x, int32_t y); 59 | void surface_add(struct surface* surface); 60 | void render_init(); 61 | -------------------------------------------------------------------------------- /docs/boot.md: -------------------------------------------------------------------------------- 1 | # Boot & startup 2 | 3 | ## Bootloader 4 | 5 | On x86, Xelix uses GRUB 2 as bootloader. In theory, any bootloader that understands the [Multiboot 2](https://www.gnu.org/software/grub/manual/multiboot2/multiboot.html) standard should work. The kernel binary is a regular [ELF file](https://en.wikipedia.org/wiki/Executable_and_Linkable_Format) and gets loaded into memory using the ELF program headers. 6 | 7 | The Multiboot 2 standard also specifies a number of tags the kernel can leave in the beginning of the binary to request certain information or behaviour from the bootloader. These are located in `src/boot/i386-boot.asm`. Xelix only sets the [Framebuffer request](https://www.gnu.org/software/grub/manual/multiboot2/multiboot.html#The-framebuffer-tag-of-Multiboot2-header) tag. 8 | 9 | Xelix uses a linker script for LD (`src/boot/i386-linker.ld` for x86) to ensure it's always loaded at 0x100000. The linker script also ensures the multiboot headers are always at the beginning of the binary, and provides the code with `__kernel_start` and `__kernel_ènd` symbols. 10 | 11 | 12 | ## Early startup 13 | 14 | After GRUB is done, it hands control to the entry function `_start` in `src/boot/i386-boot.asm`. The assembly snippet stores the multiboot magic and header pointer left in CPU registers by GRUB, sets up the kernel stack and hands control to `main()` in `src/boot/init.c`. 15 | 16 | After the intialization routines have been run, the init program will be added to the scheduler and started. The init process can be set using the `init=/usr/bin/foo` command line argument. 17 | -------------------------------------------------------------------------------- /src/tasks/scheduler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2011-2019 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | enum scheduler_state { 26 | SCHEDULER_OFF, 27 | SCHEDULER_INITIALIZING, 28 | SCHEDULER_INITIALIZED 29 | }; 30 | 31 | struct scheduler_qentry { 32 | struct scheduler_qentry* next; 33 | struct scheduler_qentry* prev; 34 | task_t* task; 35 | worker_t* worker; 36 | }; 37 | 38 | extern enum scheduler_state scheduler_state; 39 | 40 | void scheduler_add(task_t *task); 41 | void scheduler_add_worker(worker_t* worker); 42 | task_t* scheduler_find(uint32_t pid); 43 | void scheduler_store_isf(isf_t* last_regs); 44 | task_t* scheduler_get_current(void); 45 | void scheduler_yield(void); 46 | isf_t* scheduler_select(isf_t* lastRegs); 47 | void scheduler_init(void); 48 | -------------------------------------------------------------------------------- /land/ffmpeg/xelixsnd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVDEVICE_XELIXSND_H 20 | #define AVDEVICE_XELIXSND_H 21 | 22 | #include "libavcodec/avcodec.h" 23 | 24 | #include "libavformat/avformat.h" 25 | 26 | #define XELIXSND_AUDIO_BLOCK_SIZE 4096 27 | 28 | typedef struct XelixSNDAudioData { 29 | AVClass *class; 30 | int fd; 31 | int sample_rate; 32 | int channels; 33 | int frame_size; /* in bytes ! */ 34 | enum AVCodecID codec_id; 35 | uint8_t buffer[XELIXSND_AUDIO_BLOCK_SIZE]; 36 | int buffer_ptr; 37 | } XelixSNDAudioData; 38 | 39 | int ff_xelixsnd_audio_open(AVFormatContext *s1, int is_output, 40 | const char *audio_device); 41 | 42 | int ff_xelixsnd_audio_close(XelixSNDAudioData *s); 43 | 44 | #endif /* AVDEVICE_XELIXSND_H */ 45 | -------------------------------------------------------------------------------- /land/libarchive/libarchive-3.7.2.patch: -------------------------------------------------------------------------------- 1 | --- build/autoconf/config.sub 2023-11-12 01:07:32.604168131 +0100 2 | +++ build/autoconf/config.sub 2023-11-12 01:07:40.876166826 +0100 3 | @@ -1754,7 +1754,7 @@ case $os in 4 | | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ 5 | | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ 6 | | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \ 7 | - | fiwix* ) 8 | + | fiwix* | xelix*) 9 | ;; 10 | # This one is extra strict with allowed versions 11 | sco3.2v2 | sco3.2v[4-9]* | sco5v6*) 12 | --- libarchive/archive_write_set_format_iso9660.c 2023-07-29 19:27:43.000000000 +0200 13 | +++ libarchive/archive_write_set_format_iso9660.c.new 2023-11-12 01:53:04.009872470 +0100 14 | @@ -2503,18 +2503,7 @@ static long 15 | get_gmoffset(struct tm *tm) 16 | { 17 | long offset; 18 | - 19 | -#if defined(HAVE__GET_TIMEZONE) 20 | - _get_timezone(&offset); 21 | -#elif defined(__CYGWIN__) || defined(__MINGW32__) || defined(__BORLANDC__) 22 | - offset = _timezone; 23 | -#else 24 | - offset = timezone; 25 | -#endif 26 | - offset *= -1; 27 | - if (tm->tm_isdst) 28 | - offset += 3600; 29 | - return (offset); 30 | + return 0; 31 | } 32 | #endif 33 | 34 | --- libarchive/archive_random.c 2023-09-12 00:05:19.000000000 +0200 35 | +++ libarchive/archive_random.c.new 2023-11-12 01:54:04.170545328 +0100 36 | @@ -30,6 +30,8 @@ __FBSDID("$FreeBSD$"); 37 | #include 38 | #endif 39 | 40 | +#undef HAVE_PTHREAD_H 41 | + 42 | #if !defined(HAVE_ARC4RANDOM_BUF) && (!defined(_WIN32) || defined(__CYGWIN__)) 43 | 44 | #ifdef HAVE_FCNTL 45 | -------------------------------------------------------------------------------- /land/newlib/xelix/crt0.c: -------------------------------------------------------------------------------- 1 | /* crt0.c: crt0 for userland tasks 2 | * Copyright © 2018-2021 Lukas Martini 3 | * 4 | * This file is part of Xelix. 5 | * 6 | * Xelix is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Xelix is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with Xelix. If not, see . 18 | */ 19 | 20 | #define _GNU_SOURCE 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | int h_errno; 28 | extern int main(int argc, char** argv); 29 | extern void __libc_init_array(); 30 | extern void __libc_fini_array(); 31 | 32 | // These are defined as extern in sys/xelix.h 33 | struct _xelix_execdata* _xelix_execdata; 34 | const char* _progname; 35 | FILE* _xelix_serial = NULL; 36 | 37 | void __attribute__((fastcall, noreturn)) _start(void) { 38 | __libc_init_array(); 39 | 40 | _xelix_execdata = (struct _xelix_execdata*)0x5000; 41 | environ = _xelix_execdata->env; 42 | 43 | atexit(__libc_fini_array); 44 | int ret = main(_xelix_execdata->argc, _xelix_execdata->argv); 45 | exit(ret); 46 | __builtin_unreachable(); 47 | } 48 | -------------------------------------------------------------------------------- /land/ncurses/xelix.terminfo: -------------------------------------------------------------------------------- 1 | xelix|xelix kernel tty - identical to ansi except for the added f1-f12 key sequences, 2 | am, mc5i, mir, msgr, 3 | colors#8, cols#80, it#8, lines#24, ncv#3, pairs#64, 4 | acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376, 5 | bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, clear=\E[H\E[J, 6 | cr=\r, cub=\E[%p1%dD, cub1=\E[D, cud=\E[%p1%dB, cud1=\E[B, 7 | cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, 8 | cuu=\E[%p1%dA, cuu1=\E[A, dch=\E[%p1%dP, dch1=\E[P, 9 | dl=\E[%p1%dM, dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, 10 | el1=\E[1K, home=\E[H, hpa=\E[%i%p1%dG, ht=\E[I, hts=\EH, 11 | ich=\E[%p1%d@, il=\E[%p1%dL, il1=\E[L, ind=\n, 12 | indn=\E[%p1%dS, invis=\E[8m, kbs=^H, kcbt=\E[Z, kcub1=\E[D, 13 | kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, khome=\E[H, kich1=\E[L, 14 | mc4=\E[4i, mc5=\E[5i, nel=\r\E[S, op=\E[39;49m, 15 | rep=%p1%c\E[%p2%{1}%-%db, rev=\E[7m, rin=\E[%p1%dT, 16 | rmacs=\E[10m, rmpch=\E[10m, rmso=\E[m, rmul=\E[m, 17 | s0ds=\E(B, s1ds=\E)B, s2ds=\E*B, s3ds=\E+B, 18 | setab=\E[4%p1%dm, setaf=\E[3%p1%dm, 19 | sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m, 20 | sgr0=\E[0;10m, smacs=\E[11m, smpch=\E[11m, smso=\E[7m, 21 | smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, u7=\E[6n, 22 | u8=\E[?%[;0123456789]c, u9=\E[c, vpa=\E[%i%p1%dd, 23 | 24 | # Function keys 25 | kf1=\EOP, 26 | kf2=\EOQ, 27 | kf3=\EOR, 28 | kf4=\EOS, 29 | kf5=\E[15~, 30 | kf6=\E[17~, 31 | kf7=\E[18~, 32 | kf8=\E[19~, 33 | kf9=\E[20~, 34 | kf10=\E[21~, 35 | kf11=\E[23~, 36 | kf12=\E[24~, 37 | -------------------------------------------------------------------------------- /mkdocs.yml: -------------------------------------------------------------------------------- 1 | site_name: Xelix documentation 2 | repo_name: 'lutoma/xelix' 3 | repo_url: 'https://github.com/lutoma/xelix' 4 | site_url: 'https://xelix.org' 5 | edit_uri: edit/main/docs/ 6 | markdown_extensions: 7 | - smarty 8 | - tables 9 | - admonition 10 | - def_list 11 | - pymdownx.highlight 12 | - pymdownx.superfences: 13 | custom_fences: 14 | - name: mermaid 15 | class: mermaid 16 | format: !!python/name:mermaid2.fence_mermaid 17 | - pymdownx.inlinehilite 18 | - toc: 19 | permalink: true 20 | plugins: 21 | - search 22 | - mermaid2 23 | theme: 24 | name: 'material' 25 | logo: 'images/92014.svg' 26 | features: 27 | # breaks mermaid2 28 | # - navigation.instant 29 | - navigation.tracking 30 | # - navigation.tabs 31 | - navigation.sections 32 | - navigation.top 33 | # - toc.integrate 34 | 35 | # breaks mermaid2 36 | # palette: 37 | # - media: "(prefers-color-scheme: light)" 38 | # scheme: default 39 | # primary: indigo 40 | # toggle: 41 | # icon: material/toggle-switch-off-outline 42 | # name: Switch to dark mode 43 | # - media: "(prefers-color-scheme: dark)" 44 | # scheme: slate 45 | # primary: indigo 46 | # accent: deep orange 47 | # toggle: 48 | # icon: material/toggle-switch 49 | # name: Switch to light mode 50 | 51 | nav: 52 | - Home: 'index.md' 53 | 54 | - 'Userland': 55 | - 'xelix-utils.md' 56 | - 'gfxcompd.md' 57 | - 'Kernel': 58 | - 'compiling.md' 59 | - boot.md 60 | - mem.md 61 | - int.md 62 | - tasks.md 63 | - fs.md 64 | - net.md 65 | - 'Reference': 66 | - lib.md 67 | -------------------------------------------------------------------------------- /.github/workflows/nightly.yaml: -------------------------------------------------------------------------------- 1 | name: Build nightly image 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | - cron: '35 4 * * *' 7 | 8 | jobs: 9 | image: 10 | runs-on: ubuntu-latest 11 | container: 12 | image: ghcr.io/lutoma/xelix/toolchain:latest 13 | options: --privileged 14 | 15 | steps: 16 | - name: Download build script 17 | run: 'wget -q https://raw.githubusercontent.com/lutoma/xelix/main/util/build-image.sh' 18 | 19 | - name: Build image 20 | run: bash build-image.sh xelix-nightly.img 21 | 22 | - name: Convert image 23 | run: | 24 | qemu-img convert -f raw xelix-nightly.img -O qcow2 xelix-nightly.qcow2 25 | qemu-img convert -f raw xelix-nightly.img -O vdi xelix-nightly.vdi 26 | qemu-img convert -f raw xelix-nightly.img -O vmdk xelix-nightly.vmdk 27 | qemu-img convert -f raw xelix-nightly.img -O vhdx xelix-nightly.vhdx 28 | 29 | - name: Import signing key 30 | run: 'echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --import' 31 | 32 | - name: Sign images 33 | run: | 34 | gpg --detach-sign --armor xelix-nightly.qcow2 35 | gpg --detach-sign --armor xelix-nightly.vdi 36 | gpg --detach-sign --armor xelix-nightly.vmdk 37 | gpg --detach-sign --armor xelix-nightly.vhdx 38 | 39 | - name: Import SSH key 40 | run: 'echo "${{ secrets.SSH_KEY }}" > /root/.ssh/id_ed25519 && chmod 600 /root/.ssh/id_ed25519' 41 | 42 | 43 | - name: Upload to server 44 | run: rsync -z --exclude xelix-nightly.img xelix-nightly.* repoupdate@pkgs.xelix.org:/var/www/pkgs.xelix.org 45 | -------------------------------------------------------------------------------- /land/newlib/xelix/include/sgtty.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1991, 1992, 1996, 1998, 1999 Free Software Foundation, Inc. 2 | This file is part of the GNU C Library. 3 | 4 | The GNU C Library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | The GNU C Library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with the GNU C Library; if not, write to the Free 16 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 17 | 02111-1307 USA. */ 18 | 19 | #ifndef _SGTTY_H 20 | #define _SGTTY_H 1 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | //#include 26 | 27 | #include 28 | 29 | /* On some systems this type is not defined by ; 30 | in that case, the functions are just stubs that return ENOSYS. */ 31 | struct sgttyb; 32 | 33 | /* Fill in *PARAMS with terminal parameters associated with FD. */ 34 | extern int gtty (int __fd, struct sgttyb *__params); 35 | 36 | /* Set the terminal parameters associated with FD to *PARAMS. */ 37 | extern int stty (int __fd, __const struct sgttyb *__params); 38 | 39 | #ifdef __cplusplus 40 | } /* C++ */ 41 | #endif 42 | #endif /* sgtty.h */ 43 | -------------------------------------------------------------------------------- /src/mem/paging.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Copyright © 2011-2022 Lukas Martini 4 | * 5 | * This file is part of Xelix. 6 | * 7 | * Xelix is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Xelix is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Xelix. If not, see . 19 | */ 20 | 21 | #include 22 | 23 | #define PAGE_SIZE 0x1000 24 | 25 | struct page { 26 | bool present:1; 27 | bool rw:1; 28 | bool user:1; 29 | bool write_through:1; 30 | bool cache_disabled:1; 31 | bool accessed:1; 32 | // Or page size for dir entries 33 | bool dirty:1; 34 | bool global:1; 35 | 36 | uint8_t _unused:4; 37 | 38 | uint32_t frame:20; 39 | }; 40 | 41 | struct paging_context { 42 | struct page dir_entries[1024]; 43 | }; 44 | 45 | extern struct paging_context* paging_kernel_ctx UL_VISIBLE("bss"); 46 | extern void* paging_alloc_end; 47 | 48 | struct vmem_range; 49 | void paging_set_range(struct paging_context* ctx, void* virt_addr, void* phys_addr, size_t size, int flags); 50 | void paging_clear_range(struct paging_context* ctx, void* virt_addr, size_t size); 51 | void paging_rm_context(struct paging_context* ctx); 52 | void paging_init(void); 53 | --------------------------------------------------------------------------------