EmbeddedRelated.com
Forums
Memfault Beyond the Launch

OS or RTOS Porting

Started by ramumadival July 7, 2009
On Aug 22, 11:23=A0am, "JeffR" <jeffreyram...@e2atechnology.com> wrote:
> >On Aug 17, 8:28=3DA0pm, "JeffR" <jeffreyram...@e2atechnology.com> wrote: > >> >On Jul 8, 8:20=3D3DA0am, scott <swengineer...@gmail.com> wrote: > > >> >> For example I may always want to have a semaphore abstraction that > >> >> allows for the following operations. Keep in mind I did not put > much > >> >> thought into these interfaces, you will have to do that. Your > >> >> application would use these and the API documentation would define > the > >> >> expected behavior of each and for each RTOS ou just have to write > the > >> >> back end code to implement the advertised functionality. If you > think > >> >> about this abstraction layer up front this tends to work out well. > > >> >> sem* semCreate() > >> >> semGet(sem*) > >> >> semGive(sem*) > >> >> semDestroy(sem*) > > >> > =3DA0try =3DA0this one first: > > >> >http://opensource.gsfc.nasa.gov/projects/osal/osal.php > > >> Ah the beauty of POSIX.- Hide quoted text - > > >> - Show quoted text - > > >That assumes that whatever you port to or from implements the POSIX > >interface. Which of course brings up a lot of questions about what do > >you mean by implement POSIX. This can be problematic in my experience. > > Good luck finding an OS that supports an ARM7 derivative with an MMU > *enabled* that doesn't have POSIX.1c support, which includes Pthreads. > What do I mean by POSIX? =A0Do you know how many kernels support at minim=
um
> POSIX.1? =A0Even Windows support POSIX.1c (this is the Pthreads version). > One has way better luck at application portability if one writes to POSIX > (threading, synchronization, queuing, signals, pipes etc) than some > proprietary interface. =A0- Hide quoted text - > > - Show quoted text -
That assumes that the POSIX implementation is correct and works as advertised. I have had problems in the past with a particular OS, which I was required to use, which claimed POSIX support. They certainly offered the required interfaces but when you enabled POSIX you would begin to see strange and hard to debug problems, mostly they had to do with timers. I am simply saying don't expect everything to work as advertised. We did end up abandoning POSIX and writing our own simple interface and all the problems went away and it really did not take much to do it. As far as luck with portabiliity, we had to port it and the effort was minimal. I am not saying POSIX can't be one solution for some but it is not the only way or even in some cases the best way to go.

Memfault Beyond the Launch