|
1 | 1 | # RT-Thread for x86 |
2 | 2 |
|
| 3 | +## Intro |
| 4 | +This x86 BSP support both newlib & picolib, with toolchain available |
| 5 | + - **Newlib:** `i686-atxhua-newlib-elf-` |
| 6 | + - **Picolibc:** `i686-atxhua-picolib-elf-` |
| 7 | + |
| 8 | +## Install Toolchain |
| 9 | +To install toolchain run the following command: |
| 10 | + - **Newlib:** sudo ../../tools/ci/toolchain.sh i686-atxhua-newlib-elf-gcc |
| 11 | + - **Picolibc:** sudo ../../tools/ci/toolchain.sh i686-atxhua-picolib-elf-gcc |
| 12 | + |
| 13 | +## Configuration |
| 14 | +Use `menuconfig` to select your preferred C library: |
| 15 | + 1. Run `scons --menuconfig` |
| 16 | + 2. Navigate to `X86 Features` -> `C Library type` |
| 17 | + 3. Select either `Newlib`(default) or `Picolibc` |
| 18 | + |
| 19 | +## Building |
| 20 | +After select the correct library in `menuconfig`, set the toolchain path and prefix: |
| 21 | +### Newlib |
| 22 | +```bash |
| 23 | +export RTT_EXEC_PATH=/opt/i686-atxhua-newlib-elf-gcc/bin |
| 24 | +export RTT_CC_PREFIX=i686-atxhua-newlib-elf- |
| 25 | +scons |
| 26 | +``` |
| 27 | + |
| 28 | +### Picolib |
| 29 | +```bash |
| 30 | +export RTT_EXEC_PATH=/opt/i686-atxhua-picolib-elf-gcc/bin |
| 31 | +export RTT_CC_PREFIX=i686-atxhua-picolib-elf- |
| 32 | +scons |
| 33 | +``` |
| 34 | + |
| 35 | +## Result ELF |
| 36 | +### Newlib |
| 37 | +``` |
| 38 | +Memory region Used Size Region Size %age Used |
| 39 | +i686-atxhua-newlib-elf-objcopy -O binary rtthread.elf rtthread.bin |
| 40 | +i686-atxhua-newlib-elf-size rtthread.elf |
| 41 | + text data bss dec hex filename |
| 42 | + 212900 3274 10844 227018 376ca rtthread.elf |
| 43 | +scons: done building targets. |
| 44 | +
|
| 45 | +``` |
| 46 | + |
| 47 | +### Picolib |
| 48 | +``` |
| 49 | +Memory region Used Size Region Size %age Used |
| 50 | +i686-atxhua-picolib-elf-objcopy -O binary rtthread.elf rtthread.bin |
| 51 | +i686-atxhua-picolib-elf-size rtthread.elf |
| 52 | + text data bss dec hex filename |
| 53 | + 174122 2568 10528 187218 2db52 rtthread.elf |
| 54 | +scons: done building targets. |
| 55 | +``` |
| 56 | + |
3 | 57 | 这是一份基础的RT-Thread针对x86的版本、移植,主要是能够在qemu中执行。以下说明主要针对Linux的环境,如果是Windows环境,请使用Env工具,同时请自行处理生成iso的方法。 |
4 | 58 |
|
5 | 59 | ## 编译 |
|
8 | 62 |
|
9 | 63 | * [i386-unknown-elf_for_x86_64-pc-linux-gnu_latest.tar.bz2](http://117.143.63.254:9012/www/rt-smart/i386-unknown-elf_for_x86_64-pc-linux-gnu_latest.tar.bz2) |
10 | 64 | * [ GCC 15.2.0 w/ Newlib 4.6.0.20260123: https://github.com/atxhua/i686-atxhua-newlib-elf/releases/download/15.2.0/i686-atxhua-newlib-elf-linux.tar.gz ](https://github.com/atxhua/i686-atxhua-newlib-elf/releases/download/15.2.0/i686-atxhua-newlib-elf-linux.tar.gz) |
| 65 | +* [ GCC 15.2.0 w/ Picolib 1.8.11: https://github.com/atxhua/i686-atxhua-picolib-elf/releases/download/15.2.0/i686-atxhua-picolib-elf-linux.tar.gz ](https://github.com/atxhua/i686-atxhua-picolib-elf/releases/download/15.2.0/i686-atxhua-picolib-elf-linux.tar.gz) |
11 | 66 |
|
12 | 67 |
|
13 | 68 | 下载后解压,然后配置RTT_EXEC_PATH & RTT_CC_PREFIX 变量 |
|
0 commit comments