Skip to content

Commit 3b944e0

Browse files
bootstrap::xorg: keyboard
Signed-off-by: Andy-Python-Programmer <[email protected]>
1 parent 319f829 commit 3b944e0

File tree

7 files changed

+348
-3
lines changed

7 files changed

+348
-3
lines changed

bootstrap/xorg.yml

Lines changed: 163 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ packages:
669669
- '--disable-glamor'
670670
- '--disable-glx'
671671
environ:
672-
CFLAGS: '-Wno-error=array-bounds -O2 -pipe'
672+
CFLAGS: '-Wno-error=array-bounds -O0 -g -pipe'
673673
build:
674674
- args: ['make', '-j@PARALLELISM@']
675675
- args: ['make', 'install-strip']
@@ -1299,6 +1299,168 @@ packages:
12991299
environ:
13001300
DESTDIR: '@THIS_COLLECT_DIR@'
13011301

1302+
- name: xkbcomp
1303+
source:
1304+
subdir: 'bundled'
1305+
git: 'https://gitlab.freedesktop.org/xorg/app/xkbcomp.git'
1306+
tag: 'xkbcomp-1.4.5'
1307+
version: '1.4.5'
1308+
tools_required:
1309+
- host-autoconf-v2.69
1310+
- host-automake-v1.16
1311+
- host-libtool
1312+
- host-pkg-config
1313+
- host-xorg-macros
1314+
regenerate:
1315+
- args: ['./autogen.sh']
1316+
environ:
1317+
NOCONFIGURE: 'yes'
1318+
tools_required:
1319+
- host-gcc
1320+
- host-autoconf-v2.69
1321+
- host-automake-v1.16
1322+
- host-pkg-config
1323+
pkgs_required:
1324+
- mlibc
1325+
- xorg-util-macros
1326+
- libx11
1327+
- libxkbfile
1328+
configure:
1329+
- args:
1330+
- '@THIS_SOURCE_DIR@/configure'
1331+
- '--host=x86_64-aero'
1332+
- '--prefix=/usr'
1333+
- '--sysconfdir=/etc'
1334+
- '--localstatedir=/var'
1335+
build:
1336+
- args: ['make', '-j@PARALLELISM@']
1337+
- args: ['make', 'install-strip']
1338+
environ:
1339+
DESTDIR: '@THIS_COLLECT_DIR@'
1340+
1341+
- name: libxkbcommon
1342+
source:
1343+
subdir: 'bundled'
1344+
git: 'https://github.com/xkbcommon/libxkbcommon.git'
1345+
tag: 'xkbcommon-1.4.0'
1346+
version: '1.4.0'
1347+
tools_required:
1348+
- host-pkg-config
1349+
- host-gcc
1350+
- virtual: pkgconfig-for-host
1351+
program_name: host-pkg-config
1352+
- virtual: pkgconfig-for-target
1353+
triple: "x86_64-aero"
1354+
pkgs_required:
1355+
- mlibc
1356+
- libxcb
1357+
- libxml
1358+
- xkeyboard-config
1359+
configure:
1360+
- args:
1361+
- 'meson'
1362+
- '--native-file'
1363+
- '@SOURCE_ROOT@/userland/native-file.ini'
1364+
- '--cross-file'
1365+
- '@SOURCE_ROOT@/userland/cross-file.ini'
1366+
- '--prefix=/usr'
1367+
- '--libdir=lib'
1368+
- '--buildtype=release'
1369+
- '-Denable-docs=false'
1370+
- '-Denable-x11=true'
1371+
- '-Denable-wayland=false'
1372+
- '@THIS_SOURCE_DIR@'
1373+
build:
1374+
- args: ['ninja']
1375+
- args: ['ninja', 'install']
1376+
environ:
1377+
DESTDIR: '@THIS_COLLECT_DIR@'
1378+
- args: ['mkdir', '-p', "@THIS_COLLECT_DIR@/usr/share/X11/xkb"]
1379+
1380+
1381+
- name: xkeyboard-config
1382+
source:
1383+
subdir: 'bundled'
1384+
git: 'https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config.git'
1385+
tag: 'xkeyboard-config-2.34'
1386+
version: '2.34'
1387+
tools_required:
1388+
- host-autoconf-v2.69
1389+
- host-automake-v1.16
1390+
- host-libtool
1391+
- host-pkg-config
1392+
- host-xorg-macros
1393+
regenerate:
1394+
- args: ['./autogen.sh']
1395+
environ:
1396+
NOCONFIGURE: 'yes'
1397+
tools_required:
1398+
- host-autoconf-v2.69
1399+
- host-automake-v1.16
1400+
- host-libtool
1401+
- host-pkg-config
1402+
- host-xorg-macros
1403+
- host-gcc
1404+
pkgs_required:
1405+
- mlibc
1406+
- libx11
1407+
- xorg-proto
1408+
configure:
1409+
- args:
1410+
- '@THIS_SOURCE_DIR@/configure'
1411+
- '--host=x86_64-aero'
1412+
- '--prefix=/usr'
1413+
- '--sysconfdir=/etc'
1414+
- '--localstatedir=/var'
1415+
- '--with-xkb-rules-symlink=xorg'
1416+
- '--disable-nls'
1417+
build:
1418+
- args: ['make', '-j@PARALLELISM@']
1419+
- args: ['make', 'install-strip']
1420+
environ:
1421+
DESTDIR: '@THIS_COLLECT_DIR@'
1422+
1423+
- name: xf86-input-keyboard
1424+
source:
1425+
subdir: 'bundled'
1426+
git: 'https://gitlab.freedesktop.org/xorg/driver/xf86-input-keyboard.git'
1427+
tag: 'xf86-input-keyboard-1.9.0'
1428+
version: '1.9.0'
1429+
tools_required:
1430+
- host-autoconf-v2.69
1431+
- host-automake-v1.16
1432+
- host-libtool
1433+
- host-pkg-config
1434+
- host-xorg-macros
1435+
regenerate:
1436+
- args: ['./autogen.sh']
1437+
environ:
1438+
NOCONFIGURE: 'yes'
1439+
tools_required:
1440+
- host-gcc
1441+
- host-autoconf-v2.69
1442+
- host-automake-v1.16
1443+
- host-pkg-config
1444+
pkgs_required:
1445+
- mlibc
1446+
- xorg-server
1447+
- xorg-util-macros
1448+
- libx11
1449+
configure:
1450+
- args:
1451+
- '@THIS_SOURCE_DIR@/configure'
1452+
- '--host=x86_64-aero'
1453+
- '--prefix=/usr'
1454+
- '--sysconfdir=/etc'
1455+
- '--localstatedir=/var'
1456+
- '--disable-static'
1457+
- '--with-sysroot=@SYSROOT_DIR@' # Set libtool's lt_sysroot.
1458+
build:
1459+
- args: ['make', '-j@PARALLELISM@']
1460+
- args: ['make', 'install-strip']
1461+
environ:
1462+
DESTDIR: '@THIS_COLLECT_DIR@'
1463+
13021464
- name: xf86-video-fbdev
13031465
source:
13041466
subdir: 'bundled'

patches/mlibc/mlibc.patch

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 10e4288b75bcaa72e84cabe7af331cb95cbb1c86 Mon Sep 17 00:00:00 2001
1+
From d3bcf4e954ce27b14f5ffdb994486c984d1773ad Mon Sep 17 00:00:00 2001
22
From: Matt Taylor <[email protected]>
33
Date: Fri, 17 Jun 2022 15:28:34 +0100
44
Subject: [PATCH] abi-bits: add domainname to utsname
@@ -8,7 +8,10 @@ Subject: [PATCH] abi-bits: add domainname to utsname
88
abis/linux/utsname.h | 1 +
99
options/ansi/generic/stdlib-stubs.cpp | 100 ++++++++++++++++++++++----
1010
options/glibc/generic/execinfo.cpp | 6 +-
11-
4 files changed, 94 insertions(+), 14 deletions(-)
11+
options/rtdl/generic/linker.cpp | 2 +-
12+
sysdeps/aero/generic/aero.cpp | 10 ++-
13+
sysdeps/aero/include/aero/syscall.h | 1 +
14+
7 files changed, 104 insertions(+), 17 deletions(-)
1215

1316
diff --git a/ABI_BREAKS.md b/ABI_BREAKS.md
1417
index 0cd3993b..d2a0bb7d 100644
@@ -160,6 +163,59 @@ index 3474615e..c0081e30 100644
160163
}
161164

162165
char **backtrace_symbols(void *const *, int) {
166+
diff --git a/options/rtdl/generic/linker.cpp b/options/rtdl/generic/linker.cpp
167+
index c2eceff6..d2d91b13 100644
168+
--- a/options/rtdl/generic/linker.cpp
169+
+++ b/options/rtdl/generic/linker.cpp
170+
@@ -15,7 +15,7 @@ uintptr_t libraryBase = 0x41000000;
171+
172+
bool verbose = false;
173+
bool stillSlightlyVerbose = false;
174+
-bool logBaseAddresses = false;
175+
+bool logBaseAddresses = true;
176+
bool eagerBinding = true;
177+
178+
#if defined(__x86_64__)
179+
diff --git a/sysdeps/aero/generic/aero.cpp b/sysdeps/aero/generic/aero.cpp
180+
index 43ddb906..f4fe182f 100644
181+
--- a/sysdeps/aero/generic/aero.cpp
182+
+++ b/sysdeps/aero/generic/aero.cpp
183+
@@ -124,7 +124,9 @@ int sys_anon_free(void *pointer, size_t size) {
184+
}
185+
186+
void sys_libc_panic() {
187+
- sys_libc_log("libc panic!");
188+
+ mlibc::infoLogger() << "libc_panic: panicked at 'unknown'" << frg::endlog;
189+
+ __ensure(!syscall(SYS_BACKTRACE));
190+
+
191+
sys_exit(1);
192+
}
193+
194+
@@ -233,7 +235,11 @@ uid_t sys_geteuid() {
195+
return 0;
196+
}
197+
198+
-int sys_setuid(uid_t uid) UNIMPLEMENTED("sys_setuid")
199+
+// int sys_setuid(uid_t uid) {
200+
+// mlibc::infoLogger() << "mlibc: sys_setuid is a stub" << frg::endlog;
201+
+// return 0;
202+
+// }
203+
+
204+
int sys_seteuid(uid_t euid) UNIMPLEMENTED("sys_seteuid")
205+
206+
gid_t sys_getgid() {
207+
diff --git a/sysdeps/aero/include/aero/syscall.h b/sysdeps/aero/include/aero/syscall.h
208+
index 12f8dc61..cf57bd3d 100644
209+
--- a/sysdeps/aero/include/aero/syscall.h
210+
+++ b/sysdeps/aero/include/aero/syscall.h
211+
@@ -64,6 +64,7 @@
212+
#define SYS_FUTEX_WAIT 57
213+
#define SYS_FUTEX_WAKE 58
214+
#define SYS_LINK 59
215+
+#define SYS_BACKTRACE 60
216+
217+
// Invalid syscall used to trigger a log error in the kernel (as a hint)
218+
// so, that we can implement the syscall in the kernel.
163219
--
164220
2.25.1
165221

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
From e61108c09c46a9b608c4c6f5e35ac666bf29c372 Mon Sep 17 00:00:00 2001
2+
From: Andy-Python-Programmer <[email protected]>
3+
Date: Mon, 4 Jul 2022 11:45:06 +1000
4+
Subject: [PATCH] keydev: aero specific changes
5+
6+
Signed-off-by: Andy-Python-Programmer <[email protected]>
7+
---
8+
.gitignore | 2 ++
9+
configure.ac | 5 +++++
10+
src/Makefile.am | 7 ++++++-
11+
src/aero_kbd.c | 28 ++++++++++++++++++++++++++++
12+
4 files changed, 41 insertions(+), 1 deletion(-)
13+
create mode 100644 src/aero_kbd.c
14+
15+
diff --git a/.gitignore b/.gitignore
16+
index 5f04578..f10deba 100644
17+
--- a/.gitignore
18+
+++ b/.gitignore
19+
@@ -76,3 +76,5 @@ core
20+
# Edit the following section as needed
21+
# For example, !report.pc overrides *.pc. See 'man gitignore'
22+
#
23+
+# editor configs:
24+
+.vscode
25+
diff --git a/configure.ac b/configure.ac
26+
index c3ebdf3..33b36f9 100644
27+
--- a/configure.ac
28+
+++ b/configure.ac
29+
@@ -69,6 +69,10 @@ case $host_os in
30+
IS_SOLARIS="yes"
31+
;;
32+
33+
+ aero*)
34+
+ IS_AERO="yes"
35+
+ ;;
36+
+
37+
gnu*)
38+
IS_HURD="yes"
39+
;;
40+
@@ -95,6 +99,7 @@ case $host_os in
41+
esac
42+
AC_SUBST([OS_FLAGS])
43+
44+
+AM_CONDITIONAL(AERO, [test "x$IS_AERO" = xyes])
45+
AM_CONDITIONAL(LINUX, [test "x$IS_LINUX" = xyes])
46+
AM_CONDITIONAL(BSD, [test "x$IS_BSD" = xyes])
47+
AM_CONDITIONAL(SOLARIS, [test "x$IS_SOLARIS" = xyes])
48+
diff --git a/src/Makefile.am b/src/Makefile.am
49+
index 8612c87..fac400e 100644
50+
--- a/src/Makefile.am
51+
+++ b/src/Makefile.am
52+
@@ -26,11 +26,16 @@ kbd_drv_la_SOURCES = kbd.c xf86OSKbd.h xf86Keymap.h atKeynames.h
53+
kbd_drv_la_LIBADD = $(XORG_LIBS)
54+
kbd_drv_ladir = @inputdir@
55+
56+
+AERO_SRCS = aero_kbd.c at_scancode.c
57+
BSD_SRCS = bsd_KbdMap.c bsd_kbd.c bsd_kbd.h at_scancode.c
58+
HURD_SRCS = hurd_kbd.c at_scancode.c
59+
LINUX_SRCS = lnx_KbdMap.c lnx_kbd.c lnx_kbd.h at_scancode.c
60+
SOLARIS_SRCS = sun_kbd.c sun_kbd.h sun_kbdMap.c
61+
62+
+if AERO
63+
+kbd_drv_la_SOURCES += $(AERO_SRCS)
64+
+endif
65+
+
66+
if BSD
67+
kbd_drv_la_SOURCES += $(BSD_SRCS)
68+
endif
69+
@@ -47,4 +52,4 @@ if HURD
70+
kbd_drv_la_SOURCES += $(HURD_SRCS)
71+
endif
72+
73+
-EXTRA_DIST = $(BSD_SRCS) $(HURD_SRCS) $(LINUX_SRCS) $(SOLARIS_SRCS)
74+
+EXTRA_DIST = $(AERO_SRCS) $(BSD_SRCS) $(HURD_SRCS) $(LINUX_SRCS) $(SOLARIS_SRCS)
75+
diff --git a/src/aero_kbd.c b/src/aero_kbd.c
76+
new file mode 100644
77+
index 0000000..63fbc29
78+
--- /dev/null
79+
+++ b/src/aero_kbd.c
80+
@@ -0,0 +1,28 @@
81+
+#ifdef HAVE_CONFIG_H
82+
+#include <config.h>
83+
+#endif
84+
+
85+
+#include <X11/X.h>
86+
+#include <xorg-server.h>
87+
+
88+
+#include "compiler.h"
89+
+
90+
+#include "xf86.h"
91+
+#include "xf86Priv.h"
92+
+#include "xf86_OSlib.h"
93+
+
94+
+#include "atKeynames.h"
95+
+#include "xf86Keymap.h"
96+
+#include "xf86OSKbd.h"
97+
+#include "xf86Xinput.h"
98+
+
99+
+#include <assert.h>
100+
+#include <errno.h>
101+
+#include <stdio.h>
102+
+#include <sys/file.h>
103+
+#include <sys/ioctl.h>
104+
+#include <sys/time.h>
105+
+
106+
+Bool xf86OSKbdPreInit(InputInfoPtr pInfo) {
107+
+ return FALSE;
108+
+}
109+
--
110+
2.25.1
111+

src/aero_kernel/src/syscall/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ pub fn generic_do_syscall(
183183
SYS_SIGPROCMASK => process::sigprocmask(b, c, d),
184184
SYS_CLONE => process::clone(b, c),
185185
SYS_KILL => process::kill(b, c),
186+
SYS_BACKTRACE => process::backtrace(),
186187

187188
SYS_READ => fs::read(b, c, d),
188189
SYS_OPEN => fs::open(b, c, d, e),

0 commit comments

Comments
 (0)