Best operating system abstraction?

I'm looking for something to divert the standard operating system functionality in C / C ++: span / kill the thread, send / receive a message, start / stop a timer, maybe even memory management, although I can probably handle this myself with my own buffer pool.

I want to be able to develop and unit test on Linux / windows and then recompile c / C ++ code for various O / Ses targets (for embedded systems: eCos, FreeRTOS, VxWorks, etc.)

Something like "light" might be best, hopefully just a library, maybe even a collection of macros.

+2


source to share


4 answers


Have you looked over the Boost library ? It has threads, timers, memory management, and a signal library.



The library is not a small download, but most of the library components are header-only implementations (although OS paragraph libraries usually need to be linked) and you should only use what you need.

+6


source


Why don't you directly name only POSIX functions (POSIX1 seems to be all your needs) and set the POSIX level higher than incompatible operating system (reads like Microsoft Windows)?



+2


source


I keep a (long) list of the OS Abstraction Libraries . Hope it helps.

+2


source


I think the incentive is worth a look; it can provide you with the os abstraction, but also compiler independence and much, much more. Of course this requires C ++. Other options: Posix.

On your list:
eCos, VxWorks, Linux: good posix support so you can use that. freertos: see link

Windows doesn't have good posix support out of the box (see wikipedia Posix ) If cygwin is ok for you, you can use it. If you have to mix with Visual Studio, a library like boost seems more interesting (you take your mind off of it)

0


source







All Articles