mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-27 16:13:23 +00:00
doc: Add ai doc translate tool and add English doc. (#1168)
- add tools/doc_translator.py - translated docs into English Signed-off-by: longjin <longjin@DragonOS.org>
This commit is contained in:
21
docs/locales/en/kernel/process_management/index.rst
Normal file
21
docs/locales/en/kernel/process_management/index.rst
Normal file
@ -0,0 +1,21 @@
|
||||
.. note:: AI Translation Notice
|
||||
|
||||
This document was automatically translated by `Qwen/Qwen3-8B` model, for reference only.
|
||||
|
||||
- Source document: kernel/process_management/index.rst
|
||||
|
||||
- Translation time: 2025-05-19 01:41:09
|
||||
|
||||
- Translation model: `Qwen/Qwen3-8B`
|
||||
|
||||
|
||||
Please report issues via `Community Channel <https://github.com/DragonOS-Community/DragonOS/issues>`_
|
||||
|
||||
Process Management Module
|
||||
====================================
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
kthread
|
||||
load_binary
|
30
docs/locales/en/kernel/process_management/kthread.md
Normal file
30
docs/locales/en/kernel/process_management/kthread.md
Normal file
@ -0,0 +1,30 @@
|
||||
:::{note}
|
||||
**AI Translation Notice**
|
||||
|
||||
This document was automatically translated by `Qwen/Qwen3-8B` model, for reference only.
|
||||
|
||||
- Source document: kernel/process_management/kthread.md
|
||||
|
||||
- Translation time: 2025-05-19 01:41:23
|
||||
|
||||
- Translation model: `Qwen/Qwen3-8B`
|
||||
|
||||
Please report issues via [Community Channel](https://github.com/DragonOS-Community/DragonOS/issues)
|
||||
|
||||
:::
|
||||
|
||||
# kthread Kernel Threads
|
||||
|
||||
  The kernel thread module is implemented in `process/kthread.rs`, providing support for kernel threads and related functionalities. Kernel threads act as the "avatars" of the kernel, enhancing the system's parallelism and fault tolerance capabilities.
|
||||
|
||||
## Principles
|
||||
|
||||
  Each kernel thread runs in kernel mode, executing its specific tasks.
|
||||
|
||||
  The creation of a kernel thread is achieved by calling the `KernelThreadMechanism::create()` or `KernelThreadMechanism::create_and_run()` function, which sends a creation task to the `kthreadd` daemon thread. In other words, the creation of a kernel thread is ultimately handled by `kthread_daemon`.
|
||||
|
||||
  After a kernel thread is created, it defaults to a sleeping state. To wake it up, the `ProcessManager::wakeup` function should be used.
|
||||
|
||||
  When other kernel modules wish to stop a kernel thread, they can call the `KernelThreadMechanism::stop()` function to wait for the thread to exit, then obtain the return value and clean up the thread's PCB (Process Control Block).
|
||||
|
||||
  Kernel threads should frequently check the result of `KernelThreadMechanism::should_stop()` to determine whether they should exit. When it is detected that the thread needs to exit, it can return a return code to terminate itself. (Note: resource cleanup is important)
|
30
docs/locales/en/kernel/process_management/load_binary.md
Normal file
30
docs/locales/en/kernel/process_management/load_binary.md
Normal file
@ -0,0 +1,30 @@
|
||||
:::{note}
|
||||
**AI Translation Notice**
|
||||
|
||||
This document was automatically translated by `Qwen/Qwen3-8B` model, for reference only.
|
||||
|
||||
- Source document: kernel/process_management/load_binary.md
|
||||
|
||||
- Translation time: 2025-05-19 01:41:18
|
||||
|
||||
- Translation model: `Qwen/Qwen3-8B`
|
||||
|
||||
Please report issues via [Community Channel](https://github.com/DragonOS-Community/DragonOS/issues)
|
||||
|
||||
:::
|
||||
|
||||
# Loader
|
||||
|
||||
## 1. Binary Program Loading
|
||||
|
||||
  In this section, you will learn about the principles of the binary loader in DragonOS.
|
||||
|
||||
  When DragonOS loads a binary program, it performs a "probe-load" process.
|
||||
|
||||
  During the probe phase, DragonOS reads the file header and sequentially calls the probe functions of each binary loader to determine whether the binary program is suitable for that loader. If it is suitable, the loader will be used to load the program.
|
||||
|
||||
  During the load phase, DragonOS uses the aforementioned loader to load the program. The loader will map the various segments of the binary program into memory and obtain the entry address of the binary program.
|
||||
|
||||
:::{note}
|
||||
Currently, DragonOS does not support dynamic linking, so all binary programs are statically linked. And only the ELF loader is temporarily supported.
|
||||
:::
|
Reference in New Issue
Block a user