diff --git a/bsp/x86/.config b/bsp/x86/.config index b796f37ae5..ca16be0bbd 100644 --- a/bsp/x86/.config +++ b/bsp/x86/.config @@ -23,10 +23,16 @@ CONFIG_IDLE_THREAD_STACK_SIZE=2048 CONFIG_RT_USING_TIMER_SOFT=y CONFIG_RT_TIMER_THREAD_PRIO=4 CONFIG_RT_TIMER_THREAD_STACK_SIZE=2048 + +# +# kservice optimization +# +# CONFIG_RT_KSERVICE_USING_STDLIB is not set +# CONFIG_RT_KSERVICE_USING_TINY_SIZE is not set +# CONFIG_RT_USING_ASM_MEMCPY is not set CONFIG_RT_DEBUG=y CONFIG_RT_DEBUG_COLOR=y -CONFIG_RT_DEBUG_INIT_CONFIG=y -CONFIG_RT_DEBUG_INIT=1 +# CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set # CONFIG_RT_DEBUG_IPC_CONFIG is not set @@ -68,7 +74,8 @@ CONFIG_RT_USING_DEVICE=y CONFIG_RT_USING_CONSOLE=y CONFIG_RT_CONSOLEBUF_SIZE=256 CONFIG_RT_CONSOLE_DEVICE_NAME="console" -CONFIG_RT_VER_NUM=0x40003 +# CONFIG_RT_PRINTF_LONGLONG is not set +CONFIG_RT_VER_NUM=0x40004 # CONFIG_RT_USING_CPU_FFS is not set CONFIG_ARCH_IA32=y # CONFIG_ARCH_CPU_STACK_GROWS_UPWARD is not set @@ -139,8 +146,6 @@ CONFIG_RT_DFS_ELM_REENTRANT=y CONFIG_RT_USING_DFS_DEVFS=y # CONFIG_RT_USING_DFS_ROMFS is not set # CONFIG_RT_USING_DFS_RAMFS is not set -# CONFIG_RT_USING_DFS_UFFS is not set -# CONFIG_RT_USING_DFS_JFFS2 is not set # # Device Drivers @@ -151,6 +156,8 @@ CONFIG_RT_USING_SYSTEM_WORKQUEUE=y CONFIG_RT_SYSTEM_WORKQUEUE_STACKSIZE=2048 CONFIG_RT_SYSTEM_WORKQUEUE_PRIORITY=23 CONFIG_RT_USING_SERIAL=y +CONFIG_RT_USING_SERIAL_V1=y +# CONFIG_RT_USING_SERIAL_V2 is not set CONFIG_RT_SERIAL_USING_DMA=y CONFIG_RT_SERIAL_RB_BUFSZ=64 # CONFIG_RT_USING_CAN is not set @@ -190,6 +197,7 @@ CONFIG_RT_USING_LIBC=y # CONFIG_RT_USING_PTHREADS is not set # CONFIG_RT_USING_POSIX is not set # CONFIG_RT_USING_MODULE is not set +CONFIG_RT_LIBC_DEFAULT_TIMEZONE=8 # # Network @@ -226,6 +234,12 @@ CONFIG_RT_USING_LIBC=y # CONFIG_RT_USING_RYM is not set # CONFIG_RT_USING_ULOG is not set # CONFIG_RT_USING_UTEST is not set +# CONFIG_RT_USING_RT_LINK is not set + +# +# RT-Thread Utestcases +# +# CONFIG_RT_USING_UTESTCASES is not set # # RT-Thread online packages @@ -294,8 +308,6 @@ CONFIG_RT_USING_LIBC=y # CONFIG_PKG_USING_LIBRWS is not set # CONFIG_PKG_USING_TCPSERVER is not set # CONFIG_PKG_USING_PROTOBUF_C is not set -# CONFIG_PKG_USING_ONNX_PARSER is not set -# CONFIG_PKG_USING_ONNX_BACKEND is not set # CONFIG_PKG_USING_DLT645 is not set # CONFIG_PKG_USING_QXWZ is not set # CONFIG_PKG_USING_SMTP_CLIENT is not set @@ -310,6 +322,12 @@ CONFIG_RT_USING_LIBC=y # CONFIG_PKG_USING_BTSTACK is not set # CONFIG_PKG_USING_LORAWAN_ED_STACK is not set # CONFIG_PKG_USING_WAYZ_IOTKIT is not set +# CONFIG_PKG_USING_MAVLINK is not set +# CONFIG_PKG_USING_RAPIDJSON is not set +# CONFIG_PKG_USING_BSAL is not set +# CONFIG_PKG_USING_AGILE_MODBUS is not set +# CONFIG_PKG_USING_AGILE_FTP is not set +# CONFIG_PKG_USING_EMBEDDEDPROTO is not set # # security packages @@ -335,9 +353,12 @@ CONFIG_RT_USING_LIBC=y # CONFIG_PKG_USING_STEMWIN is not set # CONFIG_PKG_USING_WAVPLAYER is not set # CONFIG_PKG_USING_TJPGD is not set +# CONFIG_PKG_USING_PDFGEN is not set # CONFIG_PKG_USING_HELIX is not set # CONFIG_PKG_USING_AZUREGUIX is not set # CONFIG_PKG_USING_TOUCHGFX2RTT is not set +# CONFIG_PKG_USING_NUEMWIN is not set +# CONFIG_PKG_USING_MP3PLAYER is not set # # tools packages @@ -346,6 +367,7 @@ CONFIG_RT_USING_LIBC=y # CONFIG_PKG_USING_EASYFLASH is not set # CONFIG_PKG_USING_EASYLOGGER is not set # CONFIG_PKG_USING_SYSTEMVIEW is not set +# CONFIG_PKG_USING_SEGGER_RTT is not set # CONFIG_PKG_USING_RDB is not set # CONFIG_PKG_USING_QRCODE is not set # CONFIG_PKG_USING_ULOG_EASYFLASH is not set @@ -374,32 +396,23 @@ CONFIG_RT_USING_LIBC=y # CONFIG_PKG_USING_ANV_MEMLEAK is not set # CONFIG_PKG_USING_ANV_TESTSUIT is not set # CONFIG_PKG_USING_ANV_BENCH is not set +# CONFIG_PKG_USING_DEVMEM is not set +# CONFIG_PKG_USING_REGEX is not set +# CONFIG_PKG_USING_MEM_SANDBOX is not set +# CONFIG_PKG_USING_SOLAR_TERMS is not set +# CONFIG_PKG_USING_GAN_ZHI is not set # # system packages # -# CONFIG_PKG_USING_GUIENGINE is not set -# CONFIG_PKG_USING_CAIRO is not set -# CONFIG_PKG_USING_PIXMAN is not set -# CONFIG_PKG_USING_LWEXT4 is not set -# CONFIG_PKG_USING_PARTITION is not set -# CONFIG_PKG_USING_FAL is not set -# CONFIG_PKG_USING_FLASHDB is not set -# CONFIG_PKG_USING_SQLITE is not set -# CONFIG_PKG_USING_RTI is not set -# CONFIG_PKG_USING_LITTLEVGL2RTT is not set -# CONFIG_PKG_USING_CMSIS is not set -# CONFIG_PKG_USING_DFS_YAFFS is not set -# CONFIG_PKG_USING_LITTLEFS is not set -# CONFIG_PKG_USING_THREAD_POOL is not set -# CONFIG_PKG_USING_ROBOTS is not set -# CONFIG_PKG_USING_EV is not set -# CONFIG_PKG_USING_SYSWATCH is not set -# CONFIG_PKG_USING_SYS_LOAD_MONITOR is not set -# CONFIG_PKG_USING_PLCCORE is not set -# CONFIG_PKG_USING_RAMDISK is not set -# CONFIG_PKG_USING_MININI is not set -# CONFIG_PKG_USING_QBOOT is not set + +# +# acceleration: Assembly language or algorithmic acceleration packages +# +# CONFIG_PKG_USING_RT_MEMCPY_CM is not set +# CONFIG_PKG_USING_QFPLIB_M0_FULL is not set +# CONFIG_PKG_USING_QFPLIB_M0_TINY is not set +# CONFIG_PKG_USING_QFPLIB_M3 is not set # # Micrium: Micrium software products porting for RT-Thread @@ -410,14 +423,36 @@ CONFIG_RT_USING_LIBC=y # CONFIG_PKG_USING_UC_CLK is not set # CONFIG_PKG_USING_UC_COMMON is not set # CONFIG_PKG_USING_UC_MODBUS is not set +# CONFIG_PKG_USING_GUIENGINE is not set +# CONFIG_PKG_USING_CAIRO is not set +# CONFIG_PKG_USING_PIXMAN is not set +# CONFIG_PKG_USING_PARTITION is not set +# CONFIG_PKG_USING_FAL is not set +# CONFIG_PKG_USING_FLASHDB is not set +# CONFIG_PKG_USING_SQLITE is not set +# CONFIG_PKG_USING_RTI is not set +# CONFIG_PKG_USING_LITTLEVGL2RTT is not set +# CONFIG_PKG_USING_CMSIS is not set +# CONFIG_PKG_USING_DFS_YAFFS is not set +# CONFIG_PKG_USING_LITTLEFS is not set +# CONFIG_PKG_USING_DFS_JFFS2 is not set +# CONFIG_PKG_USING_DFS_UFFS is not set +# CONFIG_PKG_USING_LWEXT4 is not set +# CONFIG_PKG_USING_THREAD_POOL is not set +# CONFIG_PKG_USING_ROBOTS is not set +# CONFIG_PKG_USING_EV is not set +# CONFIG_PKG_USING_SYSWATCH is not set +# CONFIG_PKG_USING_SYS_LOAD_MONITOR is not set +# CONFIG_PKG_USING_PLCCORE is not set +# CONFIG_PKG_USING_RAMDISK is not set +# CONFIG_PKG_USING_MININI is not set +# CONFIG_PKG_USING_QBOOT is not set # CONFIG_PKG_USING_PPOOL is not set # CONFIG_PKG_USING_OPENAMP is not set # CONFIG_PKG_USING_RT_KPRINTF_THREADSAFE is not set -# CONFIG_PKG_USING_RT_MEMCPY_CM is not set -# CONFIG_PKG_USING_QFPLIB_M0_FULL is not set -# CONFIG_PKG_USING_QFPLIB_M0_TINY is not set -# CONFIG_PKG_USING_QFPLIB_M3 is not set # CONFIG_PKG_USING_LPM is not set +# CONFIG_PKG_USING_TLSF is not set +# CONFIG_PKG_USING_EVENT_RECORDER is not set # # peripheral libraries and drivers @@ -442,7 +477,6 @@ CONFIG_RT_USING_LIBC=y # CONFIG_PKG_USING_WM_LIBRARIES is not set # CONFIG_PKG_USING_KENDRYTE_SDK is not set # CONFIG_PKG_USING_INFRARED is not set -# CONFIG_PKG_USING_ROSSERIAL is not set # CONFIG_PKG_USING_AGILE_BUTTON is not set # CONFIG_PKG_USING_AGILE_LED is not set # CONFIG_PKG_USING_AT24CXX is not set @@ -480,6 +514,28 @@ CONFIG_RT_USING_LIBC=y # CONFIG_PKG_USING_VIRTUAL_SENSOR is not set # CONFIG_PKG_USING_VDEVICE is not set # CONFIG_PKG_USING_SGM706 is not set +# CONFIG_PKG_USING_STM32WB55_SDK is not set +# CONFIG_PKG_USING_RDA58XX is not set +# CONFIG_PKG_USING_LIBNFC is not set +# CONFIG_PKG_USING_MFOC is not set +# CONFIG_PKG_USING_TMC51XX is not set +# CONFIG_PKG_USING_TCA9534 is not set +# CONFIG_PKG_USING_KOBUKI is not set +# CONFIG_PKG_USING_ROSSERIAL is not set +# CONFIG_PKG_USING_MICRO_ROS is not set + +# +# AI packages +# +# CONFIG_PKG_USING_LIBANN is not set +# CONFIG_PKG_USING_NNOM is not set +# CONFIG_PKG_USING_ONNX_BACKEND is not set +# CONFIG_PKG_USING_ONNX_PARSER is not set +# CONFIG_PKG_USING_TENSORFLOWLITEMICRO is not set +# CONFIG_PKG_USING_ELAPACK is not set +# CONFIG_PKG_USING_ULAPACK is not set +# CONFIG_PKG_USING_QUEST is not set +# CONFIG_PKG_USING_NAXOS is not set # # miscellaneous packages @@ -494,6 +550,7 @@ CONFIG_RT_USING_LIBC=y # CONFIG_PKG_USING_FLEXIBLE_BUTTON is not set # CONFIG_PKG_USING_CANFESTIVAL is not set # CONFIG_PKG_USING_ZLIB is not set +# CONFIG_PKG_USING_MINIZIP is not set # CONFIG_PKG_USING_DSTR is not set # CONFIG_PKG_USING_TINYFRAME is not set # CONFIG_PKG_USING_KENDRYTE_DEMO is not set @@ -511,24 +568,21 @@ CONFIG_RT_USING_LIBC=y # CONFIG_PKG_USING_HELLO is not set # CONFIG_PKG_USING_VI is not set # CONFIG_PKG_USING_KI is not set -# CONFIG_PKG_USING_NNOM is not set -# CONFIG_PKG_USING_LIBANN is not set -# CONFIG_PKG_USING_ELAPACK is not set # CONFIG_PKG_USING_ARMv7M_DWT is not set # CONFIG_PKG_USING_VT100 is not set -# CONFIG_PKG_USING_ULAPACK is not set # CONFIG_PKG_USING_UKAL is not set # CONFIG_PKG_USING_CRCLIB is not set # -# games: games run on RT-Thread console +# entertainment: terminal games and other interesting software packages # # CONFIG_PKG_USING_THREES is not set # CONFIG_PKG_USING_2048 is not set # CONFIG_PKG_USING_SNAKE is not set # CONFIG_PKG_USING_TETRIS is not set +# CONFIG_PKG_USING_DONUT is not set +# CONFIG_PKG_USING_ACLOCK is not set # CONFIG_PKG_USING_LWGPS is not set -# CONFIG_PKG_USING_TENSORFLOWLITEMICRO is not set # CONFIG_PKG_USING_STATE_MACHINE is not set # CONFIG_PKG_USING_MCURSES is not set # CONFIG_PKG_USING_COWSAY is not set diff --git a/bsp/x86/README.md b/bsp/x86/README.md new file mode 100644 index 0000000000..12ead6f4d0 --- /dev/null +++ b/bsp/x86/README.md @@ -0,0 +1,73 @@ +# 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](http://117.143.63.254:9012/www/rt-smart/i386-unknown-elf_for_x86_64-pc-linux-gnu_latest.tar.bz2) + +下载后解压,然后在rtconfig.py中配置其中的EXEC_PATH变量 + +```python +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命令来编译: + +```bash +scons +``` + +### 配置 + +RT-Thread for x86的版本也支持menuconfig的配置方式,在Linux下可以使用`scons --menuconfig`的方式进行配置。 + +因为menuconfig是一份字符界面的配置(Kconfig),在ubuntu下需要安装ncurses5的库 + +```bash +sudo apt install libncurses5-dev +``` + +## 运行 + +在ubuntu下运行,请确保你安装了`qemu-system-i386`,`grub` 以及 `xorriso`软件包: + +```bash +sudo apt install qemu-system-x86 grub-common xorriso +``` + +然后执行`./run.sh`命令可以使用qemu来模拟执行(它也会生成可启动的iso文件) + +```bash +~/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。 diff --git a/bsp/x86/applications/mnt.c b/bsp/x86/applications/mnt.c index 3ca04871f8..382acc925e 100644 --- a/bsp/x86/applications/mnt.c +++ b/bsp/x86/applications/mnt.c @@ -11,7 +11,7 @@ extern int rt_floppy_init(void); int mnt_init(void) { - rt_floppy_init(); - - return 0; + return rt_floppy_init(); } +INIT_ENV_EXPORT(mnt_init); + diff --git a/bsp/x86/dbg.sh b/bsp/x86/dbg.sh new file mode 100755 index 0000000000..f1cc7f4154 --- /dev/null +++ b/bsp/x86/dbg.sh @@ -0,0 +1,4 @@ +cp rtthread.elf root +grub-mkrescue -o bootable.iso root + +qemu-system-i386 -cdrom bootable.iso -boot d -nographic -S -s diff --git a/bsp/x86/root/boot/grub/grub.cfg b/bsp/x86/root/boot/grub/grub.cfg new file mode 100644 index 0000000000..4944d26f76 --- /dev/null +++ b/bsp/x86/root/boot/grub/grub.cfg @@ -0,0 +1,7 @@ +set timeout=0 +set default=0 + +menuentry "boot RT-Thread" { + multiboot /rtthread.elf + boot +} diff --git a/bsp/x86/rtconfig.h b/bsp/x86/rtconfig.h index b2a9f6db50..0fe647deca 100644 --- a/bsp/x86/rtconfig.h +++ b/bsp/x86/rtconfig.h @@ -19,10 +19,11 @@ #define RT_USING_TIMER_SOFT #define RT_TIMER_THREAD_PRIO 4 #define RT_TIMER_THREAD_STACK_SIZE 2048 + +/* kservice optimization */ + #define RT_DEBUG #define RT_DEBUG_COLOR -#define RT_DEBUG_INIT_CONFIG -#define RT_DEBUG_INIT 1 /* Inter-Thread communication */ @@ -45,7 +46,7 @@ #define RT_USING_CONSOLE #define RT_CONSOLEBUF_SIZE 256 #define RT_CONSOLE_DEVICE_NAME "console" -#define RT_VER_NUM 0x40003 +#define RT_VER_NUM 0x40004 #define ARCH_IA32 /* RT-Thread Components */ @@ -105,6 +106,7 @@ #define RT_SYSTEM_WORKQUEUE_STACKSIZE 2048 #define RT_SYSTEM_WORKQUEUE_PRIORITY 23 #define RT_USING_SERIAL +#define RT_USING_SERIAL_V1 #define RT_SERIAL_USING_DMA #define RT_SERIAL_RB_BUFSZ 64 #define RT_USING_PIN @@ -115,6 +117,7 @@ /* POSIX layer and C standard library */ #define RT_USING_LIBC +#define RT_LIBC_DEFAULT_TIMEZONE 8 /* Network */ @@ -136,6 +139,9 @@ /* Utilities */ +/* RT-Thread Utestcases */ + + /* RT-Thread online packages */ /* IoT - internet of things */ @@ -166,6 +172,8 @@ /* system packages */ +/* acceleration: Assembly language or algorithmic acceleration packages */ + /* Micrium: Micrium software products porting for RT-Thread */ @@ -173,13 +181,16 @@ /* peripheral libraries and drivers */ +/* AI packages */ + + /* miscellaneous packages */ /* samples: kernel and components samples */ -/* games: games run on RT-Thread console */ +/* entertainment: terminal games and other interesting software packages */ #define IA32 diff --git a/bsp/x86/rtconfig.py b/bsp/x86/rtconfig.py index a03f44c39c..2bc85b0151 100644 --- a/bsp/x86/rtconfig.py +++ b/bsp/x86/rtconfig.py @@ -3,36 +3,23 @@ import os # toolchains options ARCH='ia32' CPU='' -CROSS_TOOL='gcc' - -if os.getenv('RTT_CC'): - CROSS_TOOL = os.getenv('RTT_CC') +CROSS_TOOL= os.getenv('RTT_CC') or 'gcc' # cross_tool provides the cross compiler # EXEC_PATH is the compiler execute path, for example, CodeSourcery, if CROSS_TOOL == 'gcc': PLATFORM = 'gcc' - EXEC_PATH = 'E:/Program Files/CodeSourcery/Sourcery_CodeBench_Lite_for_IA32_ELF/bin' -elif CROSS_TOOL == 'keil': - print('================ERROR============================') - print('Not support keil yet!') - print('=================================================') + EXEC_PATH = os.getenv('RTT_EXEC_PATH') or 'E:/Program Files/CodeSourcery/Sourcery_CodeBench_Lite_for_IA32_ELF/bin' +else: + print('Unknown toolchains, only support GCC') exit(0) -elif CROSS_TOOL == 'iar': - print('================ERROR============================') - print('Not support iar yet!') - print('=================================================') - exit(0) - -if os.getenv('RTT_EXEC_PATH'): - EXEC_PATH = os.getenv('RTT_EXEC_PATH') BUILD = 'debug' if PLATFORM == 'gcc': # toolchains - PREFIX = 'i686-elf-' + PREFIX = 'i386-unknown-elf-' CC = PREFIX + 'gcc' AS = PREFIX + 'gcc' AR = PREFIX + 'ar' diff --git a/bsp/x86/run.sh b/bsp/x86/run.sh new file mode 100755 index 0000000000..76f132dd2a --- /dev/null +++ b/bsp/x86/run.sh @@ -0,0 +1,4 @@ +cp rtthread.elf root +grub-mkrescue -o bootable.iso root + +qemu-system-i386 -cdrom bootable.iso -boot d -nographic diff --git a/bsp/x86/src/extract.sh b/bsp/x86/src/extract.sh deleted file mode 100755 index 89f8baef7a..0000000000 --- a/bsp/x86/src/extract.sh +++ /dev/null @@ -1,28 +0,0 @@ -#! /bin/sh - - -imap=$1 -iout=$2 - -echo "!!! extract symbol from $imap to $iout !!!" - -symlist="rt_kprintf \ -rt_kputs \ -rt_vsprintf \ -rt_sprintf \ -rt_snprintf \ -rt_thread_create \ -" - -echo "#ifndef RT_THREAD_SYM_H_H" > $iout -echo "#define RT_THREAD_SYM_H_H" >> $iout - -for sym in $symlist -do -dlim=`echo $sym | cut -b 1` -addr=`cat $imap | grep $sym | head -n 1 | cut -d $dlim -f 1` - -echo "#define __abs_$sym $addr" >> $iout -done - -echo "#endif /* RT_THREAD_SYM_H_H */" >> $iout diff --git a/bsp/x86/src/hello.c b/bsp/x86/src/hello.c deleted file mode 100644 index b4018617b5..0000000000 --- a/bsp/x86/src/hello.c +++ /dev/null @@ -1,36 +0,0 @@ - -#include -const char* g_str = "Hello World!"; - -static int a = 1234; -int b = 5678; - -extern void rt_kprintf(const char* fmt,...); - -int add(int a, int b) -{ - return a+b; -} - -int main(int argc, char* argv[]) -{ - int i; - char str[32] = "Hello World\n"; - - for(i=0; i - -typedef unsigned int size_t; - -typedef int (*sprintf_fcn_t)(char *buf ,const char *format, ...); -typedef int (*snprintf_fcn_t)(char *buf, size_t size, const char *format, ...); -typedef void (*puts_fcn_t)(const char *str); -typedef void (*printf_fcn_t)(const char *fmt, ...); - -#define printf ((printf_fcn_t)__abs_rt_kprintf) -#define puts ((printf_fcn_t)__abs_rt_kputs) -#define sprintf ((printf_fcn_t)__abs_rt_sprintf) -#define snprintf ((printf_fcn_t)__abs_rt_snprintf) - -#endif