Talk about porting

原创 2007年09月13日 14:44:00
I started to use wince, and try to understand the difference between win32 pc platform and the wince mobile platform. In this article I begin to introduce how to refactor your codes in order to make them more reusable and easy porting; first, introduce the general concept and principle; second, I try to take an example to introduce how to porting the win32 pc program into wince (I use Windows Mobile 5 Pocket PC Emulator) program.
The Main concept and principle should be: analyze the code architecture; try split the platform dependent and platform independent code, which contains the “Divide and conquer” philosophy. Try to abstract the platform dependent code into the general INTERFACEs, so that when porting to different platform, you just concern about these INTERFACEs, we just need to implement these INTERFACEs, who can ensure our program work. Note that the platform dependent code could be appeared in the following modules:
a)        Graphic rendering mechanism. If it is a tool, or a utility, and which has GUI, then you need to know which UI framework or library to take, if neither, you maybe manage your GUI module with your own code.
b)        Sound rendering mechanism, maybe you need encapsulate a module especially for sound rendering, I have known about one portable-audio library called portable cross-platform Audio API, currently its latest version is V19, you can reference this link:
c)         Interactive things, such as key, mouse event, etc
d)        Assembly code rewrite if platform’s CPU instruction set is un-compatible
e)        Task/Thread related Interface should be taken care if you want to move you code to a different platform. Task or thread is tightly related with the OS of the platform, but if you want to make the program more reusable to other platform, you could pay more attention to this area, or simply, you can write an OS-Independent Wrapper, maybe you know RTP (Real-time Transport Protocol), and there is a good RTP implementation (Compatible with RFC 3550) called jrtplib, the author is Jori Liesenborgs, who encapsulates the Win32 thread mode and Linux/Unix’s pThread mode into the JThread, which is just a wrapper, simple but effective, anyway, almost erveryone like simple things.

(To be cont...) 

@ 20070913



海南英语111——Part 4:Talking about Work 谈论工作

  1.     A:  What do you do for a living? (你靠什么谋生?/你是干哪一行的)B: I’m a teacher.     (我是一名教师。)2.     A: ...
  • jz1979
  • jz1979
  • 2008年02月20日 15:18
  • 744

tech talk

Gregor Hohpe: All right, well, thanks everybody for coming bright and early. It’s 9 o’clock in Las V...
  • l1j5n
  • l1j5n
  • 2006年06月16日 10:26
  • 1373

利用NVM(Non-Volatile Memory)实现新型数据库系统

1.写在前面本博客的内容是前两篇介绍SCM内存基础与应用的后续,主要结合两篇论文来介绍利用SCM(Storage-Class Memory, 又称NVM)重新实现DBMS(DataBase Manag...
  • Meditator_hkx
  • Meditator_hkx
  • 2016年07月25日 12:52
  • 4026

The best way to improve your listening

What's the best way to improve your listening? In this video, I'm going share with you the techniqu...
  • luckystar_99
  • luckystar_99
  • 2017年09月16日 09:33
  • 321

about porting
  • BoYueJiang
  • BoYueJiang
  • 2013年05月10日 00:12
  • 508


5.更多的变量和打印 在输入更多的变量并且想要将他打印出来的时候。需要使用一个叫做“格式化字符串”的东西每一次使用双引号将一些文本引用起来,就是创建了一个字符串 my_name...
  • u010336793
  • u010336793
  • 2016年03月17日 11:52
  • 218

Android Kernel Porting 的简单总结文档

  Simple Guide for Porting Android Kernel作者:刘旭晖 转载请注明出处
  • colorant
  • colorant
  • 2008年02月27日 16:59
  • 14485

talk about Qt

版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。
  • zzhou2011
  • zzhou2011
  • 2010年11月17日 16:10
  • 384

Linux Kernel Porting CPU 方法概要

Linux Kernel Porting CPU是什么?       Linux kernel发展至今,除了X86,代码包中默认支持很多流行的CPU,arch\arm\下可以看到已支持的ARM 架...
  • u012895903
  • u012895903
  • 2013年11月21日 12:58
  • 1256

Talk About 2.5G And 5G

Network technology is developing rapidly. To keep up with the trend, data centers are required to up...
  • vocanoman
  • vocanoman
  • 2017年10月25日 14:27
  • 99
您举报文章:Talk about porting