Linux
文章平均质量分 65
robot_cn
专注嵌入式系统开发
展开
-
GNU/Linux 编程指南学习笔记之four : diff & patch
diff and patch are GNU projects programs, while role of the first program is to create file diffs, which express the diffrence between two source code files and the second is to using diffs to cr原创 2009-04-14 14:10:00 · 441 阅读 · 0 评论 -
Linux Device Driver: char device
在内部,scull使用一个struct scull_dev类型的结构表示每个设备,定义如下:struct scull_dev{struct scull_qset *data; /*Pointer to first quantum set*/int quantum; /*the current quantum size*/int qs原创 2009-05-21 15:44:00 · 611 阅读 · 0 评论 -
linux 2.6 调度器
Linux 2.6 调度器简介2.6 版本的调度器是由 Ingo Molnar 设计并实现的。Ingo 从 1995 年开始就一直参与 Linux 内核的开发。他编写这个新调度器的动机是为唤醒、上下文切换和定时器中断开销建立一个完全 O(1) 的调度器。触发对新调度器的需求的一个问题是 Java™ 虚拟机(JVM)的使用。Java 编程模型使用了很多执行线程,在 O(n) 调度器中这会产转载 2009-05-26 11:28:00 · 331 阅读 · 0 评论 -
fork() 创建新进程
简单的 fork() 用法sunbox$ cat fork1.c#include #include int main (void) { pid_t p; /* fork returns type pid_t */ p = fork(); printf("fork returned %d/n", p);}sun原创 2009-05-26 09:59:00 · 466 阅读 · 0 评论 -
exec()&fork()配合使用运行不同的进程
sunbox$ cat exec1.c#include #include int main (void) { /* Define a null terminated array of the command to run followed by any parameters, in this case none */转载 2009-05-26 10:23:00 · 448 阅读 · 0 评论 -
建立arm-linux-gcc交叉编译环境
一、交叉编译环境 arm-linux-gcc-2.95.3 的建立1.下载cross-2.95.3.tar.bz2 2.建目录,复制,解压# cd /usr/local# mkdir arm# cd arm复制cross-2.95.3.tar.bz2 到当前目录# tar jxvf cross-2.95.3.tar.bz23.导出/usr/local/arm转载 2009-08-17 13:28:00 · 369 阅读 · 0 评论 -
Linux设备驱动程序学习(0)-Hello, world!模块
转载出处: tekkman.cublog.cn ,谢谢合作!!!!!Linux设备驱动程序学习(0)-Hello, world!模块 一个学习Linux设备驱动程序都会碰到的第一个例程:#include linux/init.h>#include linux/module.h> MODULE_LICENSE("Dual BSD/GPL");stati转载 2009-06-17 09:46:00 · 381 阅读 · 0 评论 -
Linux设备驱动程序学习(1)-字符设备驱动程序
Linux设备驱动程序学习(1)-字符设备驱动程序一、分配设备号 1、 对字符设备的访问是通过文件系统内的设备名称进行的(/dev/ttyS0)。在内核中,#include dev_t 用来保存设备编号——包括主设备号和次设备号。由dev_t获得主次设备号: MAJOR(dev_t dev);原创 2009-06-17 11:30:00 · 537 阅读 · 0 评论 -
Ptrace
1. Introduction<br />ptrace() is a system call that enables one process to control the executionof another. It also enables a process to change the core image of another process. The traced process behaves normally until a signal is caught. When th转载 2011-03-25 13:52:00 · 393 阅读 · 0 评论 -
linux device driver 3rd (1) hello module
Linux设备驱动程序学习(0)-Hello, world!模块 Linux设备驱动程序学习(0)-Hello, world!模块 一个学习Linux设备驱动程序都会碰到的第一个例程:#include linux/init.h>#include linux/module.h> MODU转载 2009-05-08 14:56:00 · 558 阅读 · 0 评论 -
内存管理 之 C内存管理
malloc() 分配没有被初始化过的内存#include void *malloc(size_t size); size :要分配的字节数void * : 返回指向新分配的内存的指针,执行失败返回NULL 标准调用规范:#include char *pmem;if((pmem = malloc(sizeof(char)*100)原创 2009-04-17 15:07:00 · 318 阅读 · 0 评论 -
访问系统信息
进程信息 系统正在运行的每个用户级进程在/proc下都有一个目录。 文件/proc/$pid/cmdline内容只有一行,它是进程的命令行,包括程序的名称和所有的参数。 文件/proc/$pid/environ记录了进程的环境信息。单个的环境字符串之间由空字节分割,以文件结束标志作为环境结束的标志。 目录/proc/$pid/fd为每个打开的文件描述原创 2009-04-17 14:00:00 · 368 阅读 · 0 评论 -
GNU/Linux编程指南学习笔记之一:gcc
gcc gives the programmers extensive control over the compilation process. The compilation process includes up to four stages:Preprocessing(预处理)---------->Compilation Proper(彻底编译)-------->Assemb原创 2009-04-14 08:40:00 · 475 阅读 · 0 评论 -
GNU/Linux 编程指南之二:make
Environment, Automatic, and Predefined VariablesAutomatic Variables***************************************$@ The filename of a rules target$$^ Space-delimited list of all the d原创 2009-04-14 11:16:00 · 564 阅读 · 0 评论 -
GNU/Linux编程指南学习笔记之五:RCS--------Revision Control System "Version Control"
原创 2009-04-14 14:21:00 · 505 阅读 · 0 评论 -
GNU/Linux编程指南学习笔记之七:系统编程----I/O Routines (续)
Types of FilesRegular File下面的示例程序中用到了大多数上面讲到的系统调用***************************************************************/*filedes_io.c*/#include #include #include #include #include #in原创 2009-04-14 20:26:00 · 446 阅读 · 0 评论 -
GNU/Linux 编程指南之三: autoconf-----configure software to a target platform
GNU autoconf, a tool that enables you to configure your software to adapt to the wide assortment of system configurations in which it may be built, including many non-Linux systems. The ultima原创 2009-04-14 12:18:00 · 609 阅读 · 0 评论 -
bucket sort algorithm -- From Wiki
Pseudocode: function bucketSort(array, n) is buckets <- new array of n empty lists for i=0 to (length(array)-1) do insert array[i] into buckets[msbits(array[i], k)] f翻译 2012-07-19 11:11:29 · 432 阅读 · 0 评论