Re:MicroZig: Unified abstraction layer and HAL for Zig on se...
by SV_BubbleTime on Wednesday February 28, 2024 @11:15PM
(#39546352)
Do neither of these languages have better concurrency tools than porting FreeRTOS?
Re:MicroZig: Unified abstraction layer and HAL for Zig on se...
by davidzweig on Thursday February 29, 2024 @06:42AM
(#39548145)
iirc the os needs to have processor specific task switching code in assembly, Freertos must have tons of ports already. Nim supposedly has nice FFI for C. The niceness of freertos is then mostly about it's.. system call design. If it's good, then you could probably progressively rewrite freertos in nim.
Never used nim and been a while since I did any embedded.
Re:MicroZig: Unified abstraction layer and HAL for Zig on se...
by bsder on Thursday February 29, 2024 @03:09PM
(#39554382)
OS is not the same level of abstraction as a language.
This is an active problem in embedded. Cheap microcontrollers can have multiple cores that are not even the same architecture.
This means that just to get "blinky" running, you need to choose a (language, OS) tuple. And, given that "language" is generally "C", that means that your abstraction choices for OS are lousy.
Side question: last I checked, FreeRTOS didn't do a great job when multiple microcontrollers were involved--especially if the communication channels or synchronization were hardware-based. Has this changed?
I’m currently in the process of writing a nice HAL/dev framework agnostic FreeRTOS binding in Nim, which maybe you’ll find useful once we can post it?