diff options
| author | Fahima Mokhtari <df_mokhtari@esi.dz> | 2022-04-01 14:44:23 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-01 13:44:23 +0200 |
| commit | 20955a246688253cfb50ff7ed8bd1fc9cf699c1d (patch) | |
| tree | 1e71059d813c787161c0b292ea14aac0b356a543 | |
| parent | b183f42084053cef8655b51955080cb0b69ce93b (diff) | |
docs: adding a new OS support
* docs: update syscalls documentation
Fixing typo "does not contain" instead of "does not contains"
* docs: extending Syzkaller to a new OS
* docs: extending Syzkaller to a new OS
* docs: extending Syzkaller to a new OS
* docs: extending Syzkaller to a new OS
* docs: extending Syzkaller to a new OS
* docs: adding a new OS support
* docs: adding a new OS support
* docs: adding a new OS support
* docs: adding a new OS support
* docs: adding a new OS support
| -rw-r--r-- | docs/adding_new_os_support.md | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/docs/adding_new_os_support.md b/docs/adding_new_os_support.md new file mode 100644 index 000000000..e78be2e06 --- /dev/null +++ b/docs/adding_new_os_support.md @@ -0,0 +1,51 @@ +# Adding new OS support + +Here are the common parts of syzkaller to edit in order to make syzkaller support a new OS kernel. However, there may be some specific changes that will be required for a given kernel (for example, gathering coverage from a given kernel, or some errors that might pop up and give a hint about what to tweak). + +## syz-executor + +For each OS, there is this file `executor/executor_GOOS.h` where GOOS is the OS name. This file contains two important functions: + +- `os_init` which is responsible for mapping a virtual address space for the calling process, +- `execute_syscall` which is responsible for executing system calls for a particular OS kernel. + +These two functions, are called in `executor/executor.cc`, which is mainly responsible for executing the syscalls programs, and managing the threads in which the programs run. + +`executor_GOOS.h` also contains functions related to that operating system such as functions that allow it to gather coverage information, detect bitness, etc. (Example: [executor_linux.h](/executor/executor_linux.h) ). + +The intended function will be called according to the target kernel as defined by the macros in the `executor/executor.cc` file. + +## Build files `pkg/` + +- The OS name is added to `pkg/build/build.go` along with the supported architecture +- Creating a file that builds the image for the targeted kernel under `pkg/build/`. There is a file per each of the supported OSes by Syzkaller where the name pattern is `GOOS.go`. + +- Adding the given target to the `s/makefile/Makefile/`. + +## Report files `pkg/report/` + +Creating a file that reports build errors for the targeted kernel under `pkg/report/`. There is a file per each of the supported OSes by Syzkaller where the name pattern is `GOOS.go`. + +## Editing `pkg/host/` + +- implement `isSupported` function that returns true for a supported syscall, it is located under `pkg/host/GOOS`. + +## Creating a file under `sys/GOOS/` + +Creating a file `init.go` for the targeted kernel under `sys/GOOS/`that included the function `initTarget` that initializes the target and the different supported architectures. + +## Editing `sys/syz-extract` + +Adding the new kernel name with already existing supported kernels to the file `sys/syz-extract/extract.go`. + +## Editing `sys/targets` + +Adding the new kernel name with already existing supported kernels to the file `targets.go` which is located under`sys/targets`. + +## Editing `vm/qemu` + +Adding the new kernel name with already existing supported kernels to the file `qemo.go` which is located under `vm/qemu`. + +## Syzkaller description & pseudo-syscalls + +Check [descriptions](/docs/syscall_descriptions.md), and [pseudo-syscalls](/docs/pseudo_syscalls.md). |
