Skip to content

Commit a8a9ed1

Browse files
authored
Merge pull request #197 from ElizaXiao/ElizaXiao-patch-1
完成 adding_new_os_support.md 的翻译
2 parents 9f33959 + ceaeb82 commit a8a9ed1

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed
Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,62 @@
11
---
2-
status: translating
2+
status: translated
33
title: "Adding new OS support"
44
author: Syzkaller Community
55
collector: jxlpzqc
66
collected_date: 20240314
77
translator: ElizaXiao
8-
translating_date: 20240828
8+
translated_date: 20240828
99
link: https://github.com/google/syzkaller/blob/master/docs/adding_new_os_support.md
1010
---
1111

12-
# Adding new OS support
12+
# 添加新的操作系统支持
1313

14-
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).
14+
为了让 syzkaller 支持一个新的操作系统内核,以下是需要编辑的 syzkaller 的共同部分。然而,对于特定的内核,可能还需要一些特定的更改(例如,从给定的内核收集覆盖率信息,或者一些可能弹出并给出调整提示的错误信息)。
1515

1616
## syz-executor
1717

18-
For each OS, there is this file `executor/executor_GOOS.h` where GOOS is the OS name. This file contains two important functions:
18+
对于每个操作系统,都有一个操作系统名为 GOOS 的文件 `executor/executor_GOOS.h`。这个文件包含两个重要函数:
1919

20-
- `os_init` which is responsible for mapping a virtual address space for the calling process,
21-
- `execute_syscall` which is responsible for executing system calls for a particular OS kernel.
20+
- `os_init` 负责为调用进程映射虚拟地址空间,
21+
- `execute_syscall` 负责为特定操作系统内核执行系统调用。
2222

23-
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.
23+
这两个函数在 `executor_GOOS.h` 中被调用,它主要负责执行系统调用程序,并管理程序运行的线程。
2424

25-
`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) ).
25+
`executor_GOOS.h` 还包含与该操作系统相关的函数,例如允许它收集覆盖率信息、检测位宽等的函数(例如:[executor_linux.h](/executor/executor_linux.h))。
2626

27-
The intended function will be called according to the target kernel as defined by the macros in the `executor/executor.cc` file.
27+
目标内核将根据 `executor/executor.cc` 文件中定义的宏调用预期的函数。
2828

29-
## Build files `pkg/`
29+
## 构建文件 `pkg/`
3030

31-
- The OS name is added to `pkg/build/build.go` along with the supported architecture
32-
- Creating a file that builds the image for the targeted kernel under `pkg/build/`. This file contains functions for configuring the build of the bootable image, for building it, and for generate SSH keys which will be used by Syzkaller in order to access the VM. There is a file per each of the supported OSes by Syzkaller where the name pattern is `GOOS.go`.
31+
- `pkg/build/build.go` 中添加操作系统名称及其支持的架构
32+
- `pkg/build/` 下创建一个构建目标内核镜像的文件。这个文件包含配置可启动镜像构建的函数、构建它以及生成 SSH 密钥的函数,这些密钥将由 Syzkaller 用于访问虚拟机。每个由 Syzkaller 支持的操作系统都有一个名为 `GOOS.go` 的文件。
3333

34-
- Adding the given target to the `s/makefile/Makefile/`.
34+
- 将给定目标添加到 `s/makefile/Makefile/`
3535

36-
## Report files `pkg/report/`
36+
## 报告文件 `pkg/report/`
3737

38-
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`.
38+
`pkg/report/` 下为目标内核创建一个报告构建错误的文件。每个由 Syzkaller 支持的操作系统都有一个名为 `GOOS.go` 的文件。
3939

40-
## Editing `pkg/host/`
40+
## 编辑 `pkg/host/`
4141

42-
- implement `isSupported` function that returns true for a supported syscall, it is located under `pkg/host/GOOS`.
42+
- 实现 `isSupported` 函数,该函数对于支持的系统调用返回 true,它位于 `pkg/host/GOOS` 目录下。
4343

44-
## Creating a file under `sys/GOOS/`
44+
## `sys/GOOS/` 下创建文件
4545

46-
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.
46+
`sys/GOOS/` 下为目标内核创建一个 `init.go` 文件,其中包含初始化目标和不同支持架构的 `initTarget` 函数。
4747

48-
## Editing `sys/syz-extract`
48+
## 编辑 `sys/syz-extract`
4949

50-
Adding the new kernel name with already existing supported kernels to the file `sys/syz-extract/extract.go`.
50+
将新内核名称添加到已支持的内核列表中,并更新到文件 `sys/syz-extract/extract.go` 中。
5151

52-
## Editing `sys/targets`
52+
## 编辑 `sys/targets`
5353

54-
Adding the new kernel name with already existing supported kernels to the file `targets.go` which is located under`sys/targets`.
54+
将新内核名称添加到已支持的内核列表中,并更新到文件 `sys/targets/targets.go` 中。
5555

56-
## Editing `vm/qemu`
56+
## 编辑 `vm/qemu`
5757

58-
Adding the new kernel name with already existing supported kernels to the file `qemo.go` which is located under `vm/qemu`.
58+
将新内核名称添加到已支持内核的列表中,并更新到文件 `vm/qemu/qemu.go` 中。
5959

60-
## Syzkaller description & pseudo-syscalls
60+
## Syzkaller 描述与伪系统调用
6161

62-
Check [descriptions](/docs/syscall_descriptions.md), and [pseudo-syscalls](/docs/pseudo_syscalls.md).
62+
查看 [描述](/docs/syscall_descriptions.md)[伪系统调用](/docs/pseudo_syscalls.md).

0 commit comments

Comments
 (0)