rt-thread-official/bsp/x86
BernardXiong 13fb026934 [BSP] Add README.md in x86 2021-08-22 07:10:40 +08:00
..
applications [BSP] add dbg/run.sh script for x86 2021-08-22 07:03:16 +08:00
drivers [x86][drivers] auto formatted 2021-03-12 10:22:45 +08:00
root/boot/grub [BSP] add dbg/run.sh script for x86 2021-08-22 07:03:16 +08:00
.config [BSP] add dbg/run.sh script for x86 2021-08-22 07:03:16 +08:00
Kconfig [bsp][x86] update x86 with Kconfig and newlib toolchains. 2021-02-19 23:55:17 +08:00
README.md [BSP] Add README.md in x86 2021-08-22 07:10:40 +08:00
SConscript [bsp][x86] update x86 with Kconfig and newlib toolchains. 2021-02-19 23:55:17 +08:00
SConstruct [add] default environment 2019-10-22 16:48:57 +08:00
dbg.sh [BSP] add dbg/run.sh script for x86 2021-08-22 07:03:16 +08:00
rtconfig.h [BSP] add dbg/run.sh script for x86 2021-08-22 07:03:16 +08:00
rtconfig.py [BSP] add dbg/run.sh script for x86 2021-08-22 07:03:16 +08:00
run.sh [BSP] add dbg/run.sh script for x86 2021-08-22 07:03:16 +08:00
x86_ram.lds [bsp][x86] update x86 with Kconfig and newlib toolchains. 2021-02-19 23:55:17 +08:00

README.md

RT-Thread for x86

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

编译

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

*i386-unknown-elf_for_x86_64-pc-linux-gnu_latest.tar.bz2

下载后解压然后在rtconfig.py中配置其中的EXEC_PATH变量

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'

然后在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

然后执行./run.sh命令可以使用qemu来模拟执行(它也会生成可启动的iso文件)

~/workspace/rt-thread/bsp/x86$ ./run.sh
xorriso 1.4.8 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev 'stdio:bootable.iso'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data,  135g free
Added to ISO image: directory '/'='/tmp/grub.uLz91i'
xorriso : UPDATE : 578 files added in 1 seconds
Added to ISO image: directory '/'='/home/bernard/workspace/rt-thread/bsp/x86/root'
xorriso : UPDATE : 582 files added in 1 seconds
xorriso : NOTE : Copying to System Area: 512 bytes from file '/usr/lib/grub/i386-pc/boot_hybrid.img'
ISO image produced: 6007 sectors
Written to medium : 6007 sectors at LBA 0
Writing to 'stdio:bootable.iso' completed successfully.


 \ | /
- RT -     Thread Operating System
 / | \     4.0.4 build Aug 22 2021
 2006 - 2021 Copyright by rt-thread team
Floppy Inc : NEC765B controller  Floppy Type : 2.88MB
hello!
msh />

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