Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
模拟器_simulator
[讨论贴] RT-Thread的模拟器实现(posix version running on linux)
发布于 2013-01-07 00:28:46 浏览:11662
订阅该版
1. 谁在做模拟器? 目前已经有了一个windows上的RTT模拟器,它叫simulator,在bsp/simulator下。目前只能使用visual studio编译,运行于windows平台。这个模拟器相对来说比较稳定,也已经支持了一部分RTT组件,但依然还有很多可以做的工作。 有不少网友希望开发一个linux下的RTT模拟器,即simulator的linux版本,其实这方面的工作很早之前就已经有人探索过了,参见 论坛网友parai的帖子:rtThread-posix [http://www.rt-thread.org/phpBB3/viewtopic.php?t=1719](http://www.rt-thread.org/phpBB3/viewtopic.php?t=1719) 这个只是内核的移植,并且还有一些bug,后来parai的兴趣转向其他方向,所以这个工作就荒废了,不过现在有另外一位网友 wizardxbl准备接手这个工作,感谢wizardxbl的热心参与。 2. 他山之石可以攻玉 其实这两份RTT模拟器的内核实现应该都来自对FreeRTOS的模拟器实现的参考,所以我提供一些FreeRTOS模拟器的资料,以飨读者。 1) FreeRTOS 的linux上的模拟器实现(有源码) 帖子地址: [http://www.freertos.org/FreeRTOS-simulator-for-Linux.html](http://www.freertos.org/FreeRTOS-simulator-for-Linux.html) 在这篇帖子中,给出了大致的说明,并给出了模拟器源码,注意在帖子的最后页说明了这个模拟器存在的问题,所以需要仔细阅读。 源码包我放在这里,大家可以直接下载: [attachment=-1] 2)[论文一篇 PDF文件] 一种符合POSIX规范的FreeRTOS模拟器的设计与实现 [attach]0[/attach] 3. 模拟器开发涉及哪些工作 关于模拟器开发涉及到的功能和组件,包括: 0. 稳定的内核 [必须] 1. 串口模拟+finsh组件 2. DFS+SD卡,nand flash,nor flash,以及各个文件系统的支持 3. RTGUI支持 4. LWIP 5. APP module支持 4. 如何开发? 现在RTT的源码已经全面转向github,这个模拟器的开发也可以放在github上进行。放置于github上也有利于其他感兴趣的同学一起参与。(我看到grissiom兄在wizardxbl帖子里提及,所以这里算是引用grissiom的建议 [s:158] )。
下载附件 [Posix_GCC_Simulator_6.0.4.zip](https://oss-club.rt-thread.org/uploads/3230_4e81ef83eabcd6f08e1f3fe5491825f5.zip)
下载附件[一种符合POSIX规范的FreeRTOS模拟器的设计与实现.pdf]
下载附件[posix.7z]
下载附件 [simlinux.7z](https://oss-club.rt-thread.org/uploads/3230_ada2f7a3abc95c5ac32b1ab53403e719.7z)
查看更多
18
个回答
默认排序
按发布时间排序
wizardxbl
2013-01-07
这家伙很懒,什么也没写!
目前我发现的情况是 `rt_system_scheduler_start()`开始之后 线程切换`test1->test2->tidle` 然后就一直停在`tidle`了 前面是根据线程优先级从高优先级到低优先级进行的。
prife
2013-01-10
这家伙很懒,什么也没写!
贴一个我写pthread测试程序,可以实现任意`suspend/resume`一个线程。 程序的效果: 主线程中创建多个pthead线程,一开始,所有的线程都被挂起(就像RTT中一样,每个被创建的线程一开始都是被挂起的,`rt_scheduler`才会真正将其调度运行) 按下CTRL+C键,可以会启动第一个创建的线程,再次按CTRL+C键就会阻塞这个线程,然后循环。 这个程序其实就是一个最简单的RTT内核的thread_switch过程的模拟。 ```c #include
#include
#include
#include
#include
#include
#define TRACE printf //#define TRACE(...) #define NUM_THREADS 2 typedef struct _thread { pthread_t pthread; void (*task) (void *); void * para; void (*exit) (void); sem_t sem; } thread_t; static thread_t thread_table[NUM_THREADS]; #define THREAD_T(thread) ((thread_t *)thread) #define MSG_SUSPEND SIGUSR1 /* #define MSG_RESUME SIGUSR2 */ static void mainthread_signal_handler(int sig) { static int i; pthread_t tid; tid = pthread_self(); TRACE("thread <%x>! signal <%d> ", (unsigned int)tid, sig); i = 1-i; if (i) { /* resume the thread */ sem_post(&thread_table[0].sem); } else { /* suspend the thread */ pthread_kill(thread_table[0].pthread, MSG_SUSPEND); } } static void thread_switch_handler(int sig) { if (sig == MSG_SUSPEND) { sem_wait(&thread_table[0].sem); } } static void * thread_run(void * parameter) { //rt_thread_t tid; thread_t * thread; //tid = rt_thread_self(); thread = THREAD_T(parameter); TRACE("<%x> stop on sem... ", (unsigned int)thread->pthread); sem_wait(&thread->sem); TRACE(" <%x> starts running... ", (unsigned int)thread->pthread); thread->task(thread->para); TRACE(" <%x> exit... ", (unsigned int)thread->pthread); thread->exit(); sem_destroy(&thread->sem); pthread_exit(NULL); } static int thread_create( thread_t * thread, void *task, void *parameter, void *pexit) { int res; pthread_attr_t attr; //thread_t * thread = THREAD_T(pt); thread->task = task; thread->para = parameter; thread->exit = pexit; signal_install(MSG_SUSPEND, thread_switch_handler); if (sem_init(&thread->sem, 0, 0) != 0) { printf("init thread->sem failed, exit "); exit(EXIT_FAILURE); } /* No need to join the threads. */ pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); /* create a posix thread */ res = pthread_create(&thread->pthread, &attr, &thread_run, (void *)thread); if (res) { printf("pthread create faild, <%d> ", res); exit(EXIT_FAILURE); } } int signal_install(int sig, void (*func)(int)) { struct sigaction act; /* set the signal handler */ act.sa_handler = func ; sigemptyset(&act.sa_mask); act.sa_flags = 0; sigaction(sig, &act, 0); } static void *PrintHello(void *para) { pthread_t tid; tid = pthread_self(); for(;;) { printf("thread <%x>! Hello, world! ", (unsigned int)tid); sleep(1); //delay(1); } } static void *threadexit() { pthread_t tid; tid = pthread_self(); printf("thread <%x>! I'm leaving. ", (unsigned int)tid); } int main (int argc, char *argv[]) { int t; pthread_t tid; /* install signal handler of main thread */ signal_install(SIGINT, mainthread_signal_handler); /* just output the main thread's id */ tid = pthread_self(); printf("main thread <%x>! ", (unsigned int)tid); for(t=0; t
! main: thread b7541b40 created
stop on sem... main: thread b6d40b40 created
stop on sem... ^Cthread
! signal <2>
starts running... thread
! Hello, world! thread
! Hello, world! ^Cthread
! signal <2> ^Cthread
! signal <2> thread
! Hello, world! thread
! Hello, world! thread
! Hello, world! thread
! Hello, world! ^Cthread
! signal <2> ^Cthread
! signal <2> thread
! Hello, world! thread
! Hello, world! thread
! Hello, world! ^Cthread
! signal <2> ^Cthread
! signal <2> thread
! Hello, world! thread
! Hello, world! thread
! Hello, world! thread
! Hello, world! ^Cthread
! signal <2> ^退出 (核心已转储) ``` 参考资料: - https://computing.llnl.gov/tutorials/pthreads/ - http://cursuri.cs.pub.ro/~apc/2003/resources/pthreads/uguide/document.htm - Beginning Linux Programming, Ed4, 第11章,第12章 - http://bbs.csdn.net/topics/350025031
aozima
2013-01-10
调网络不抓包,调I2C等时序不上逻辑分析仪,就像电工不用万用表!多用整理的好的文字,比截图更省流量,还能在整理过程中思考。
前排。。学习。
wizardxbl
2013-01-11
这家伙很懒,什么也没写!
与RTT内核相关的函数总共有6个 ``` rt_hw_stack_init() rt_hw_interrupt_disable() rt_hw_interrupt_enable() rt_hw_context_switch_to() rt_hw_context_switch() rt_hw_context_switch_interrupt() ``` 这里面分为4类函数 1 系统启动阶段 初始化阶段,每当建立一个rtt线程,就会调用rt_hw_stack_init()函数一次 2 系统开始调度阶段 调用rt_hw_context_switch_to()函数一次,以后不再调用,这个函数完成底部的线程第一次切换 3 调度器工作阶段 `rt_hw_context_switch()` `rt_hw_context_switch_interrupt()` 这两个函数调用,并且前期`rt_hw_context_switch()`函数被调用,后期`rt_hw_context_switch_interrupt()`函数被调用 4 其他 `rt_hw_interrupt_disable()` `rt_hw_interrupt_enable()` 这两个函数的具体功能我还说不好
prife
2013-01-12
这家伙很懒,什么也没写!
rt_hw_stack_init() rt_hw_context_switch_to() 以下两个函数效果一样。在支持硬件终端嵌套时,如果存在中断嵌套,就执行 switch_interrupt..模拟器上不会出现这种情况,所以这两个函数实现可以一致。 rt_hw_context_switch() rt_hw_context_switch_interrupt() 这两个函数是用来关中断,参考simulator for win32的设计,中断模拟执行是在主线程for循环代码。在windows版本中,使用wait multi object 实现,在linux上可以使用 pthread_mutex + phtread_cond(即互斥锁和条件变量),不过需要注意,pthread_mutex_init默认创建出来的互斥锁是NORMAL型,不支持递归。因为rt_hw_interrupt_disable在rtt中存在嵌套调用的情况,如果mutex不支持递归,则会导致deadlock)。因此需要设置mutex的为递归型mutex. rt_hw_interrupt_disable() rt_hw_interrupt_enable() 今天调了一天simulator for linux(非parai的内核代码,而是simulator win32的linux移植版本,参见附件)的内核移植代码。需要多运行几次,大部分时候会都爆段错误,不过偶尔可以正常运行实习线程切换及推退出后调用rt_thread_exit切换其他线程。原因就在于这种实现方式要求主进程(mainthread_schedulor所在的线程)的优先级比普通rtt线程高。但是在linux中,普通权限模式下创建的多线程程序的调度算法只能选择SCHED_OTHER模式,这种模式,多个线程的优先级相同。这就是导致段错误的元凶。 所以现在就有两个显然的思路: 1. 修改simulator linux的内核移植代码,修改线程调度模式,指定主线程优先级高于普通线程优先级,这样编译生成的模拟器需要使用sudo启动才行。 2. 修改simulator linux的实现机制。使之可以不依赖各个线程的优先级别即可实现稳定调度。 [attach]1707[/attach] [attach]1708[/attach]
grissiom
2013-01-13
这家伙很懒,什么也没写!
感觉上,还是不要依赖通用操作系统的优先级吧,这东西应该不靠谱…… 请教下,POSIX thread 里,signal 是 per thread 的么?每个 thread 有自己的信号处理函数?
prife
2013-01-14
这家伙很懒,什么也没写!
>感觉上,还是不要依赖通用操作系统的优先级吧,这东西应该不靠谱…… > >请教下,POSIX thread 里,signal 是 per thread 的么?每个 thread 有自己的信号处理函数? 是啊,方法1不靠谱,我这边改了优先级也不行。方法2已经调试成功了。代码已经推送到github上了。 https://github.com/prife/rt-thread/commits/simposix 线程共享信号处理函数的。
wizardxbl
2013-01-14
这家伙很懒,什么也没写!
`[32m` 这种符号是在终端里调试方便加的颜色代码 ``` [32min rt_hw_board_init [0m[32min rt_hw_serial_init [0m[32mout rt_hw_serial_init [0m[32min rt_hw_serial_register [0m[32mout rt_hw_serial_register [0m[32min rt_serial_init [0m[32mout rt_serial_init [0m[32min rt_serial_open [0m[32mout rt_serial_open [0m[32mout rt_hw_board_init [0m-------------rt_show_version();38-------------- | / - RT - Thread Operating System / | 1.1.0 build Jan 10 2013 2006 - 2012 Copyright by rt-thread team -------------rt_system_tick_init()45-------------- -------------rt_system_object_init();51-------------- -------------rt_system_timer_init();57-------------- -------------rt_system_heap_init();63-------------- -------------rt_system_scheduler_init();71-------------- -------------rt_device_init_all();77-------------- -------------rt_application_init();84-------------- [32min rt_thread_create [0m[33m------------------ |-name |init |-entry |0x401995 (function address) |-parameter |(null) |-stack_size|0x800 |-priority |10 |-tick |20 ------------------ [0m[33m------------------ |-thread |0x629278(rt_object_allocate->thread) |-sizeof(thread) |0x8 |-sizeof(rt_thread) |0xf0 ------------------ [0m[33m------------------ |-stack_start |0x629380(rt_malloc(stack_size)->stack_start) ------------------ [0m-->in _rt_thread_init [init] [33m------------------ |-thread |0x629278 |-name |init |-entry |0x401995 |-parameter |(null) |-stack_start |0x629380 |-stack_size |0x800 |-priority |10 |-tick |20 ------------------ [0m[32mthread->stack_addr:0x6292c0 (addr) [0m[32mthread->stack_addr:0x629380 (data) [0mwill call rt_hw_stack_init [32m------------------ |-thread->sp |0x629b2c ------------------ [0m<--out _rt_thread_init [init] [32min rt_thread_create [0mwill rt_thread_startup(0x629278) in rt_thread_startup(0x629278) [32min rt_thread_resume [0m[32mout rt_thread_resume [0m-----finish creat init and startup----------------------------------------------- [32min rt_thread_create [0m[33m------------------ |-name |test1 |-entry |0x4019cb (function address) |-parameter |(null) |-stack_size|0x800 |-priority |10 |-tick |20 ------------------ [0m[33m------------------ |-thread |0x629b98(rt_object_allocate->thread) |-sizeof(thread) |0x8 |-sizeof(rt_thread) |0xf0 ------------------ [0mpid <9868a700> stop on sem... [33m------------------ |-stack_start |0x629ca0(rt_malloc(stack_size)->stack_start) ------------------ [0m-->in _rt_thread_init [test1] [33m------------------ |-thread |0x629b98 |-name |test1 |-entry |0x4019cb |-parameter |(null) |-stack_start |0x629ca0 |-stack_size |0x800 |-priority |10 |-tick |20 ------------------ [0m[32mthread->stack_addr:0x629be0 (addr) [0m[32mthread->stack_addr:0x629ca0 (data) [0mwill call rt_hw_stack_init [32m------------------ |-thread->sp |0x62a44c ------------------ [0m<--out _rt_thread_init [test1] [32min rt_thread_create [0mwill rt_thread_startup(0x629b98) pid <97e89700> stop on sem... in rt_thread_startup(0x629b98) [32min rt_thread_resume [0m[32mout rt_thread_resume [0m-----finish create test1 and startup----------------------------------------------- [32min rt_thread_create [0m[33m------------------ |-name |test2 |-entry |0x401a28 (function address) |-parameter |(null) |-stack_size|0x800 |-priority |20 |-tick |20 ------------------ [0m[33m------------------ |-thread |0x62a4b8(rt_object_allocate->thread) |-sizeof(thread) |0x8 |-sizeof(rt_thread) |0xf0 ------------------ [0m[33m------------------ |-stack_start |0x62a5c0(rt_malloc(stack_size)->stack_start) ------------------ [0m-->in _rt_thread_init [test2] [33m------------------ |-thread |0x62a4b8 |-name |test2 |-entry |0x401a28 |-parameter |(null) |-stack_start |0x62a5c0 |-stack_size |0x800 |-priority |20 |-tick |20 ------------------ [0m[32mthread->stack_addr:0x62a500 (addr) [0m[32mthread->stack_addr:0x62a5c0 (data) [0mwill call rt_hw_stack_init [32m------------------ |-thread->sp |0x62ad6c ------------------ [0mpid <97688700> stop on sem... <--out _rt_thread_init [test2] [32min rt_thread_create [0mwill rt_thread_startup(0x62a4b8) in rt_thread_startup(0x62a4b8) [32min rt_thread_resume [0m[32mout rt_thread_resume [0m------finish craete test2 and startup---------------------------------------------- -------------rt_system_timer_thread_init();90-------------- [32min rt_thread_init[timer] [0mthread[0x68d5e0] struct rt_thread[0x8] [32mout rt_thread_init [0m-->in _rt_thread_init [timer] [33m------------------ |-thread |0x68d5e0 |-name |timer |-entry |0x406566 |-parameter |(null) |-stack_start |0x68d6d0 |-stack_size |0x200 |-priority |4 |-tick |10 ------------------ [0m[32mthread->stack_addr:0x68d628 (addr) [0m[32mthread->stack_addr:0x68d6d0 (data) [0mwill call rt_hw_stack_init [32m------------------ |-thread->sp |0x68d87c ------------------ [0mpid <96e87700> stop on sem... <--out _rt_thread_init [timer] in rt_thread_startup(0x68d5e0) [32min rt_thread_resume [0m[32mout rt_thread_resume [0m-------------rt_thread_idle_init();96-------------- [32min rt_thread_init[tidle] [0mthread[0x68d280] struct rt_thread[0x8] [32mout rt_thread_init [0m-->in _rt_thread_init [tidle] [33m------------------ |-thread |0x68d280 |-name |tidle |-entry |0x4022e2 |-parameter |(null) |-stack_start |0x68d370 |-stack_size |0x100 |-priority |31 |-tick |32 ------------------ [0m[32mthread->stack_addr:0x68d2c8 (addr) [0m[32mthread->stack_addr:0x68d370 (data) [0mwill call rt_hw_stack_init [32m------------------ |-thread->sp |0x68d41c ------------------ [0m<--out _rt_thread_init [tidle] in rt_thread_startup(0x68d280) [32min rt_thread_resume [0m[32mout rt_thread_resume [0mpid <96686700> stop on sem... -------------rt_system_scheduler_start();102-------------- in rt_system_scheduler_start() rt_thread_ready_priority_group = 0x80100410 number = 4 highest_ready_priority = 4 [33m------------------ |-name | timer ------------------- [0mpid <990af700> mainthread start system tick! pid <96e87700> tid
starts... [42;37min rt_thread_timer_entry[0m[32m [0m[32min rt_thread_suspend [0m[33mthread suspend: timer [0m[32mout rt_thread_suspend [0m[36m----->in rt_schedule [0m[36mrt_scheduler_lock_nest:0 [0m[36m[0]switch from priority#10 thread:timer [0m[36m[0]switch to priority#10 thread:init [0m[32min _rt_scheduler_stack_check [0m[32mout _rt_scheduler_stack_check [0m[36mfrome_thread->sp:0x68d87c [0m[36mto_thread->sp:0x629b2c [0mconswitch: P in pid<96e87700> ,suspend
, resume <(null)>! pid <9868a700> tid
starts... in rt_init_thread_entry out rt_init_thread_entry pid <9868a700> tid
exit... [32min rt_thread_exit [0m[36m----->in rt_schedule [0m[36mrt_scheduler_lock_nest:0 [0m[36m[0]switch from priority#10 thread:init [0m[36m[0]switch to priority#10 thread:test1 [0m[32min _rt_scheduler_stack_check [0m[32mout _rt_scheduler_stack_check [0m[36mfrome_thread->sp:0x629b2c [0m[36mto_thread->sp:0x62a44c [0mconswitch: P in pid<9868a700> ,suspend
, resume <(null)>! pid <97e89700> tid
starts... in rt_test1_thread_entry thread-01:0 [32mint rt_thread_sleep [0m[32min rt_thread_suspend [0m[33mthread suspend: test1 [0m[32mout rt_thread_suspend [0m[36m----->in rt_schedule [0m[36mrt_scheduler_lock_nest:0 [0m[36m[0]switch from priority#20 thread:test1 [0m[36m[0]switch to priority#20 thread:test2 [0m[32min _rt_scheduler_stack_check [0m[32mout _rt_scheduler_stack_check [0m[36mfrome_thread->sp:0x62a44c [0m[36mto_thread->sp:0x62ad6c [0mconswitch: P in pid<97e89700> ,suspend
, resume <(null)>! pid <97688700> tid
starts... thread-02:0 [32mint rt_thread_sleep [0m[32min rt_thread_suspend [0m[33mthread suspend: test2 [0m[32mout rt_thread_suspend [0m[36m----->in rt_schedule [0m[36mrt_scheduler_lock_nest:0 [0m[36m[0]switch from priority#31 thread:test2 [0m[36m[0]switch to priority#31 thread:tidle [0m[32min _rt_scheduler_stack_check [0m[32mout _rt_scheduler_stack_check [0m[36mfrome_thread->sp:0x62ad6c [0m[36mto_thread->sp:0x68d41c [0mconswitch: P in pid<97688700> ,suspend
, resume <(null)>! pid <96686700> tid
starts... pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! [32min rt_thread_timeout [0m[32m---->[test2] remove frome suspend list insert to ready list [0m[36m----->in rt_schedule [0m[36mrt_scheduler_lock_nest:0 [0m[36m[1]switch from priority#20 thread:tidle [0m[36m[1]switch to priority#20 thread:test2 [0m[32min _rt_scheduler_stack_check [0m[32mout _rt_scheduler_stack_check [0m[36mswitch in interrupt [0m[36m<-----out rt_schedule [0m[32mout rt_thread_timeout [0m[32min rt_thread_timeout [0m[32m---->[test1] remove frome suspend list insert to ready list [0m[36m----->in rt_schedule [0m[36mrt_scheduler_lock_nest:0 [0m[36m[1]switch from priority#10 thread:test2 [0m[36m[1]switch to priority#10 thread:test1 [0m[32min _rt_scheduler_stack_check [0m[32mout _rt_scheduler_stack_check [0m[36mswitch in interrupt [0m[36m<-----out rt_schedule [0m[32mout rt_thread_timeout [0mconswitch: S in pid<990af700> ,suspend
, resume
! signal: SIGSUSPEND suspend
conswitch: S in pid<990af700> ,suspend
, resume
! isr: systick leave! pid <990af700> signal: SIGALRM leave! [36m<-----out rt_schedule [0m[32mout rt_thread_sleep [0mthread-01:1 [32mint rt_thread_sleep [0m[32min rt_thread_suspend [0m[33mthread suspend: test1 [0m[32mout rt_thread_suspend [0m[36m----->in rt_schedule [0m[36mrt_scheduler_lock_nest:0 [0m[36m[0]switch from priority#20 thread:test1 [0m[36m[0]switch to priority#20 thread:test2 [0m[32min _rt_scheduler_stack_check [0m[32mout _rt_scheduler_stack_check [0m[36mfrome_thread->sp:0x62a44c [0m[36mto_thread->sp:0x62ad6c [0mconswitch: P in pid<97e89700> ,suspend
, resume
! [36m<-----out rt_schedule [0m[32mout rt_thread_sleep [0mthread-01:2 [32mint rt_thread_sleep [0m[32min rt_thread_suspend [0m[33mthread suspend: test2 [0m[32mout rt_thread_suspend [0m[36m----->in rt_schedule [0m[36mrt_scheduler_lock_nest:0 [0m[36m[0]switch from priority#31 thread:test2 [0m[36m[0]switch to priority#31 thread:tidle [0m[32min _rt_scheduler_stack_check [0m[32mout _rt_scheduler_stack_check [0m[36mfrome_thread->sp:0x62ad6c [0m[36mto_thread->sp:0x68d41c [0mconswitch: P in pid<97e89700> ,suspend
, resume
! signal: SIGSUSPEND resume
signal: SIGSUSPEND suspend
pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! [32min rt_thread_timeout [0m[32m---->[test2] remove frome suspend list insert to ready list [0m[36m----->in rt_schedule [0m[36mrt_scheduler_lock_nest:0 [0m[36m[1]switch from priority#20 thread:tidle [0m[36m[1]switch to priority#20 thread:test2 [0m[32min _rt_scheduler_stack_check [0m[32mout _rt_scheduler_stack_check [0m[36mswitch in interrupt [0m[36m<-----out rt_schedule [0m[32mout rt_thread_timeout [0m[32min rt_thread_timeout [0m[32m---->[test1] remove frome suspend list insert to ready list [0m[36m----->in rt_schedule [0m[36mrt_scheduler_lock_nest:0 [0m[36m[1]switch from priority#10 thread:test2 [0m[36m[1]switch to priority#10 thread:test1 [0m[32min _rt_scheduler_stack_check [0m[32mout _rt_scheduler_stack_check [0m[36mswitch in interrupt [0m[36m<-----out rt_schedule [0m[32mout rt_thread_timeout [0mconswitch: S in pid<990af700> ,suspend
, resume
! conswitch: S in pid<990af700> ,suspend
, resume
! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid <990af700> signal: SIGALRM leave! pid <990af700> signal: SIGALRM enter! isr: systick enter! isr: systick leave! ```
wizardxbl
2013-01-15
这家伙很懒,什么也没写!
``` @wizard:~/git/rt-thread/rt-thread-prife/bsp/simlinux$ ./rtthread | / - RT - Thread Operating System / | 1.2.0 build Jan 15 2013 2006 - 2012 Copyright by rt-thread team pid
stop on sem... pid
mainthread pid
stop on sem... start system tick! pid
tid
starts... pid
stop on sem... pid
stop on sem... pid
tid
exit... conswitch: P in pid
,suspend
, resume <(null)>! pid
tid
starts... finsh>>conswitch: P in pid
,suspend
, resume <(null)>! pid
tid
starts... hello, world conswitch: P in pid
,suspend
, resume <(null)>! pid
tid
starts... pid
signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid
signal: SIGALRM leave! pid
signal: SIGALRM enter! isr: systick enter! conswitch: S in pid
,suspend
, resume
! signal: SIGSUSPEND suspend
hello, world isr: systick leave! pid
signal: SIGALRM leave! conswitch: P in pid
,suspend
, resume
! signal: SIGSUSPEND resume
pid
signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid
signal: SIGALRM leave! pid
signal: SIGALRM enter! isr: systick enter! conswitch: S in pid
,suspend
, resume
! isr: systick leave! pid
signal: SIGALRM leave! signal: SIGSUSPEND suspend
hello, world conswitch: P in pid
,suspend
, resume
! signal: SIGSUSPEND resume
conswitch: S in pid
,suspend
, resume
! finsh>>signal: SIGSUSPEND suspend
conswitch: P in pid
,suspend
, resume
! signal: SIGSUSPEND resume
pid
signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid
signal: SIGALRM leave! conswitch: S in pid
,suspend
, resume
! signal: SIGSUSPEND suspend
aconswitch: P in pid
,suspend
, resume
! signal: SIGSUSPEND resume
conswitch: S in pid
,suspend
, resume
! signal: SIGSUSPEND suspend
``` 段错误
wizardxbl
2013-01-15
这家伙很懒,什么也没写!
``` | / - RT - Thread Operating System / | 1.2.0 build Jan 15 2013 2006 - 2012 Copyright by rt-thread team [New Thread 0x7ffff6e37700 (LWP 3839)] pid
stop on sem... [New Thread 0x7ffff6636700 (LWP 3840)] pid
stop on sem... [New Thread 0x7ffff5e35700 (LWP 3841)] pid
mainthread pid
stop on sem... start system tick! pid
tid
starts... [New Thread 0x7ffff5634700 (LWP 3842)] pid
tid
exit... conswitch: P in pid
,suspend
, resume <(null)>! pid
stop on sem... pid
tid
starts... finsh>>conswitch: P in pid
,suspend
, resume <(null)>! pid
tid
starts... hello, world conswitch: P in pid
,suspend
, resume <(null)>! pid
tid
starts... pid
signal: SIGALRM enter! isr: systick enter! isr: systick leave! pid
signal: SIGALRM leave! conswitch: S in pid
,suspend
, resume
! aconswitch: P in pid
,suspend
, resume
! signal: SIGSUSPEND suspend
pid
signal: SIGALRM enter! isr: systick enter! conswitch: S in pid
,suspend
, resume
! isr: systick leave! pid
signal: SIGALRM leave! hello, world conswitch: P in pid
,suspend
, resume
! conswitch: S in pid
,suspend
, resume
! Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7ffff5634700 (LWP 3842)] 0x00000000004117e8 in strcmp (s1=0x0, s2=0x7ffff5633af0 "a") at /home/yangyang/git/rt-thread/rt-thread/components/finsh/shell.c:42 42 /home/yangyang/git/rt-thread/rt-thread/components/finsh/shell.c: 没有那个文件或目录. in /home/yangyang/git/rt-thread/rt-thread/components/finsh/shell.c (gdb) ```
撰写答案
登录
注册新账号
关注者
0
被浏览
11.7k
关于作者
prife
这家伙很懒,什么也没写!
提问
20
回答
550
被采纳
0
关注TA
发私信
相关问题
1
rtthread simulator中能够使用WIN10中得TCP/IP服务吗
2
simulator工程的线程调度存在缺陷,导致程序非常容易崩溃
3
软仿真simulator调试767不能显示输出信息
4
Simulator 编译S_IRUSR这些申明未找到
5
f401-qemu???
6
运行qemu.bat出现'qemu-img' is not recognized
7
rtthread_simulator_v0.1.0 例子 LED
8
simulator 无法产生exe
9
rtt的simulator可以在linux上跑吗?想RTT生态的程序在嵌入式linux跑起来
10
LVGL模拟器VS编译不成功
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
国产MCU移植系列教程汇总,欢迎查看!
4
机器人操作系统 (ROS2) 和 RT-Thread 通信
5
五分钟玩转RT-Thread新社区
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
最新文章
1
使用百度AI助手辅助编写一个rt-thread下的ONVIF设备发现功能的功能代码
2
RT-Thread 发布 EtherKit开源以太网硬件!
3
rt-thread使用cherryusb实现虚拟串口
4
《C++20 图形界面程序:速度与渲染效率的双重优化秘籍》
5
《原子操作:程序世界里的“最小魔法单位”解析》
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
AT
Bootloader
Hardfault
CAN总线
FinSH
ART-Pi
USB
DMA
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
RTC
FAL
rt-smart
ESP8266
I2C_IIC
WIZnet_W5500
ota在线升级
UART
PWM
cubemx
freemodbus
flash
packages_软件包
BSP
潘多拉开发板_Pandora
定时器
ADC
GD32
flashDB
socket
中断
Debug
编译报错
msh
SFUD
keil_MDK
rt_mq_消息队列_msg_queue
at_device
ulog
C++_cpp
本月问答贡献
踩姑娘的小蘑菇
7
个答案
3
次被采纳
张世争
9
个答案
2
次被采纳
rv666
5
个答案
2
次被采纳
a1012112796
13
个答案
1
次被采纳
用户名由3_15位
11
个答案
1
次被采纳
本月文章贡献
程序员阿伟
6
篇文章
2
次点赞
hhart
3
篇文章
4
次点赞
大龄码农
1
篇文章
2
次点赞
ThinkCode
1
篇文章
1
次点赞
Betrayer
1
篇文章
1
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部