Linux Static and Dynamic Library

先来说说静态库

An archive (or static library) is simply a collection of object files stored as a single file.(An archive is roughly the equivalent of a Windows .LIB file.) When you provide an archive to the linker, the linker searches the archive for the object files it needs, extracts them, and links them into your program much as if you had provided those object files directly. You can create an archive using the ar command.Archive files traditionally use a .a extension rather than the .o extension used by ordinary object files. Here’ s how you would combine test1.o and test2.o into a single libtest.a archive: % ar cr libtest.a test1.o test2.o The cr flags tell ar to create the archive. --- 摘自《Advanced Linux Programming》

由上面可以看到,linux 操作系统中:

1. 静态库是一些目标文件 (后缀名为. o) 的集合体而已。

2. 静态库的后缀名是. a,对应于 windows 操作系统的后缀名为. lib 的静态库。

3. 可以使用 ar 命令来创建一个静态库文件。

来看一个实例,根据书中的代码简化的,先看一看可以编译成库文件的源文件中的代码:


/*  test.c  */
int f()   
{
    return 3;
}

代码非常简单,只有一句话。我们敲入如下命令:


gcc –c test.c ar cr libtest.a test.o

下载地址

Files:

Android操作系统的课程教学

Date 2018-11-19
File Size 1.45 MB
Download 439

Android操作系统的课程教学

摘要:

介绍了《Android系统应用程序开发》的课程设置及案例教学,根据Android操作系统的课程特点,结合目前师范类院校本科生的认知能力,研究了Android操作系统的课堂教学,该课程的教学过程可为从业者提供一些案例依据.

摘要:

主要介绍Intel PXA255平台网络设备驱动的软硬件设计和实现方案,分析了嵌入式Linux下网络设备驱动的一般特性与编程要点,阐述了网络设备驱动如何处理数据的发 送、接收、超时等相应事件,并简要介绍了网卡驱动与上层协议之间的交互。分别利用系统测试和应用测试验证该设计方案,结果表明网卡驱动能够很好地实现网络 包数据的传输,达到较快的速度和较高的稳定性。

下载地址

基于嵌入式Linux的网络设备驱动设计与实现

Date 2018-11-19
File Size 733.29 KB
Download 400

摘要:

分析Linux经典内核版本2.6.22的进程调度算法,利用性能监测单元的监测信息,给出3个性能指标CMR、CRR、OCIP对进程的缓存竞争性强弱进行刻画,以此为依据,采用轮询算法优化Linux下的进程调度顺序,尽量避免在CPU上同时运行多个缓存竞争力强的进程,减小系统因缓存竞争产生的性能损耗。在benchmark上的测试结果表明,该方法能够提升系统在中、高负载下运行时的性能,在高负载下运行时的性能提升比例可达6%左右。

下载地址

基于缓存竞争优化的Linux进程调度策略

Date 2018-11-19
File Size 606.46 KB
Download 498

Synopsis:

According to the analysis of the process scheduling algorithm of Linux kernel 2.6.22, through the information getting from Performance Monitor Unit(PMU), this paper puts forward three performance indexes CMR, CRR and OCIP to describe the process behavior of cache contention. On the basis of this, it uses polling algorithm to optimize the process scheduling in order to reduce the cache contention of Last Level Cache(LLC). Benchmark test results show that this algorithm can improve about 6% performance when the system load is high.

下载地址

Linux 用户与用户组关系详解

Date 2018-11-19
File Size 240.58 KB
Download 429

Linux 用户与用户组关系详解