Abstract:
Rather than C language, C++ is chosen as the language working in Linux kernel with the purpose of realizing object-oriented design and programming in kernel environment. However, it is a challenge that how to keep the compatibility between Linux kernel and C++. This paper analyzes the mechanism of kernel modules loading. Also the measure of memory allocation adopted by C++ in the kernel is discussed. As a result, it finds a feasible way to apply C++ language to kernel modules development.
Key words:
Linux,
kernel module,
C++
摘要: 使用C++代替C作为Linux内核环境开发语言,有利于将面向对象的设计与编程引入Linux内核。但是在Linux内核中保持C++与内核的兼容性和自身的语言特性是一个具有挑战性的问题。该文对Linux内核模块装载机制和C++语言在Linux内核模式下内存分配机制进行了分析,实现了在Linux内核开发中应用C++语言的切实可行的方法。
关键词:
Linux,
内核模块,
C++
CLC Number:
PENG Lei; WU Lei; YE Ya-lan. Research on C++ Language Inside Linux Kernel[J]. Computer Engineering, 2007, 33(23): 6-8,11.
彭 磊;吴 磊;叶娅兰. Linux内核模式下C++语言的导入研究[J]. 计算机工程, 2007, 33(23): 6-8,11.