计算机科学 ›› 2017, Vol. 44 ›› Issue (11): 64-68.doi: 10.11896/j.issn.1002-137X.2017.11.010

• 2016 年全国软件与应用学术会议 • 上一篇    下一篇

基于语义补丁的Linux驱动程序后向移植技术

朱丽华,文艳军,董威   

  1. 国防科技大学计算机学院 长沙410073,国防科技大学计算机学院 长沙410073,国防科技大学计算机学院 长沙410073
  • 出版日期:2018-12-01 发布日期:2018-12-01
  • 基金资助:
    本文受国家自然科学基金(91318301),国家重点基础研究发展计划(973计划)(2014CB340703)资助

Backporting of Linux Device Drivers Using Semantic Patch

ZHU Li-hua, WEN Yan-jun and DONG Wei   

  • Online:2018-12-01 Published:2018-12-01

摘要: 使用语义补丁技术对Linux的网卡驱动程序的后向移植方法进行研究。通过分析多个不同内核版本的驱动程序代码,在兼容库代码的支持下,提出了一种使用语义补丁进行驱动程序后向移植的方法。针对符号和函数分别开发了语义补丁,解决了后向移植过程中代码冗余以及补丁文件过多的问题,提高了后向移植的效率。实验分析表明,所使用的语义补丁的代码行数比普通补丁减少了很多,使得移植过程更加高效。在后向移植的过程中,对兼容库的构造方法进行了总结,使得移植后的代码可读性更强。所提方法对实现其他驱动程序的后向移植提供了借鉴意义。

关键词: 语义补丁,驱动程序,兼容库,后向移植

Abstract: The paper studied the backporting of network device drivers in Linux kernels using semantic patch technology.After analyzing the code of device drivers in many different kernel versions,this paper proposed an approach to backport device drivers using semantic patch technology with compatibility library.Semantic patches are developed sepa-rately according to symbols and functions, which reduces the redundancy of code and improves the efficiency of backporting.The experiment shows that the lines of code of semantic patches are much less than normal patches.Some experiences about building compatibility library were also proposed in the paper.The results show that this approach is also valuable for backporting other device drivers.

Key words: Semantic patch,Device driver,Compatibility library,Backport

[1] RODRIGUEZ L R,LAWALL J.Increasing Automation in the Backporting of Linux Drivers Using Coccinelle[C]∥ Dependable Computing Conference.2016:132-143.
[2] MACKENZIE D,EGGERT P,STALLMAN R.Comparing and Merging Files With Gnu Diff and Patch.Network Theory Ltd.http://www.gnu.org/software/diffutils/manual/html_node/Unified-Format.html.
[3] MULLER G,PADIOLEAU Y,LAWALL J L,et al.Semantic patches considered helpful[J].ACM Sigops Operating Systems Review,2006,40(3):90-92.
[4] BRUNEL J,DOLIGEZ D,HANSEN R R,et al.A foundation for flow-based program matching using temporal logic and model checking[C]∥POPL 2009.2009:114-126.
[5] PADIOLEAU Y,LAWALL J,HANSEN R R,et al.Documenting and automating collateral evolutions in Linux device drivers[C]∥EuroSys 2008.Glasgow,Scotland:ACM,2008:247-260.
[6] PADIOLEAU Y,LAWALL J L,MULLER G.Under standing collateral evolution in Linux device drivers[C]∥EuroSys.2006:59-71.
[7] LAWALL J L,BRUNEL J,PALIX N,et al.WYSIWIB:exploiting fine-grained program structure in a scriptable API-usage protocol-finding process[J].Software:Practice and Experience, 2013,43(1):67-92.
[8] ENGLER D R,CHELF B,CHOU A,et al.Checking systemrules using system-specific,programmer-written compiler extensions[C]∥OSDI’00.San Diego,CA,2000:1-16.
[9] CHOU A,YANG J,CHELF B,et al.An empirical study of ope-rating systems errors[C]∥Proceedings of the Eighteenth ACM Symposium on Operating Systems Principles(SOSP ’01).New York,NY,USA,ACM,2001:73-88.
[10] PALIX N,THOMAS G,SAHA S,et al.Faults in Linux:tenyears later[C]∥16th International Conference on Architectural Support for Programming Languages and Operating Systems.Newport Beach,CA,USA,2011:305-318.
[11] CORBET J,RUBINI A,KROAH G.Linux Device Drivers(third edition)[M].USA:O’Reilly,2006:35-45.
[12] BOVET D P,CESATI M.Understanding the Linux Kernel(third edition)[M].USA:O’Reilly,2007:525-534.
[13] GALLAGHER K B,LYLE J R.Using program slicing in software maintenance[J].Transactions on Software Engineering,1991,17(18):751-761.
[14] WEISER M.Program slicing[C]∥ICSE 1981.1981:439-499.
[15] REN X,SHAH F,TIP F,et al.Chianti:A tool for change impact analysis of Java programs[C]∥OOPSLA’04.Vancouver,BC,Canada,2004:432-448.
[16] ANDERSEN J,LAWALL J L.Generic patch inference[J].Automated Software Engineering,2010,17(2):119-148.
[17] MENG N,KIM M,MCKINLEY K S.LASE:locating and app-lying systematic edits by learning from examples[C]∥ICSE 2013.2013:502-511.

No related articles found!
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!