Merge branch 'master' into patch-1

This commit is contained in:
Ariel Abreu 2022-01-25 09:05:13 -05:00 committed by GitHub
commit d3a5aa46d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 8 deletions

View File

@ -29,6 +29,7 @@
- [Contributing](contributing/README.md)
- [Debugging](contributing/debugging.md)
- [Generating stubs](contributing/generating-stubs.md)
- [Generating syscalls](contributing/generating-syscalls.md)
- [High priority stuff](contributing/high-priority-stuff.md)
- [Google Summer of Code](contributing/google-summer-of-code.md)
- [Packaging](contributing/packaging.md)

View File

@ -16,7 +16,7 @@ Linux 5.0 or higher is required.
libc6-dev-i386 linux-headers-amd64 libcap2-bin git git-lfs python2 libglu1-mesa-dev libcairo2-dev \
libgl1-mesa-dev libtiff5-dev libfreetype6-dev libxml2-dev libegl1-mesa-dev libfontconfig1-dev \
libbsd-dev libxrandr-dev libxcursor-dev libgif-dev libpulse-dev libavformat-dev libavcodec-dev \
libavresample-dev libdbus-1-dev libxkbfile-dev libssl-dev
libswresample-dev libdbus-1-dev libxkbfile-dev libssl-dev
````
**Debian Testing**
@ -26,7 +26,7 @@ Linux 5.0 or higher is required.
libc6-dev-i386 linux-headers-amd64 libcap2-bin git git-lfs python2 libglu1-mesa-dev libcairo2-dev \
libgl1-mesa-dev libtiff5-dev libfreetype6-dev libxml2-dev libegl1-mesa-dev libfontconfig1-dev \
libbsd-dev libxrandr-dev libxcursor-dev libgif-dev libpulse-dev libavformat-dev libavcodec-dev \
libavresample-dev libdbus-1-dev libxkbfile-dev libssl-dev
libswresample-dev libdbus-1-dev libxkbfile-dev libssl-dev
```
**Ubuntu 18.04/20.04:**
@ -36,18 +36,16 @@ Linux 5.0 or higher is required.
linux-headers-generic gcc-multilib libcairo2-dev libgl1-mesa-dev libglu1-mesa-dev libtiff5-dev \
libfreetype6-dev git git-lfs libelf-dev libxml2-dev libegl1-mesa-dev libfontconfig1-dev libbsd-dev \
libxrandr-dev libxcursor-dev libgif-dev libavutil-dev libpulse-dev libavformat-dev libavcodec-dev \
libavresample-dev libdbus-1-dev libxkbfile-dev libssl-dev
libswresample-dev libdbus-1-dev libxkbfile-dev libssl-dev
```
For Ubuntu 20.04, also install `python2`.
**Arch Linux & Manjaro:**
`libavresample` needs to be downloaded from the AUR.
```
$ sudo pacman -S --needed make cmake clang flex bison icu fuse linux-headers gcc-multilib \
lib32-gcc-libs pkg-config fontconfig cairo libtiff python2 mesa llvm libbsd libxkbfile \
libxcursor libxext libxkbcommon libxrandr git git-lfs
libxcursor libxext libxkbcommon libxrandr ffmpeg git git-lfs
```
Make sure you install the headers package that matches your kernel version. The kernel version can be checked with `uname -r`.
@ -82,7 +80,7 @@ For Ubuntu 20.04, also install `python2`.
kernel-source libelf1 cairo-devel libfreetype6 libjpeg-turbo libfontconfig1 libglvnd Mesa-libGL-devel \
Mesa-libEGL-devel libGLU1 libxml2-tools libbsd-devel git git-lfs libXcursor-devel giflib-devel ffmpeg-4 \
ffmpeg-4-libavcodec-devel ffmpeg-4-libavformat-devel libpulse-devel pulseaudio-utils libxkbfile-devel \
openssl llvm libcap-progs libtiff-devel libjpeg8-devel libXrandr-devel dbus-1-devel glu-devel
openssl llvm libcap-progs libtiff-devel libjpeg8-devel libXrandr-devel dbus-1-devel glu-devel ffmpeg-4-libswresample-devel
```
**Alpine Linux**
@ -153,7 +151,7 @@ $ make
$ sudo make install
```
### Kernel Module
Darling also requires a kernel module named `darling-mach`:
```

View File

@ -0,0 +1,31 @@
# Generating Syscalls
While not common, there are situations where you might need to regenerate syscalls. Fortunately, Apple provides a convenient perl script called `create-syscalls.pl`. The script is located in `[XNU]/libsyscall/xcodescripts/`.
## Understanding `create-syscalls.pl`'s Arugments
When you try to run the command, without any arguments, you will get the following prompt:
```
Usage: create-syscalls.pl syscalls.master custom-directory platforms-directory platform-name out-directory
```
Unfortunately, the prompt does not give a lot of helpful information. Below is a breakdown of what the script is requesting.
* `syscalls.master` - Point to the syscalls.master file. ex: `[XNU]/bsd/kern/syscalls.master`
* `custom-directory` - Point to a directory that contains a `SYS.h`, `custom.s`, and a list of `__` files. These files can be found in a folder called custom. ex:`[XNU]/libsyscall/custom/`
* `platforms-directory`- Point to a directory that contains the `syscall.map` files. Ex:`[XNU]/libsyscall/Platforms/`
* `platform-name` - One of the platform names that are in the platform directory. ex: `MacOSX`
In addition, you will need to define the list of `ARCHS` that the tool should generate.
```
export ARCHS="arm64 i386 x86_64"
```
## Example
```
export ARCHS="arm64 i386 x86_64"
mkdir ~/Desktop/generated_syscalls
./create-syscalls.pl $XNU/bsd/kern/syscalls.master $XNU/libsyscall/custom/ $XNU/libsyscall/Platforms/ MacOSX ~/Desktop/generated_syscalls
```