易截截图软件、单文件、免安装、纯绿色、仅160KB

s3c2410平台下linux四键按键驱动程序

#ifndef __KERNEL__
#define __KERNEL__
#endif
#ifndef MODULE
#define MODULE
#endif
#include<linux/config.h>
#include<linux/module.h>
#include<linux/version.h>
#include<linux/init.h>
#include<linux/kernel.h>
#include<linux/errno.h>
#include<linux/sched.h>//声明中断
#include<linux/fs.h>//声明file文件
#include<asm/system.h>/*cli(),*_flages*/
#include<linux/poll.h>
#include<linux/types.h>
#include<linux/slab.h>
#include <asm/arch/S3C2410.h>
#include <asm/hardware.h>//devf
//-------------------------------
#include <asm/io.h>/* ioremap */
#include <linux/delay.h>
#include <asm/delay.h>
//--------------------------------
#include <asm-arm/arch-s3c2410/smdk.h>
#include <linux/ioport.h>
#include <asm/irq.h>
#include <asm/mach/irq.h>
//define the interrupt No.
#define interrupt_k4   IRQ_EINT0
#define interrupt_k3   IRQ_EINT2
#define interrupt_k2   IRQ_EINT11
#define interrupt_k1   IRQ_EINT19
/*
struct IRQ_STRUCT
{
unsigned int irq_no;
void (*irq_fun)();
};
static IRQ_STRUCT irq_struct[4];
*/
//定义键盘的主设备号define the major of keypad
#define KEYPAD_MAJOR 59
#ifndef MOD_INC_USE_COUNT
#define MOD_INC_USE_COUNT
#endif
#ifndef MOD_DEC_USE_COUNT
#define MOD_DEC_USE_COUNT
#endif
#define COMMAND1 1
#define KBD_GETKEY 1
static int keyvalue;
#define DEVICE_NAME "keypad"
//setup the GPIO F ports register
#define key_rGPFCON (*(volatile unsigned long *) key_r_GPFCON)
#define key_rGPFUP (*(volatile unsigned long *) key_r_GPFUP)
#define key_rGPFDAT (*(volatile unsigned long *) key_r_GPFDAT)
//setup the GPIO G ports register
#define key_rGPGCON (*(volatile unsigned long *) key_r_GPGCON)
#define key_rGPGUP (*(volatile unsigned long *) key_r_GPGUP)
#define key_rGPGDAT (*(volatile unsigned long *) key_r_GPGDAT)
unsigned long *key_r_GPFCON, *key_r_GPFDAT,


相关文档:

ubuntu linux 下面mount fedora 逻辑卷 lvm的方法

今天fedora挂了,为了备份数据用ubuntu的livecd来进行数据备份,从网上看到了一篇帖子,
http://www.linux-sxs.org/storage/fedora2ubuntu.html
解决了问题
内容如下:
Boot Ubuntu.
Install lvm2:
$ sudo apt-get install lvm2
Load the necessary module(s):
$ sudo modprobe dm-mod
Scan your system for LVM v ......

Linux创建一定大小文件命令

dd命令
把指定的输入文件拷贝到指定的输出文件中,并且在拷贝的过程中可以进行格式转换。语法:
CODE:[Copy to clipboard]dd 〔选项〕
QUOTE:
if =输入文件(或设备名称)。
of =输出文件(或设备名称)。
ibs = bytes 一次读取bytes字节,即读入缓冲区的字节数。
skip = blocks 跳过读入缓冲区开头的ibs*blo ......

减少Linux下Squid服务器的TIME_WAIT套接字数量

Linux下高并发的Squid服务器,TCP TIME_WAIT套接字数量经常达到两、三万,服务器很容易被拖死。通过修改Linux内核参数,可以减少Squid服务器的TIME_WAIT套接字数量。
  
vi /etc/sysctl.conf
  增加以下几行:
引用
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 1200
net.ipv4.tcp_syncookie ......

Linux core文件设置

在一个程序崩溃时,默认情况下是不产生core文件。
下面的命令可以检查生成core文件的选项是否打开:
$ulimit -a该命令将显示所有的用户定制,其中选项-a代表“all”。
$ulimit -c unlimited来让特定的用户可以产生core文件
core文件仅仅是一个内存映象(同时加上调试信息),主要是用来调试的。如果您根本就不想 ......

Linux获取本机IP、MAC示例程序

#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <stdio.h>
#include <string>
#include <iostream>
#include <cstring>
using namespace std;
void peek_interfaces(int ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号