osal-layer for Linux/POSIX?

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
Post Reply
marvin2k
Posts: 4
Joined: Tue Apr 14, 2015 2:16 pm

osal-layer for Linux/POSIX?

Post by marvin2k »

Hi,

I wrote a rather complex multithreaded solution for my existing problem on a STM32F4. Works so far, is debugged and seems to be robust.

Now I need the same functionality for my Linux-System. Would be a shame to reimplement the structure for Linux/POSIX again -- and maintain two codebases. Are there plans to provide an osal-port dealing with Linux?

I would volunteer for a proof-of-concept. If I find the time -- read: I'm sorry, but I have no time in the moment... ;-)

Still, I would like to throw in the idea and ask what others think about it?

Greetings
marvin
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: osal-layer for Linux/POSIX?

Post by Giovanni »

It is not very clear, you need the OSAL in order to use the HAL on Linux?

That would work only for kernel threads, user space processes would not see it directly.

Or maybe you are thinking of some kind of user space simulator?

Giovanni
marvin2k
Posts: 4
Joined: Tue Apr 14, 2015 2:16 pm

Re: osal-layer for Linux/POSIX?

Post by marvin2k »

Yes, I wanna use the HAL layer on Linux. No simulation, direct execution: Read/Write from /dev/ttyUSB?, mutex, counting semaphores, userspace threads.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: osal-layer for Linux/POSIX?

Post by Giovanni »

If the HAL is in kernel space then I see complex make user space threads use it vor a variety of reasons, for example and not limited to: critical zones, callbacks.

Kernel space threads could use it.

Giovanni
marvin2k
Posts: 4
Joined: Tue Apr 14, 2015 2:16 pm

Re: osal-layer for Linux/POSIX?

Post by marvin2k »

Why?

Creating functions with the OSAL api which wrapping the POSIX mutex and semaphores shouldn't be that hard. Writing some wrapper-code to abstract read/write/open/close on a filedescriptor into something like "channel" should also not be hard. And creating something similar to pthread...? This solution would leave the scheduling to the Linux Kernel...
Post Reply