Skip to content

Commit c576fd1

Browse files
syscall::pipe: fix fds type
Signed-off-by: Andy-Python-Programmer <[email protected]>
1 parent 3b944e0 commit c576fd1

File tree

6 files changed

+62
-73
lines changed

6 files changed

+62
-73
lines changed

bootstrap/xorg.yml

Lines changed: 39 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 -O0 -g -pipe'
672+
CFLAGS: '-Wno-error=array-bounds -O2 -pipe'
673673
build:
674674
- args: ['make', '-j@PARALLELISM@']
675675
- args: ['make', 'install-strip']
@@ -1377,6 +1377,44 @@ packages:
13771377
DESTDIR: '@THIS_COLLECT_DIR@'
13781378
- args: ['mkdir', '-p', "@THIS_COLLECT_DIR@/usr/share/X11/xkb"]
13791379

1380+
- name: xkbutils
1381+
source:
1382+
subdir: 'bundled'
1383+
git: 'https://gitlab.freedesktop.org/xorg/app/xkbutils.git'
1384+
tag: 'xkbutils-1.0.4'
1385+
version: '1.0.4'
1386+
tools_required:
1387+
- host-autoconf-v2.69
1388+
- host-automake-v1.16
1389+
- host-libtool
1390+
- host-pkg-config
1391+
- host-xorg-macros
1392+
regenerate:
1393+
- args: ['autoreconf', '-vfi']
1394+
tools_required:
1395+
- host-autoconf-v2.69
1396+
- host-automake-v1.16
1397+
- host-libtool
1398+
- host-pkg-config
1399+
- host-gcc
1400+
pkgs_required:
1401+
- mlibc
1402+
- xorg-util-macros
1403+
- xorg-proto
1404+
- libx11
1405+
- libxt
1406+
- libxaw
1407+
configure:
1408+
- args:
1409+
- '@THIS_SOURCE_DIR@/configure'
1410+
- '--host=x86_64-aero'
1411+
- '--prefix=/usr'
1412+
- '--with-sysroot=@SYSROOT_DIR@' # Set libtool's lt_sysroot.
1413+
build:
1414+
- args: ['make', '-j@PARALLELISM@']
1415+
- args: ['make', 'install-strip']
1416+
environ:
1417+
DESTDIR: '@THIS_COLLECT_DIR@'
13801418

13811419
- name: xkeyboard-config
13821420
source:

patches/xorg-server/0001-xserver-aero-specific-changes.patch

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From ec91d28586ecf3df66e23da1ce94dbba3042cd86 Mon Sep 17 00:00:00 2001
1+
From 3d08eb0ba228adf632f38c0c8f6476c1d0342386 Mon Sep 17 00:00:00 2001
22
From: Andy-Python-Programmer <[email protected]>
33
Date: Thu, 30 Jun 2022 11:10:21 +1000
44
Subject: [PATCH] xserver: aero specific changes
@@ -20,8 +20,8 @@ Signed-off-by: Andy-Python-Programmer <[email protected]>
2020
include/os.h | 1 +
2121
mi/mibitblt.c | 2 ++
2222
os/access.c | 2 +-
23-
os/utils.c | 4 +--
24-
16 files changed, 49 insertions(+), 19 deletions(-)
23+
os/utils.c | 6 ++--
24+
16 files changed, 50 insertions(+), 20 deletions(-)
2525

2626
diff --git a/.gitignore b/.gitignore
2727
index dc56b46..81d9886 100644
@@ -328,7 +328,7 @@ index 9724616..81befe3 100644
328328
#endif
329329
#if defined(SYSV) && defined(__i386__)
330330
diff --git a/os/utils.c b/os/utils.c
331-
index 2ba1c80..63dedc6 100644
331+
index 2ba1c80..ffa961f 100644
332332
--- a/os/utils.c
333333
+++ b/os/utils.c
334334
@@ -1402,7 +1402,7 @@ System(const char *command)
@@ -340,6 +340,15 @@ index 2ba1c80..63dedc6 100644
340340
}
341341

342342
static struct pid {
343+
@@ -1474,7 +1474,7 @@ Popen(const char *command, const char *type)
344+
}
345+
close(pdes[1]);
346+
}
347+
- execl("/bin/sh", "sh", "-c", command, (char *) NULL);
348+
+ execl("/usr/bin/bash", "sh", "-c", command, (char *) NULL);
349+
_exit(127);
350+
}
351+
343352
@@ -1632,7 +1632,7 @@ Pclose(void *iop)
344353
}
345354
#endif

src/aero_kernel/src/syscall/fs.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ pub fn seek(fd: usize, offset: usize, whence: usize) -> Result<usize, SyscallErr
253253
}
254254

255255
#[syscall]
256-
pub fn pipe(fds: &mut [usize; 2], flags: usize) -> Result<usize, SyscallError> {
256+
pub fn pipe(fds: &mut [i32; 2], flags: usize) -> Result<usize, SyscallError> {
257257
let flags = OpenFlags::from_bits(flags).ok_or(SyscallError::EINVAL)?;
258258
let pipe = Pipe::new();
259259

@@ -278,8 +278,8 @@ pub fn pipe(fds: &mut [usize; 2], flags: usize) -> Result<usize, SyscallError> {
278278
Ok(fd2) => fd2,
279279
};
280280

281-
fds[0] = fd1;
282-
fds[1] = fd2;
281+
fds[0] = fd1 as i32;
282+
fds[1] = fd2 as i32;
283283

284284
Ok(0x00)
285285
}
@@ -362,6 +362,12 @@ pub fn fcntl(fd: usize, command: usize, arg: usize) -> Result<usize, SyscallErro
362362
Ok(flags)
363363
}
364364

365+
aero_syscall::prelude::F_SETFL => {
366+
log::debug!("F_SETFL: is a stub!");
367+
368+
Ok(0x00)
369+
}
370+
365371
_ => unimplemented!("fcntl: unknown command {command}"),
366372
}
367373
}

tools/gdb-debug-userland.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def gdb_main(program: str, is_lib: bool):
2626
print("setting a breakpoint at the entry point")
2727

2828
# set a breakpoint at the entry point of the program
29-
gdb.execute("b main")
29+
gdb.execute("b _start")
3030

3131

3232
def wait_for_process(process):

userland/client.c

Lines changed: 0 additions & 29 deletions
This file was deleted.

userland/server.c

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)