mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-29 09:53:24 +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:
32
docs/locales/en/userland/appdev/c-cpp-quick-start.md
Normal file
32
docs/locales/en/userland/appdev/c-cpp-quick-start.md
Normal file
@ -0,0 +1,32 @@
|
||||
:::{note}
|
||||
**AI Translation Notice**
|
||||
|
||||
This document was automatically translated by `Qwen/Qwen3-8B` model, for reference only.
|
||||
|
||||
- Source document: userland/appdev/c-cpp-quick-start.md
|
||||
|
||||
- Translation time: 2025-05-19 01:41:49
|
||||
|
||||
- Translation model: `Qwen/Qwen3-8B`
|
||||
|
||||
Please report issues via [Community Channel](https://github.com/DragonOS-Community/DragonOS/issues)
|
||||
|
||||
:::
|
||||
|
||||
# Developing C/C++ Applications for DragonOS
|
||||
|
||||
## Compilation Environment
|
||||
|
||||
  DragonOS has partial binary compatibility with Linux, so you can use the musl-gcc compiler from Linux. However, since DragonOS does not currently support dynamic linking, you need to add the compilation parameter `-static`.
|
||||
|
||||
For example, you can use the following command:
|
||||
```shell
|
||||
musl-gcc -static -o hello hello.c
|
||||
```
|
||||
to compile a hello.c file.
|
||||
|
||||
When porting existing programs, you may need to configure `CFLAGS`, `LDFLAGS`, and `CPPFLAGS` to ensure correct compilation. Please refer to the actual requirements.
|
||||
|
||||
## Configuring DADK
|
||||
|
||||
Please refer to: [Quick Start | DADK](https://docs.dragonos.org.cn/p/dadk/user-manual/quickstart.html)
|
24
docs/locales/en/userland/appdev/index.rst
Normal file
24
docs/locales/en/userland/appdev/index.rst
Normal file
@ -0,0 +1,24 @@
|
||||
.. note:: AI Translation Notice
|
||||
|
||||
This document was automatically translated by `Qwen/Qwen3-8B` model, for reference only.
|
||||
|
||||
- Source document: userland/appdev/index.rst
|
||||
|
||||
- Translation time: 2025-05-19 02:13:34
|
||||
|
||||
- Translation model: `Qwen/Qwen3-8B`
|
||||
|
||||
|
||||
Please report issues via `Community Channel <https://github.com/DragonOS-Community/DragonOS/issues>`_
|
||||
|
||||
Application Development Documentation
|
||||
===================================================
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:caption: Contents
|
||||
|
||||
rust-quick-start
|
||||
c-cpp-quick-start
|
||||
Quick Start to Package an Application to DragonOS Using DADK <https://docs.dragonos.org.cn/p/dadk/user-manual/quickstart.html>
|
||||
DADK Complete Documentation <https://docs.dragonos.org.cn/p/dadk/>
|
51
docs/locales/en/userland/appdev/rust-quick-start.md
Normal file
51
docs/locales/en/userland/appdev/rust-quick-start.md
Normal file
@ -0,0 +1,51 @@
|
||||
:::{note}
|
||||
**AI Translation Notice**
|
||||
|
||||
This document was automatically translated by `Qwen/Qwen3-8B` model, for reference only.
|
||||
|
||||
- Source document: userland/appdev/rust-quick-start.md
|
||||
|
||||
- Translation time: 2025-05-19 01:41:52
|
||||
|
||||
- Translation model: `Qwen/Qwen3-8B`
|
||||
|
||||
Please report issues via [Community Channel](https://github.com/DragonOS-Community/DragonOS/issues)
|
||||
|
||||
:::
|
||||
|
||||
# Quick Start Guide for Rust Application Development
|
||||
|
||||
## Compilation Environment
|
||||
|
||||
  DragonOS has partial binary compatibility with Linux, so you can use the Rust compiler for Linux to compile.
|
||||
|
||||
## Project Configuration
|
||||
|
||||
### Creating from a Template
|
||||
|
||||
:::{note}
|
||||
This feature requires dadk version 0.2.0 or higher. For older versions, please refer to the historical DragonOS documentation.
|
||||
:::
|
||||
|
||||
1. Use the `bootstrap.sh` script in the tools directory of DragonOS to initialize the environment.
|
||||
2. Enter `cargo install cargo-generate` in the terminal.
|
||||
3. Enter the following command in the terminal:
|
||||
|
||||
```shell
|
||||
cargo generate --git https://github.com/DragonOS-Community/Rust-App-Template
|
||||
```
|
||||
To create the project. If your network is slow, please use a mirror site.
|
||||
```shell
|
||||
cargo generate --git https://git.mirrors.dragonos.org/DragonOS-Community/Rust-App-Template
|
||||
```
|
||||
|
||||
4. Use `cargo run` to run the project.
|
||||
5. In the `user/dadk/config` directory of DragonOS, refer to the template [userapp_config.toml](https://github.com/DragonOS-Community/DADK/blob/main/dadk-config/templates/config/userapp_config.toml) to create a compilation configuration, and install it to the `/` directory of DragonOS.
|
||||
(When using the compilation command options of dadk, please use the `make install` configuration in the Makefile for compilation and installation)
|
||||
6. Compile DragonOS to install.
|
||||
|
||||
### Manual Configuration
|
||||
|
||||
If you need to port other libraries or programs to DragonOS, please refer to the configuration in the template.
|
||||
|
||||
Since DragonOS currently does not support dynamic linking, you need to specify `-C target-feature=+crt-static -C link-arg=-no-pie` in RUSTFLAGS.
|
Reference in New Issue
Block a user