From ba064adb5f6bd6d013fb2f5fd048c960ebb5b42d Mon Sep 17 00:00:00 2001 From: laokz Date: Fri, 18 Feb 2022 11:07:02 +0800 Subject: [PATCH] =?UTF-8?q?chore(docs):=20=E5=88=A0=E9=99=A4=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E4=B8=AD=E5=91=BD=E4=BB=A4=E7=9A=84shell=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix #I4U85M Signed-off-by: laokz Change-Id: Ie81114b57942f829dea6b71f9fe8f408e0a5c1b3 --- README.md | 20 ++++++++++---------- README_zh.md | 20 ++++++++++---------- arm_mps2_an386/README.md | 24 ++++++++++++------------ arm_mps2_an386/README_zh.md | 24 ++++++++++++------------ arm_mps3_an547/README.md | 24 ++++++++++++------------ arm_mps3_an547/README_zh.md | 24 ++++++++++++------------ arm_virt/liteos_a/README.md | 10 +++++----- arm_virt/liteos_a/README_zh.md | 10 +++++----- riscv32_virt/README.md | 14 +++++++------- riscv32_virt/README_zh.md | 14 +++++++------- 10 files changed, 92 insertions(+), 92 deletions(-) diff --git a/README.md b/README.md index e8fd881..2bc2c28 100644 --- a/README.md +++ b/README.md @@ -69,13 +69,13 @@ QEMU applies only to the OpenHarmony kernel. 1. Install dependencies(Ubuntu 18+) ``` - $ sudo apt install build-essential zlib1g-dev pkg-config libglib2.0-dev binutils-dev libboost-all-dev autoconf libtool libssl-dev libpixman-1-dev virtualenv flex bison + sudo apt install build-essential zlib1g-dev pkg-config libglib2.0-dev binutils-dev libboost-all-dev autoconf libtool libssl-dev libpixman-1-dev virtualenv flex bison ``` 2. Acquiring Source Code ``` - $ wget https://download.qemu.org/qemu-6.2.0.tar.xz + wget https://download.qemu.org/qemu-6.2.0.tar.xz ``` or @@ -85,29 +85,29 @@ QEMU applies only to the OpenHarmony kernel. 3. Compile and install ``` - $ tar -xf qemu-6.2.0.tar.xz - $ cd qemu-6.2.0 - $ mkdir build && cd build - $ ../configure --prefix=qemu_installation_path - $ make -j16 + tar -xf qemu-6.2.0.tar.xz + cd qemu-6.2.0 + mkdir build && cd build + ../configure --prefix=qemu_installation_path + make -j16 ``` Wait for the compilation to finish and execute the installation command: ``` - $ make install + make install ``` Finally, add the installation path to the environment variable: ``` - $ vim ~/.bashrc + vim ~/.bashrc ``` Add the following command line to the last line of ~/.bashrc: ``` - $ export PATH=$PATH:qemu_installation_path + export PATH=$PATH:qemu_installation_path ``` ## Usage diff --git a/README_zh.md b/README_zh.md index 25262f3..90542b5 100644 --- a/README_zh.md +++ b/README_zh.md @@ -69,13 +69,13 @@ QEMU可以模拟内核运行在不同的单板,解除对物理开发板的依 1. 安装依赖(Ubuntu 18+) ``` - $ sudo apt install build-essential zlib1g-dev pkg-config libglib2.0-dev binutils-dev libboost-all-dev autoconf libtool libssl-dev libpixman-1-dev virtualenv flex bison + sudo apt install build-essential zlib1g-dev pkg-config libglib2.0-dev binutils-dev libboost-all-dev autoconf libtool libssl-dev libpixman-1-dev virtualenv flex bison ``` 2. 获取源码 ``` - $ wget https://download.qemu.org/qemu-6.2.0.tar.xz + wget https://download.qemu.org/qemu-6.2.0.tar.xz ``` 或 @@ -85,29 +85,29 @@ QEMU可以模拟内核运行在不同的单板,解除对物理开发板的依 3. 编译安装 ``` - $ tar -xf qemu-6.2.0.tar.xz - $ cd qemu-6.2.0 - $ mkdir build && cd build - $ ../configure --prefix=qemu_installation_path - $ make -j16 + tar -xf qemu-6.2.0.tar.xz + cd qemu-6.2.0 + mkdir build && cd build + ../configure --prefix=qemu_installation_path + make -j16 ``` 等待编译结束, 执行安装命令: ``` - $ make install + make install ``` 最后将安装路径添加到环境变量中: ``` - $ vim ~/.bashrc + vim ~/.bashrc ``` 在~/.bashrc最末尾加入: ``` - $ export PATH=$PATH:qemu_installation_path + export PATH=$PATH:qemu_installation_path ``` ## 使用说明 diff --git a/arm_mps2_an386/README.md b/arm_mps2_an386/README.md index dc2411e..805ff74 100644 --- a/arm_mps2_an386/README.md +++ b/arm_mps2_an386/README.md @@ -21,31 +21,31 @@ Compiler install Note: Command to install toolchain without arm-none-eabi-gdb, gdb cannot be debugged. ``` -$ sudo apt install gcc-arm-none-eabi +sudo apt install gcc-arm-none-eabi ``` 2.The installation package to install -Note: If you have already passed the command to install gcc-arm-none-eabi, can through the command: `$sudo apt remove +Note: If you have already passed the command to install gcc-arm-none-eabi, can through the command: `sudo apt remove gcc-arm-none-eabi` after unloading, install again. Download toolchain: [package](https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/6-2017q2/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2)。 ``` -$ chmod 777 gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 -$ tar -xvf gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 install_path +chmod 777 gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 +tar -xvf gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 install_path ``` Add the installation path to the environment variable: ``` -$ vim ~/.bashrc +vim ~/.bashrc ``` Add the following command line to the last line of ~/.bashrc: ``` -$ export PATH=$PATH:install_path/gcc-arm-none-eabi-6-2017-q2-update/bin +export PATH=$PATH:install_path/gcc-arm-none-eabi-6-2017-q2-update/bin ``` #### 3. Code acquisition @@ -66,7 +66,7 @@ Select `qemu_mini_system_demo` under **ohemu**. Run the following build command: ``` -$ hb build -f +hb build -f ``` This will build `OHOS_Image` for Qemu Cortex-m4 mps2-an386 machine. @@ -103,8 +103,8 @@ Run a OHOS image in qemu according to the options. #### 6. gdb debug ``` -$ cd device/qemu/arm_mps2_an386 -$ vim liteos_m/config.gni +cd device/qemu/arm_mps2_an386 +vim liteos_m/config.gni ``` In the modified `board_opt_flags` compiler options: @@ -121,19 +121,19 @@ board_opt_flags = [ "-g" ] Save and exit, recompile under OHOS root directory: ``` -$ hb build -f +hb build -f ``` In a window to enter the command: ``` -$ ./qemu-run -g +./qemu-run -g ``` In another window to enter the command: ``` -$ arm-none-eabi-gdb out/arm_mps2_an386/qemu_mini_system_demo/OHOS_Image +arm-none-eabi-gdb out/arm_mps2_an386/qemu_mini_system_demo/OHOS_Image (gdb) target remote localhost:1234 (gdb) b main ``` diff --git a/arm_mps2_an386/README_zh.md b/arm_mps2_an386/README_zh.md index 5266bf3..996229e 100644 --- a/arm_mps2_an386/README_zh.md +++ b/arm_mps2_an386/README_zh.md @@ -19,30 +19,30 @@ Arm Cortex-m4 虚拟化平台是一个 `qemu-system-arm` 的目标设备,通 提示:命令安装的工具链无 arm-none-eabi-gdb,无法进行gdb调试 ``` -$ sudo apt install gcc-arm-none-eabi +sudo apt install gcc-arm-none-eabi ``` 2.安装包安装 -提示:如果已经通过命令安装了gcc-arm-none-eabi, 可以通过命令:`$ sudo apt remove gcc-arm-none-eabi` 卸载之后,再进行安装。 +提示:如果已经通过命令安装了gcc-arm-none-eabi, 可以通过命令:`sudo apt remove gcc-arm-none-eabi` 卸载之后,再进行安装。 下载工具链[安装包](https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/6-2017q2/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2)。 ``` -$ chmod 777 gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 -$ tar -xvf gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 install_path +chmod 777 gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 +tar -xvf gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 install_path ``` 将安装路径添加到环境变量中: ``` -$ vim ~/.bashrc +vim ~/.bashrc ``` 在~/.bashrc最末尾加入: ``` -$ export PATH=$PATH:install_path/gcc-arm-none-eabi-6-2017-q2-update/bin +export PATH=$PATH:install_path/gcc-arm-none-eabi-6-2017-q2-update/bin ``` ## 3. 获取源码 @@ -64,7 +64,7 @@ hb set 然后执行构建命令如下: ``` -$ hb build -f +hb build -f ``` 这个命令构建会产生 `OHOS_Image` 的镜像文件。 @@ -99,8 +99,8 @@ Run a OHOS image in qemu according to the options. ## 6. gdb调试 ``` -$ cd device/qemu/arm_mps2_an386 -$ vim liteos_m/config.gni +cd device/qemu/arm_mps2_an386 +vim liteos_m/config.gni ``` 将 `board_opt_flags` 中的 @@ -118,19 +118,19 @@ board_opt_flags = [ "-g" ] 保存并退出,在OHOS根目录重新编译: ``` -$ hb build -f +hb build -f ``` 在一个窗口中输入命令: ``` -$ ./qemu-run -g +./qemu-run -g ``` 在另一个窗口中输入命令: ``` -$ arm-none-eabi-gdb out/arm_mps2_an386/qemu_mini_system_demo/OHOS_Image +arm-none-eabi-gdb out/arm_mps2_an386/qemu_mini_system_demo/OHOS_Image (gdb) target remote localhost:1234 (gdb) b main ``` diff --git a/arm_mps3_an547/README.md b/arm_mps3_an547/README.md index 5ea842e..7f33bee 100755 --- a/arm_mps3_an547/README.md +++ b/arm_mps3_an547/README.md @@ -20,31 +20,31 @@ Compiler install Note: Command to install toolchain without arm-none-eabi-gdb, gdb cannot be debugged. ``` -$ sudo apt install gcc-arm-none-eabi +sudo apt install gcc-arm-none-eabi ``` 2.The installation package to install -Note: The MVE feature of cortex-m55 processor can only be supported by installing the cross tool chain launched after 2020. If you have already passed the command to install gcc-arm-none-eabi, can through the command: `$sudo apt remove +Note: The MVE feature of cortex-m55 processor can only be supported by installing the cross tool chain launched after 2020. If you have already passed the command to install gcc-arm-none-eabi, can through the command: `sudo apt remove gcc-arm-none-eabi` after unloading, install again. Download toolchain: [package](https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2)。 ``` -$ chmod 777 gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 -$ tar -xvf gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 install_path +chmod 777 gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 +tar -xvf gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 install_path ``` Add the installation path to the environment variable: ``` -$ vim ~/.bashrc +vim ~/.bashrc ``` Add the following command line to the last line of ~/.bashrc: ``` -$ export PATH=$PATH:install_path/gcc-arm-none-eabi-10.3-2021.10/bin +export PATH=$PATH:install_path/gcc-arm-none-eabi-10.3-2021.10/bin ``` #### 3. Code acquisition @@ -65,7 +65,7 @@ Select `qemu_cm55_mini_system_demo` under **ohemu**. Run the following build command: ``` -$ hb build -f +hb build -f ``` This will build `OHOS_Image` for Qemu Cortex-m55 mps3-an547 machine. @@ -103,8 +103,8 @@ Run a OHOS image in qemu according to the options. #### 6. gdb debug ``` -$ cd device/qemu/arm_mps3_an547 -$ vim liteos_m/config.gni +cd device/qemu/arm_mps3_an547 +vim liteos_m/config.gni ``` In the modified `board_opt_flags` compiler options: @@ -121,19 +121,19 @@ board_opt_flags = [ "-g" ] Save and exit, recompile under OHOS root directory: ``` -$ hb build -f +hb build -f ``` In a window to enter the command: ``` -$ ./qemu-run -g +./qemu-run -g ``` In another window to enter the command: ``` -$ arm-none-eabi-gdb out/arm_mps3_an547/qemu_cm55_mini_system_demo/OHOS_Image +arm-none-eabi-gdb out/arm_mps3_an547/qemu_cm55_mini_system_demo/OHOS_Image (gdb) target remote localhost:1234 (gdb) b main ``` diff --git a/arm_mps3_an547/README_zh.md b/arm_mps3_an547/README_zh.md index c69a9d4..af3995d 100755 --- a/arm_mps3_an547/README_zh.md +++ b/arm_mps3_an547/README_zh.md @@ -19,30 +19,30 @@ Arm Cortex-m55 虚拟化平台是一个 `qemu-system-arm` 的目标设备,通 提示:命令安装的工具链无 arm-none-eabi-gdb,无法进行gdb调试 ``` -$ sudo apt install gcc-arm-none-eabi +sudo apt install gcc-arm-none-eabi ``` 2.安装包安装 -提示:安装2020年后推出的交叉工具链才能支持cortex-m55处理器的MVE特性。如果已经通过命令安装了gcc-arm-none-eabi, 可以通过命令:`$ sudo apt remove gcc-arm-none-eabi` 卸载之后,再进行安装。 +提示:安装2020年后推出的交叉工具链才能支持cortex-m55处理器的MVE特性。如果已经通过命令安装了gcc-arm-none-eabi, 可以通过命令:`sudo apt remove gcc-arm-none-eabi` 卸载之后,再进行安装。 下载工具链[安装包](https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2)。 ``` -$ chmod 777 gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 -$ tar -xvf gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 install_path +chmod 777 gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 +tar -xvf gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 install_path ``` 将安装路径添加到环境变量中: ``` -$ vim ~/.bashrc +vim ~/.bashrc ``` 在~/.bashrc最末尾加入: ``` -$ export PATH=$PATH:install_path/gcc-arm-none-eabi-10.3-2021.10/bin +export PATH=$PATH:install_path/gcc-arm-none-eabi-10.3-2021.10/bin ``` ## 3. 获取源码 @@ -64,7 +64,7 @@ hb set 然后执行构建命令如下: ``` -$ hb build -f +hb build -f ``` 这个命令构建会产生 `OHOS_Image` 的镜像文件。 @@ -100,8 +100,8 @@ Run a OHOS image in qemu according to the options. ## 6. gdb调试 ``` -$ cd device/qemu/arm_mps3_an547 -$ vim liteos_m/config.gni +cd device/qemu/arm_mps3_an547 +vim liteos_m/config.gni ``` 将 `board_opt_flags` 中的 @@ -119,19 +119,19 @@ board_opt_flags = [ "-g" ] 保存并退出,在OHOS根目录重新编译: ``` -$ hb build -f +hb build -f ``` 在一个窗口中输入命令: ``` -$ ./qemu-run -g +./qemu-run -g ``` 在另一个窗口中输入命令: ``` -$ arm-none-eabi-gdb out/arm_mps3_an547/qemu_cm55_mini_system_demo/OHOS_Image +arm-none-eabi-gdb out/arm_mps3_an547/qemu_cm55_mini_system_demo/OHOS_Image (gdb) target remote localhost:1234 (gdb) b main ``` diff --git a/arm_virt/liteos_a/README.md b/arm_virt/liteos_a/README.md index 5dc178b..7db9f41 100644 --- a/arm_virt/liteos_a/README.md +++ b/arm_virt/liteos_a/README.md @@ -81,8 +81,8 @@ sudo apt install gdb-multiarch ``` Then, ``` -$ cd ohos/vendor/ohemu/qemu_small_system_demo/kernel_configs -$ vim debug.config +cd ohos/vendor/ohemu/qemu_small_system_demo/kernel_configs +vim debug.config ``` Modify `LOSCFG_CC_STACKPROTECTOR_ALL=y` to: @@ -95,19 +95,19 @@ LOSCFG_COMPILE_DEBUG=y Save and exit, recompile under OHOS root directory: ``` -$ hb build -f +hb build -f ``` In a window to enter the command: ``` -$ ./qemu-run -g +./qemu-run -g ``` In another window to enter the command: ``` -$ gdb-multiarch out/arm_virt/qemu_small_system_demo/OHOS_Image +gdb-multiarch out/arm_virt/qemu_small_system_demo/OHOS_Image (gdb) target remote localhost:1234 ``` diff --git a/arm_virt/liteos_a/README_zh.md b/arm_virt/liteos_a/README_zh.md index 5ba55d0..0623df2 100644 --- a/arm_virt/liteos_a/README_zh.md +++ b/arm_virt/liteos_a/README_zh.md @@ -85,8 +85,8 @@ sudo apt install gdb-multiarch ``` 然后, ``` -$ cd ohos/vendor/ohemu/qemu_small_system_demo/kernel_configs -$ vim debug.config +cd ohos/vendor/ohemu/qemu_small_system_demo/kernel_configs +vim debug.config ``` 将 `LOSCFG_CC_STACKPROTECTOR_ALL=y` 修改为: @@ -99,19 +99,19 @@ LOSCFG_COMPILE_DEBUG=y 保存并退出,在OHOS根目录重新编译: ``` -$ hb build -f +hb build -f ``` 在一个窗口中输入命令: ``` -$ ./qemu-run -g +./qemu-run -g ``` 在另一个窗口中输入命令: ``` -$ gdb-multiarch out/arm_virt/qemu_small_system_demo/OHOS_Image +gdb-multiarch out/arm_virt/qemu_small_system_demo/OHOS_Image (gdb) target remote localhost:1234 ``` diff --git a/riscv32_virt/README.md b/riscv32_virt/README.md index 65164d0..a4e8867 100644 --- a/riscv32_virt/README.md +++ b/riscv32_virt/README.md @@ -56,8 +56,8 @@ b) Run (1) qemu version < 5.0.0 ``` -$ cd device/qemu/riscv32_virt -$ qemu-system-riscv32 -machine virt -m 128M -kernel ../../../out/riscv32_virt/qemu_riscv_mini_system_demo/OHOS_Image -nographic -append "root=dev/vda or console=ttyS0" +cd device/qemu/riscv32_virt +qemu-system-riscv32 -machine virt -m 128M -kernel ../../../out/riscv32_virt/qemu_riscv_mini_system_demo/OHOS_Image -nographic -append "root=dev/vda or console=ttyS0" ``` (2). qemu version >= 5.0.0 @@ -86,8 +86,8 @@ If you want to use other kernel exec file, please try `./qemu-run -e [file_name] #### 6. gdb debug ``` -$ cd device/qemu/riscv32_virt -$ vim liteos_m/config.gni +cd device/qemu/riscv32_virt +vim liteos_m/config.gni ``` In the modified `board_opt_flags` compiler options: @@ -105,19 +105,19 @@ board_opt_flags = [ "-g" ] Save and exit, recompile under OHOS root directory: ``` -$ hb build -f +hb build -f ``` In a window to enter the command: ``` -$ ./qemu-run -g +./qemu-run -g ``` In another window to enter the command: ``` -$ riscv32-unknown-elf-gdb out/riscv32_virt/qemu_riscv_mini_system_demo/OHOS_Image +riscv32-unknown-elf-gdb out/riscv32_virt/qemu_riscv_mini_system_demo/OHOS_Image (gdb) target remote localhost:1234 (gdb) b main ``` diff --git a/riscv32_virt/README_zh.md b/riscv32_virt/README_zh.md index f085652..95cb599 100644 --- a/riscv32_virt/README_zh.md +++ b/riscv32_virt/README_zh.md @@ -54,8 +54,8 @@ b) 运行 (1). qemu 版本 < 5.0.0 ``` -$ cd device/qemu/riscv32_virt -$ qemu-system-riscv32 -machine virt -m 128M -kernel ../../../out/riscv32_virt/qemu_riscv_mini_system_demo/OHOS_Image -nographic -append "root=dev/vda or console=ttyS0" +cd device/qemu/riscv32_virt +qemu-system-riscv32 -machine virt -m 128M -kernel ../../../out/riscv32_virt/qemu_riscv_mini_system_demo/OHOS_Image -nographic -append "root=dev/vda or console=ttyS0" ``` (2). qemu 版本 >= 5.0.0 @@ -83,8 +83,8 @@ Run a OHOS image in qemu according to the options. ## 6. gdb调试 ``` -$ cd device/qemu/riscv32_virt -$ vim liteos_m/config.gni +cd device/qemu/riscv32_virt +vim liteos_m/config.gni ``` 将 `board_opt_flags` 中的 @@ -102,19 +102,19 @@ board_opt_flags = [ "-g" ] 保存并退出,在OHOS根目录重新编译: ``` -$ hb build -f +hb build -f ``` 在一个窗口中输入命令: ``` -$ ./qemu-run -g +./qemu-run -g ``` 在另一个窗口中输入命令: ``` -$ riscv32-unknown-elf-gdb out/riscv32_virt/qemu_riscv_mini_system_demo/OHOS_Image +riscv32-unknown-elf-gdb out/riscv32_virt/qemu_riscv_mini_system_demo/OHOS_Image (gdb) target remote localhost:1234 (gdb) b main ``` -- Gitee