Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions bootstrap.d/x11-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ packages:
- nettle
- xkbcomp
- pixman
- libpciaccess
configure:
- args:
- 'meson'
Expand All @@ -125,7 +126,7 @@ packages:
- '--cross-file'
- '@SOURCE_ROOT@/scripts/meson-@OPTION:[email protected]'
- '--prefix=/usr'
- '-Dxorg=false'
- '-Dxorg=true'
- '-Dxephyr=false'
- '-Dxwayland=true'
- '-Dxnest=false'
Expand All @@ -136,7 +137,6 @@ packages:
- '-Dvendor_name="The Managarm Project"'
- '-Dvendor_name_short="Managarm"'
- '-Dsuid_wrapper=false'
- '-Dpciaccess=false'
- '-Ddpms=false'
- '-Dscreensaver=false'
- '-Dxres=false'
Expand All @@ -145,9 +145,17 @@ packages:
- '-Dxvmc=false'
- '-Dsystemd_logind=false'
- '-Dsecure-rpc=false'
- '-Dglamor=false'
- '-Dvbe=false'
- '-Dint10=false'
- '-Dvgahw=false'
- '@THIS_SOURCE_DIR@'
build:
- args: ['ninja']
- args: ['ninja', 'install']
environ:
DESTDIR: '@THIS_COLLECT_DIR@'
- args: ['mkdir', '-p', '@THIS_COLLECT_DIR@/root']
- args: ['mkdir', '-p', '@THIS_COLLECT_DIR@/etc/X11']
- args: ['cp', '@SOURCE_ROOT@/extrafiles/xorg.conf', '@THIS_COLLECT_DIR@/etc/X11/']
- args: ['cp', '@SOURCE_ROOT@/extrafiles/xinitrc', '@THIS_COLLECT_DIR@/root/.xinitrc']
39 changes: 39 additions & 0 deletions bootstrap.d/x11-libs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,45 @@ packages:
environ:
DESTDIR: '@THIS_COLLECT_DIR@'

- name: libpciaccess
source:
subdir: ports
git: 'https://gitlab.freedesktop.org/xorg/lib/libpciaccess.git'
tag: 'libpciaccess-0.16'
version: '0.16'
tools_required:
- host-autoconf-v2.69
- host-automake-v1.11
- host-libtool
- host-pkg-config
- host-xorg-macros
- host-autoconf-archive
- host-xtrans
regenerate:
- args: ['./autogen.sh']
environ:
'NOCONFIGURE': 'yes'
tools_required:
- system-gcc
pkgs_required:
- mlibc
- zlib
configure:
- args:
- '@THIS_SOURCE_DIR@/configure'
- '--host=@OPTION:arch-triple@'
- '--prefix=/usr'
- '--sysconfdir=/etc'
- '--localstatedir=/var'
- '--disable-static'
- '--with-pciids-path=/usr/share/hwdata'
- '--with-zlib'
build:
- args: ['make', '-j@PARALLELISM@']
- args: ['make', 'install']
environ:
DESTDIR: '@THIS_COLLECT_DIR@'

- name: libsm
labels: [aarch64]
architecture: '@OPTION:arch@'
Expand Down
27 changes: 27 additions & 0 deletions bootstrap.d/x11-wm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
packages:
- name: bspwm
source:
subdir: 'ports'
git: 'https://github.com/baskerville/bspwm.git'
tag: '0.9.10'
version: '0.9.10'
tools_required:
- system-gcc
pkgs_required:
- mlibc
- libxcb
- xcb-util
- xcb-util-wm
- xcb-util-keysyms
configure:
# bspwm does not seem to support out-of-tree builds, so we just copy
# the source tree into the build directory instead
- args: ['cp', '-r', '@THIS_SOURCE_DIR@/.', '@THIS_BUILD_DIR@']
build:
- args: ['make', '-j@PARALLELISM@']
environ:
CC: 'x86_64-managarm-gcc'
- args: ['make', 'install']
environ:
PREFIX: '/usr'
DESTDIR: '@THIS_COLLECT_DIR@'
1 change: 1 addition & 0 deletions bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ imports:
- file: bootstrap.d/x11-libs.yml
- file: bootstrap.d/x11-misc.yml
- file: bootstrap.d/x11-themes.yml
- file: bootstrap.d/x11-wm.yml

general:
patch_author: The Managarm Project
Expand Down
1 change: 1 addition & 0 deletions extrafiles/xinitrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bspwm
8 changes: 8 additions & 0 deletions extrafiles/xorg.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Section "Module"
Load "modesetting"
EndSection

Section "Device"
Identifier "Card0"
Driver "modesetting"
EndSection
95 changes: 95 additions & 0 deletions patches/libpciaccess/0001-Initial-WIP-Managarm-support.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
From 4fb754d7e7d9d09e5cbb6ddd812ea1671fc01d43 Mon Sep 17 00:00:00 2001
From: Dennis Bonke <[email protected]>
Date: Sun, 30 Jan 2022 21:59:54 +0100
Subject: [PATCH libpciaccess] Initial WIP Managarm support

Signed-off-by: Dennis Bonke <[email protected]>
---
src/Makefile.am | 5 +++++
src/common_init.c | 2 +-
src/common_interface.c | 2 +-
src/linux_sysfs.c | 10 +++++++++-
4 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index f222aa5..e722452 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -31,6 +31,11 @@ OS_SUPPORT = linux_sysfs.c linux_devmem.c linux_devmem.h
VGA_ARBITER = common_vgaarb.c
endif

+#if MANAGARM
+OS_SUPPORT = linux_sysfs.c linux_devmem.c linux_devmem.h
+VGA_ARBITER = common_vgaarb.c
+#endif
+
if FREEBSD
OS_SUPPORT = freebsd_pci.c
VGA_ARBITER = common_vgaarb_stub.c
diff --git a/src/common_init.c b/src/common_init.c
index 1940cff..5206b4e 100644
--- a/src/common_init.c
+++ b/src/common_init.c
@@ -55,7 +55,7 @@ pci_system_init( void )
{
int err = ENOSYS;

-#ifdef __linux__
+#if defined (__linux__) || defined(__managarm__)
err = pci_system_linux_sysfs_create();
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
err = pci_system_freebsd_create();
diff --git a/src/common_interface.c b/src/common_interface.c
index cb95e90..975961c 100644
--- a/src/common_interface.c
+++ b/src/common_interface.c
@@ -39,7 +39,7 @@
#include "pciaccess.h"
#include "pciaccess_private.h"

-#if defined(__linux__) || defined(__GLIBC__) || defined(__CYGWIN__)
+#if defined(__linux__) || defined(__GLIBC__) || defined(__CYGWIN__) || defined(__managarm__)
#include <byteswap.h>

#if __BYTE_ORDER == __BIG_ENDIAN
diff --git a/src/linux_sysfs.c b/src/linux_sysfs.c
index d022644..9e1aaa9 100644
--- a/src/linux_sysfs.c
+++ b/src/linux_sysfs.c
@@ -50,7 +50,7 @@
#include <dirent.h>
#include <errno.h>

-#if defined(__i386__) || defined(__x86_64__)
+#if defined(__i386__) || defined(__x86_64__) && !defined(__managarm__)
#include <sys/io.h>
#else
#define inb(x) -1
@@ -462,7 +462,11 @@ pci_device_linux_sysfs_read( struct pci_device * dev, void * data,


while ( temp_size > 0 ) {
+#ifndef __managarm__
const ssize_t bytes = pread64( fd, data_bytes, temp_size, offset );
+#else
+ const ssize_t bytes = pread(fd, data_bytes, temp_size, offset);
+#endif

/* If zero bytes were read, then we assume it's the end of the
* config file.
@@ -522,7 +526,11 @@ pci_device_linux_sysfs_write( struct pci_device * dev, const void * data,


while ( temp_size > 0 ) {
+#ifndef __managarm__
const ssize_t bytes = pwrite64( fd, data_bytes, temp_size, offset );
+#else
+ const ssize_t bytes = pwrite(fd, data_bytes, temp_size, offset);
+#endif

/* If zero bytes were written, then we assume it's the end of the
* config file.
--
2.34.1

17 changes: 9 additions & 8 deletions patches/xorg-server/0001-Add-managarm-support.patch
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
From da0c8b76121406b220f1acb723851f09e2471b99 Mon Sep 17 00:00:00 2001
From 69fa0d775a335babea28efabfe45bc422e33fa55 Mon Sep 17 00:00:00 2001
From: Dennisbonke <[email protected]>
Date: Sat, 18 Jul 2020 16:19:17 +0200
Subject: [PATCH] Add managarm support
Subject: [PATCH 1/2] Add managarm support

Signed-off-by: Dennisbonke <[email protected]>
Signed-off-by: Dennis Bonke <[email protected]>
---
include/meson.build | 2 +-
include/os.h | 1 +
Expand All @@ -13,7 +14,7 @@ Signed-off-by: Dennisbonke <[email protected]>
5 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/include/meson.build b/include/meson.build
index ac2415327..82b093442 100644
index ac24153..82b0934 100644
--- a/include/meson.build
+++ b/include/meson.build
@@ -132,7 +132,7 @@ conf_data.set('HAVE_POSIX_FALLOCATE', cc.has_function('posix_fallocate'))
Expand All @@ -26,7 +27,7 @@ index ac2415327..82b093442 100644
conf_data.set('HAVE_SIGACTION', cc.has_function('sigaction'))
conf_data.set('HAVE_STRCASECMP', cc.has_function('strcasecmp'))
diff --git a/include/os.h b/include/os.h
index 2a1c29ef3..2a7fc76c5 100644
index 2a1c29e..2a7fc76 100644
--- a/include/os.h
+++ b/include/os.h
@@ -51,6 +51,7 @@ SOFTWARE.
Expand All @@ -38,7 +39,7 @@ index 2a1c29ef3..2a7fc76c5 100644
#include <time.h>
#endif
diff --git a/mi/mibitblt.c b/mi/mibitblt.c
index 43d9bd917..740c0d268 100644
index 43d9bd9..740c0d2 100644
--- a/mi/mibitblt.c
+++ b/mi/mibitblt.c
@@ -49,6 +49,8 @@ SOFTWARE.
Expand All @@ -51,7 +52,7 @@ index 43d9bd917..740c0d268 100644
#include <X11/Xprotostr.h>

diff --git a/os/access.c b/os/access.c
index 97246160c..7afbd3a86 100644
index 9724616..7afbd3a 100644
--- a/os/access.c
+++ b/os/access.c
@@ -117,7 +117,7 @@ SOFTWARE.
Expand All @@ -64,7 +65,7 @@ index 97246160c..7afbd3a86 100644
#endif
#if defined(SYSV) && defined(__i386__)
diff --git a/os/utils.c b/os/utils.c
index 2ba1c8013..0156b20fb 100644
index 2ba1c80..0156b20 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -1632,7 +1632,7 @@ Pclose(void *iop)
Expand All @@ -77,5 +78,5 @@ index 2ba1c8013..0156b20fb 100644

int
--
2.28.0.rc2
2.34.1

Loading