views:

227

answers:

6

I have an existing codebase targeting a Windows environment and with an eye to the future, would like to make this as cross platform as possible. I've had some sucess with standard Linux distributions by using cross platform libraries but would like to extend this to Realtime and or embedded operating systems.

Would it be possible to port the majority of the codebase to such systems, or would it require reimplentations targeted to that environment? If parts need to be recreated, does development for these systems require a different type of design approach? Some vendors supply their own IDE's for development, are these a necessity or can we or is it possible to standardise on a GNU toolchain type build process?

A potential pothole could be differences in IPC handling but without further exposure it is difficult to get a handle on the specifics.

NB although Windows based presently, there is not particularly heavy use of the Win32 API (mainly COM) or Windows types.

Thanks

edit:: the codebase is C\C++

+1  A: 

If the app is mostly C and posix then it isn't too hard. Embedded platforms today can mean an almost full copy of XP or Linux running on a compact flash card.

For the gui both QT and WX have embedded versions which draw the widgets directly.

Martin Beckett
A: 

Depends on the capabilities of your embedded platform. If it's an 8-bit, you've got a hard road ahead but if it's 32 bit with decent RAM and such, there are a lot of open source cross-platform libraries available.

I used DirectFB for my last embedded GUI app, it was lightweight and OK but not cross-platform. Next time I think I'll try out wxWidgets.

Adam Pierce
A: 

I don't like using GNU dev tools on Windows since MS Dev Studio is sooo much nicer than any GNU tools but recently I've been playing with Wascana Desktop Developer which is based on Eclipse and GCC and it shows promise.

Adam Pierce
+1  A: 

If you are using the windows COM interface (I assume you're not talking about serial port here, but the Common Object Model), your code might need to be abstracted away from that.

As you talk about IPC, then obviously this is a multi-tasking/multi-processing type code base. With that being the case, you will have to somehow come up with a way to deal with the environment difference.

First of all, you will need some kind of RTOS since your application is multi-tasking. As you did a port to Linux, you might want to look into using a version of real-time Linux. This would minimize the number of ports you would have to do.

If you don't want to use Linux as your embedded platform, make your code POSIX compliant (Linux is) and make sure that the RTOS you choose support POSIX. This way, the port to Linux and the embedded platform would be mostly the same.

Bottom line, COM will be your albatros.

Since you don't mention the use of a GUI, we won't address that can of worms :)

Benoit
A: 

The most important step is to separate all OS dependence functions from the project logic.

After you do that, you will see immediately how much code you have to port for migration to new OS, and you will be able to start porting nicely.

landmn
A: 

If you're in the position of specifying which realtime/embedded OS you use, have you considered Windows CE?

Mike Dimmick