Difference: CmsisRtos (3 vs. 4)

Revision 42020-04-10 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
%DASHBOARD{ section="banner"
Line: 9 to 9
 

Why a Preemptive Real Time Operating System?

Changed:
<
<
Forth systems traditionally make use of cooperative multitasking. It is very simple and clever. But it has its limits. If you write all your software by yourself, each software part can be cooperative. But if you want to benefit from middleware written by somebody else, you can be sure that software is not cooperative (in the context of multitasking). Forth wants to rule your system. I would like to have a Forth system that is cooperative. It should extend the system, to make it interactive and easy to use. The Forth itself is only a thread and can be used as some sort of CLI for testing purposes or could be the main part of the application.
>
>
Forth systems traditionally make use of cooperative multitasking. It is very simple and clever. But it has its limits. If you write all your software by yourself, each software part can be cooperative. But if you want to benefit from middleware written by somebody else (and most probably not written in Forth), you can be sure that software is not cooperative (in the context of multitasking). Forth wants to rule your system. I would like to have a Forth system that is cooperative. It should extend the system, to make it interactive and easy to use. The Forth itself is only a thread and can be used as some sort of CLI for testing purposes or could be the main part of the application.
 

How to Create a Thread

Line: 33 to 33
  Nothing happens and probably the Forth system hangs. Restart the Forth system with the Reset button SW4.

Changed:
<
<
If you create a new RTOS Thread, CMSIS-RTOS (FreeRTOS) allocate some memory from the heap for the stack and the thread control block. But Forth thread needs another stack, the data stack. The blink-thread runs concurrent to the Forth interpreter and use the same data stack. This cannot work. Each thread must have its own data stack, the thread function can get one with osNewDataStack (see below for the assembler source).
>
>
If you create a new RTOS Thread, CMSIS-RTOS (FreeRTOS) allocate some memory from the heap for the stack and the thread control block. But Forth thread needs another stack, the data stack. The blink-thread runs concurrent to the Forth interpreter and use the same data stack. This cannot work. Each thread must have its own data stack, the thread function can get one with osNewDataStack (see below for the assembler source).
 
: blink-thread  ( -- )

Line: 48 to 48
 ;
Changed:
<
<
osThreadExit is needed to exit the thread, otherwise the Forth system hangs after leaving the thread.
>
>
osThreadExit is needed to exit the thread, otherwise the Forth system hangs after leaving the thread. These threads are very similar to the control tasks described in Starting Forth, Leo Brodie. But without user variables. If a thread wants to use variables and share these variables with other threads, the variables have to be protected by a mutex or a semaphore. Anyway variables have to be created by the main Forth thread (terminal task) before.
 
Changed:
<
<
Now you can interactively play with the words osThreadGetId, osThreadGetState, osThreadSuspend, and osThreadResume without the tedious edit-compile-download-run-abort madness.
>
>
Now you can interactively play with the words osThreadGetId, osThreadGetState, osThreadSuspend, and osThreadResume without the tedious edit-compile-download-run-abort.
 


Line: 70 to 70
 
Added:
>
>
A multi-tasking wordset for Standard Forth, Andrew Haley http://www.complang.tuwien.ac.at/anton/euroforth/ef17/papers/haley-slides.pdf
 -- Peter Schmid - 2020-04-07

Comments

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback