Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

linuxÇý¶¯Ö®mmapʵÀý

// Linux Device Driver Template/Skeleton with mmap
// Kernel Module
#include <linux/module.h>
#include <linux/init.h>
#include <linux/version.h>
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/interrupt.h>
#include <linux/sched.h>
#include <asm/uaccess.h>
#include <asm/io.h>
#include <linux/vmalloc.h>
#include <linux/mman.h>
#include <linux/slab.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
#include <linux/wrapper.h>
#endif
#define SKELETON_MAJOR 240
#define SKELETON_NAME "skeleton"
#define CASE1 1
#define CASE2 2
static unsigned int counter = 0;
static char string [128];
static int data;
//#define USEASCII
#ifdef USEASCII
static char *kmalloc_area = NULL;
static char *kmalloc_ptr = NULL;
#else
static unsigned int *kmalloc_area = NULL;
static unsigned int *kmalloc_ptr = NULL;
#endif
#define LEN (64*1024)
unsigned long virt_addr;
DECLARE_WAIT_QUEUE_HEAD(skeleton_wait);
static int data_not_ready = 0;
// open function - called when the "file" /dev/skeleton is opened in userspace
static int skeleton_open (struct inode *inode, struct file *file) {
 printk("skeleton_openn");
 // we could do some checking on the flags supplied by "open"
 // i.e. O_NONBLOCK
 // -> set some flag to disable interruptible_sleep_on in skeleton_read
 return 0;
}
// close function - called when the "file" /dev/skeleton is closed in userspace 
static int skeleton_release (struct inode *inode, struct file *file) {
 printk("skeleton_releasen");
 return 0;
}
// read function called when from /dev/skeleton is read
static ssize_t skeleton_read (struct file *file, char *buf,
  size_t count, loff_t *ppos) {
 int len, err;
 
 // check if we have data - if not, sleep
 // wake up in interrupt_handler
 while (data_not_ready) {
  interrupt


Ïà¹ØÎĵµ£º

Linux ²é¿´ÎļþºÍËÑË÷ÎļþÃüÁî

 ÔÚLinuxÀïÃæÒ»ÇнÔÎļþ£¬´ÓÎļþѧÆðÀ´£¬×î³£¼ûµÄÃüÁî¾ÍÊDz鿴ÎļþºÍËÑË÷Îļþ¡£
ÏÂÃæ¼òµ¥µÄ×ܽáÏÂÕ⼸¸öÃüÁ
²é¿´Îļþ(cat,tac,more,less,head,tail,od)
cat:
cat [file]
²é¿´ÎļþµÄÄÚÈÝ¡£È«³ÌʽconcatenateµÄÒâ˼£¬½«ÎļþÄÚÈÝÁ¬ÐøÊä³öµ½ÆÁÄ»ÉÏ¡£µÚÒ»Ðе½×îºóÒ»ÐÐÏÔʾ¡£
tac:
tac [file]
ºÍcat¸ÕºÃÏà·´ ÊÇ´Ó ......

linuxÏ£¬ÉèÖÃIPµØÖ·£¬ÖØÆô»úÆ÷ÓÐЧ

1. vi /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=example.com
GATEWAY=192.168.0.1
NDS1=219.150.32.132  // dns ·þÎñÆ÷µØÖ·
2.  vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:15:E9:B1:32:AF
BOOTPROTO=static
IPADDR=192.168.0.188
NETMASK=255. ......

linuxÆô¶¯¹ý³Ì

LinuxϵͳÆô¶¯¹ý³Ì
±¾ÎÄÒÔRedHat9.0ºÍi386ƽ̨ΪÀý£¬ÆÊÎöÁË´ÓÓû§´ò¿ªµçÔ´Ö±µ½ÆÁÄ»³öÏÖÃüÁîÐÐÌáʾ·ûµÄÕû¸öLinuxÆô¶¯¹ý³Ì¡£²¢ÇÒ½éÉÜÁËÆô¶¯ÖÐÉæ¼°µ½µÄ¸÷ÖÖÎļþ¡£
µ±Óû§´ò¿ªPCµÄµçÔ´£¬BIOS¿ª»ú×Լ죬°´BIOSÖÐÉèÖõÄÆô¶¯É豸(ͨ³£ÊÇÓ²ÅÌ)Æô¶¯£¬½Ó×ÅÆô¶¯É豸ÉÏ°²×°µÄÒýµ¼³ÌÐòlilo»ògrub¿ªÊ¼Òýµ¼ Linux£¬LinuxÊ×ÏȽøÐÐÄں˵ÄÒý ......

linux ÏÂÓÃCʵÏÖ¡®CAT¡¯µÄ¹¦ÄÜ

linux
ÏÂÓÃCʵÏÖ‘CAT’µÄ¹¦ÄÜ
#include<stdio.h>
int main(int argc,char *argv[]){
FILE *file;
char buf[1024],name[20];
int n;
if(argc != 2){
printf("wrong argument\n");
return 1;
}
file=fopen(argv[1],"r");
if(file==NULL){
printf("Cant't open!\n&quo ......

¡¾×ª¡¿windowsÉϵÄdb2Á¬½ÓlinuxÉÏdb2µÄͨÐÅÎÊÌâ

[IBM][CLI Driver] SQL30081N ¼ì²âµ½Í¨ÐÅ´íÎó¡£ÕýÔÚʹÓõÄͨÐÅЭÒ飺"TCP/IP"¡£ÕýÔÚʹÓõÄͨÐÅAPI£º"SOCKETS"¡£¼ì²âµ½´íÎóµÄλÖãº"202.106.195.29"¡£¼ì²âµ½´íÎóµÄͨÐź¯Êý£º"connect"¡£Ð­ÒéÌض¨µÄ´íÎó´úÂ룺"10060"¡¢"*"¡¢"*"¡£ SQLSTATE=08001
½â¾ö°ì·¨£º
µ½C:\WINDOWS\system32\drivers\etc\Ï£¬´ò¿ªhostsÎļþ£¬ÔÚÎļ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ