自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(25)
  • 资源 (1)
  • 收藏
  • 关注

翻译 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 423

原创 scan line polygon fill algorithm

Algorithm Steps:1. 确定scan-line(y=yk)与多边形边的交点2. 从左到右对交点进行排序3. 产生两个交点(线段)之间的像素的位置信息Corner Problems:多边形的顶点看作一个交点还是两个?Solution:1. 一个交点: 在此点相交的多边形的两条边在此交点的同侧2. 两个交点: 在此点相交的多边形的两条边在此

2012-07-18 15:58:56 934

转载 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 364

原创 NAND flash controller -samsung s3c2410 as example

<br />控制器特性:<br /> - support read/erase/program NAND flash.<br /> - hardware ECC (Error Correction Code) (硬件生成校验码,软件负责校验)<br /> - 不能通过DMA访问<br /> <br />引脚配置:<br /> <br />D[7:0]: data/command/address I/O<br />CLE    : command latch enable<br />ALE    : addr

2010-06-03 15:19:00 717

原创 MLC 和 SLC 闪存芯片的区别

<br />SLC (Single Level Cell) 即单层式储存。 主要由三星、海力士、美光、东芝等使用。<br /> <br />优点: 寿命长,存取次数多(10万次)<br />缺点: 成本高<br /> <br />MLC (Multi Level Cell)即多层式储存。 主要由东芝、Renesas、三星使用。<br /> <br />优点: 存储密度高,容量大,成本低<br />缺点: 寿命短,存取次数少(1万次), 速度相对慢。<br /> <br />市场趋势: MLC<br /> <

2010-06-03 14:18:00 1085

原创 UCOS-II移植到三星S3C44B0X(ARM7)

一、欲移植UCOS II,处理器必须满足的条件:1) 处理器的c编译器支持可重入函数可重入的代码指的是一段代码(如一个函数)可以被多个任务同时调用,而不必担心会破坏数据。也就是说,可重入型函数在任何时候都可以被中断执行,过一段时间以后又可以继续运行,而不会因为在函数中断的时候被其他的任务重新调用,影响函数中的数据。下面的两个例子可以比较可重入型函数和非可重入型函数:程序1:可重入型函数void s

2009-09-04 14:48:00 1225

转载 建立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 360

原创 Linux设备驱动程序学习(1)-字符设备驱动程序

Linux设备驱动程序学习(1)-字符设备驱动程序一、分配设备号   1、 对字符设备的访问是通过文件系统内的设备名称进行的(/dev/ttyS0)。在内核中,#include    dev_t  用来保存设备编号——包括主设备号和次设备号。由dev_t获得主次设备号:                         MAJOR(dev_t dev);           

2009-06-17 11:30:00 524

转载 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 369

转载 优先级反转+解决方案+方案分析

 1. 优先级反转(Priority Inversion)    由于多进程共享资源,具有最高优先权的进程被低优先级进程阻塞,反而使具有中优先级的进程先于高优先级的进程执行,导致系统的崩溃。这就是所谓的优先级反转(Priority Inversion)。2. 产生原因      其实,优先级反转是在高优级(假设为A)的任务要访问一个被低优先级任务(假设为C)占有的资源时,被阻塞.而此时又有优先

2009-06-02 18:33:00 341

原创 使用信号量的生产者-消费者问题

#define N 100typedef int semaphore; //信号量是一种特殊的整型数据semaphore mutex = 1;semaphore full = 0;semaphore empty = N;void producer(void){ int item; while(TRUE){ item =

2009-06-02 09:19:00 964 1

转载 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 316

转载 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 432

原创 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 454

原创 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 579

转载 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 546

原创 内存管理 之 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 310

原创 访问系统信息

进程信息    系统正在运行的每个用户级进程在/proc下都有一个目录。    文件/proc/$pid/cmdline内容只有一行,它是进程的命令行,包括程序的名称和所有的参数。    文件/proc/$pid/environ记录了进程的环境信息。单个的环境字符串之间由空字节分割,以文件结束标志作为环境结束的标志。    目录/proc/$pid/fd为每个打开的文件描述

2009-04-17 14:00:00 351

原创 GNU/Linux编程指南学习笔记之八:File Manipulation--file pointer I/O(FILE *)--provide by stdio library

     一般程序开始的时候都会调用三个文件指针,它们是 stdin, stdout, stderr, 如果不重定向到其它文件或者管道的话,它们一般指向用户终端。    下面列出这些函数的声明:#include FILE *fopen(const char *path, const char *mode);FILE *fdopen(int fildes, const char *m

2009-04-15 16:22:00 447

原创 GNU/Linux编程指南学习笔记之七:系统编程----I/O Routines (续)

Types of FilesRegular File下面的示例程序中用到了大多数上面讲到的系统调用***************************************************************/*filedes_io.c*/#include #include #include #include #include #in

2009-04-14 20:26:00 433

原创 GNU/Linux编程指南学习笔记之五:RCS--------Revision Control System "Version Control"

2009-04-14 14:21:00 473

原创 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 431

原创 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 596

原创 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 552

原创 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 446

git-1.7.1.tar.gz

git - a version control software

2011-07-27

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除