atxhua 8c5e36f525 Add X86 i686 gcc 15.2.0 (#11388) il y a 1 jour
..
applications f7be5fc84b [bsp][applications][sconscript] 整理统一sconscript格式 (#6481) il y a 3 ans
drivers 3db4b3e4ae 修复 bsp/x86 编译问题 il y a 2 ans
root 89d7159460 [BSP] add dbg/run.sh script for x86 il y a 4 ans
.config 4e46e97c18 [format][version]: synchronize bsp version configuration il y a 5 jours
Kconfig fe3c4d456e bsp中option env语句替换为新语句,并同步更新了source "$xxx"语句 il y a 1 an
README.md 8c5e36f525 Add X86 i686 gcc 15.2.0 (#11388) il y a 1 jour
SConscript 2da5d4a5d6 [bsp][x86] update x86 with Kconfig and newlib toolchains. il y a 5 ans
SConstruct 9bc68d26a4 format Kconfig and sconscript il y a 3 ans
dbg.sh 89d7159460 [BSP] add dbg/run.sh script for x86 il y a 4 ans
rtconfig.h 4e46e97c18 [format][version]: synchronize bsp version configuration il y a 5 jours
rtconfig.py 8c5e36f525 Add X86 i686 gcc 15.2.0 (#11388) il y a 1 jour
run.sh 89d7159460 [BSP] add dbg/run.sh script for x86 il y a 4 ans
x86_ram.lds 592284c66c format link scripts il y a 3 ans

README.md

RT-Thread for x86

这是一份基础的RT-Thread针对x86的版本、移植,主要是能够在qemu中执行。以下说明主要针对Linux的环境,如果是Windows环境,请使用Env工具,同时请自行处理生成iso的方法。

编译

编译RT-Thread for x86版本,还需要一份支持newlib的工具链,可以通过以下地址获得:

下载后解压,然后配置RTT_EXEC_PATH & RTT_CC_PREFIX 变量

export RTT_EXEC_PATH='/path/to/i686-atxhua-newlib-elf-linux/bin'
export RTT_CC_PREFIX='i686-atxhua-newlib-elf-'

rtconfig.py

if  CROSS_TOOL == 'gcc':
    PLATFORM    = 'gcc'
    EXEC_PATH   = os.getenv('RTT_EXEC_PATH') or 'E:/Program Files/CodeSourcery/Sourcery_CodeBench_Lite_for_IA32_ELF/bin'

if PLATFORM == 'gcc':
    # toolchains
    PREFIX = os.getenv('RTT_CC_PREFIX') or 'i386-unknown-elf-'

然后在x86 bsp目录下执行scons命令来编译:

scons

配置

RT-Thread for x86的版本也支持menuconfig的配置方式,在Linux下可以使用scons --menuconfig的方式进行配置。

因为menuconfig是一份字符界面的配置(Kconfig),在ubuntu下需要安装ncurses5的库

sudo apt install libncurses5-dev

运行

在ubuntu下运行,请确保你安装了qemu-system-i386grub 以及 xorriso软件包:

sudo apt install qemu-system-x86 grub-common xorriso

然后使用qemu来模拟执行

$ qemu-system-i386 -M pc -kernel rtthread.elf -nographic

SeaBIOS (version 1.16.3-debian-1.16.3-2)


iPXE (https://ipxe.org) 00:03.0 CA00 PCI2.10 PnP PMM+06FCAE00+06F0AE00 CA00
                                                                               


Booting from ROM..
 \ | /
- RT -     Thread Operating System
 / | \     5.3.0 build May 10 2026 21:25:36
 2006 - 2024 Copyright by RT-Thread team
Floppy Inc : NEC765B controller  Floppy Type : 2.88MB
[I/DBG] root filesystem mounted.
hello!
msh />

在qemu下可以按Ctrl-A + X退出qemu。