Commit Graph

35 Commits

Author SHA1 Message Date
CuriousTommy
814a90cae0
Merge pull request #8 from darlinghq/fix_simple_abort
Fix "__simple_abort" Method
2024-01-21 14:24:11 -08:00
Thomas A.
780bd91d1c Grab The Current PID To Abort On
Setting the pid to 0 will send the SIGABRT signal to "every process in the process group of the calling process". This means that darlingserver will also get killed as a result (which we don't want to happen).
2024-01-21 11:53:20 -08:00
CuriousTommy
60dc3751f3
Merge pull request #6 from darlinghq/mldr_thread_entry_rework
Fix And Rework Assembly Code For "pthread_entry_point_wrapper" And "wqueue_entry_point_wrapper"
2023-10-30 12:59:10 -07:00
Thomas A
dae74f22b3 Split "wqueue_entry_point" Assembly To Dedicated Function
Instead of duplicating the assembly code, let's have a shared function that both "sys_workq_kernreturn" and "wqueue_entry_point_wrapper" can use to jump to "_start_wqthread".
2023-10-30 10:39:31 -07:00
Thomas A
0f3ad0d2f7 Fix And Rework Assembly Code For "pthread_entry_point_wrapper" And "wqueue_entry_point_wrapper"
In `libpthread/src/pthread_asm.S`, `_thread_start` and `_start_wqthread` are designed with the assumption that the code would run from kernel space. This means that the following functions don't follow all of the standard calling conventions that are expected for x86_64 or i386.
2023-10-30 10:39:31 -07:00
Ariel Abreu
09564c3bb4
Merge pull request #2 from SomeDevHere/at_function_flags
Add AT_REMOVEDIR_DATALESS and AT_FDONLY flags and EINVAL error for *at functions
2023-10-21 10:48:58 -04:00
Ariel Abreu
6d104606d8
Use a bigger sigexc stack size
The JVM needs this since it tries to do more complex processing within signal handlers.
2023-10-16 17:22:42 -04:00
Ariel Abreu
8327ec8edd
Perform most of the same pre- and post-fork work in posix_spawn as in fork 2023-10-04 23:34:10 -04:00
Ariel Abreu
99020685f1
Use Darling reserved key definitions for TLS keys
Our previous choices for per-thread-WD keys were conflicting with the
keys reserved for the Swift runtime and causing crashes for Swift apps.

Instead, let's use some keys from the newly-reserved Darling range for
pthread keys (200-209). This range seems to be otherwise unused, so it
should be fine for us to use it.
2023-10-04 23:30:57 -04:00
Ariel Abreu
b2bd57725b
Fix _proc_pidinfo_regionpath return value
This fixes image detection in dyld (and, by extension, LLDB).
2023-09-25 16:24:28 -04:00
Ariel Abreu
37d3a0c247
Stub the remaining audit_* syscalls 2023-09-20 21:27:37 -04:00
Ariel Abreu
799a661188
Fake supplementary groups with darlingserver
This works very much like our UID/GID faking.
2023-09-20 21:26:57 -04:00
CuriousTommy
e4a0b762d0
Merge pull request #5 from darlinghq/ubuntu_20.04_adjustments
Fix Building For Ubuntu 20.04
2023-09-03 19:18:11 -07:00
Thomas A
9cb8fdcf72 Run Command "realpath" Instead
Unfortunately, Ubuntu 20.04 only offers version CMake 3.16. This means we can't use `file(REAL_PATH ...)`
2023-09-03 12:57:37 -07:00
CuriousTommy
6d94d59c21
Merge pull request #4 from darlinghq/xtrace_implement_buffer
XTrace CPP Conversion Changes
2023-09-03 12:54:57 -07:00
Thomas A
511d5ef727 [libsystem_kernel] __simple_vsnprintf: Add Support For Counting The Size If "buf" Is NULL 2023-08-29 09:55:23 -07:00
Thomas A
65c8c191b6 [libsystem_kernel] Mark Functions XTrace Uses As C Functions 2023-08-29 09:54:53 -07:00
Thomas A
2c246ed78c Update CMake Version To 3.13 2023-07-26 11:28:18 -07:00
Ariel Abreu
cc9438a05e
Stop Ninja from constantly rebuilding
As explained in the comment, Ninja gets confused by the fact that the
subdirectory is added in `darling/src/libsystem_kernel` but it's
actually located in the root of the repo. The system resolves relative
paths using the real path, but Ninja resolves it according to the CMake
subdirectory path.

Ninja was constantly searching for
`darling/src/libsystem_kernel/osfmk/mach_eventlink_types.h` instead of
`osfmk/mach_eventlink_types.h` and therefore constantly thought that the
source that depended on this was out-of-date.
2023-07-21 11:12:24 -04:00
CuriousTommy
0e7071643e
Merge pull request #3 from darlinghq/fedora_38_fix
Fix Building For Fedora 38
2023-06-28 08:47:03 -07:00
Thomas A
d0d5c62137 Fix implicit-function-declaration & incompatible-function-pointer-types 2023-06-19 21:24:46 -07:00
SomeDevHere
69c57f0eab Add some flags and EINVAL error for *at functions
Implemented AT_REMOVEDIR_DATALESS and AT_FDONLY flags.
Implemented the error EINVAL for invalid flags that are passed to *at
functions.
Added AT_EACCESS and AT_REALDEV flags but are currently ignored.
2023-06-10 19:56:40 +00:00
JJTech
8145aafbb2
Implement kern.osrevision sysctl (#1)
Co-authored-by: Ariel Abreu <facekapow@outlook.com>
2023-05-23 15:50:49 -04:00
Thomas A
5f1cb933ce Upload README.md and UPDATE_SOURCE.md 2023-05-20 20:59:36 -07:00
Thomas A
25966d69aa [libsystem_kernel] Fix Building 2023-05-20 20:17:03 -07:00
Thomas A
c128ce938e Partially Restore Darling-Specific Changes
Since we don't build the kernel module anymore, I want to take the opportunity to only include changes that are needed for Darling to function (build and sucessfully bring up `bash`).
2023-05-20 20:17:03 -07:00
Thomas A
e5177fae0a Upload Script To Generate Header File 2023-05-20 20:17:03 -07:00
Thomas A
2a49e2be17 Generate Syscall Header 2023-05-20 20:17:03 -07:00
Thomas A
947534bad5 Create Scripts To Generate BSD Syscalls 2023-05-18 10:30:10 -07:00
Thomas A
8aa1efb3ce Generate "bsdsyscalls" Source 2023-05-18 10:30:10 -07:00
Thomas A
57178e3ab5 [libsyscall] Restore Darling Specific Changes 2023-05-18 10:29:09 -07:00
Thomas A
2a4f4caf14 Copy Over Build Script For "libkxld"
Taken From LKM Branch
2023-05-17 10:00:56 -07:00
Thomas A
4d0d5857b9 Copy Over libsystem_kernel Files From "src/kernel"
Instead of copying over the "libsystem", we will use one that already exist in this repo (hence the symlink).
2023-05-17 09:45:57 -07:00
Thomas A
89fa103bd5 Rename Assembly Files In "libsyscall" 2023-05-17 08:57:38 -07:00
Thomas A
cdbc10b677 Upload xnu-7195.141.2 Source 2023-05-16 21:41:14 -07:00