Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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É豸 £¨×ª£©

5.3.2  É豸ÀàÐÍ·ÖÀà
×ÝÀÀlinux/driversĿ¼£¬´ó¸Å»¹ÓÐ35¸öÒÔÉϵÄ×ÓĿ¼£¬Ã¿¸ö×ÓĿ¼»ù±¾ÉϾʹú±íÁËÒ»ÖÖÉ豸Çý¶¯£¬ÓÐatm¡¢block¡¢char¡¢misc¡¢input¡¢net¡¢usb¡¢sound¡¢videoµÈ¡£ÕâÀïÖ»ÃèÊöÔÚǶÈëʽϵͳÀïÃæÓõÃ×îΪ¹ã·ºµÄ3ÖÖÉ豸¡£
1£®×Ö·ûÉ豸£¨char device£©
×Ö·ûÉ豸ÊÇLinux×î¼òµ¥µÄÉ豸£¬¿ÉÒÔÏñÎļþÒ»Ñù·ÃÎÊ¡£ ......

ÔÚLinuxϰ²×° Sybase ASE 11.0.3.3

£¨ÉùÃ÷£ºÕâÊÇ×ªÔØ×Ôhttp://www.chinaunix.net/jh/21/1079.html)
´ÓSybaseµÄÕ¾µãÉÏÏÂÔØÁ½¸öÈí¼þ°ü£¬±ÊÕßÏÂÔØÁË11.0.3.3°æ±¾£¬SybaseĿǰÒѾ­ÍƳöÁËASE11.9.2£¬ÓÉ
ÓÚ11.9.2Èí¼þ°üºÜ´ó£¬ÓÉ6¸örpmÈí¼þ°ü×é³É£¬¸÷λ¿ÉÒÔÈ¥ÆäÕ¾µãÏÂÔØ¡£¶ÔÓÚSybase¡¡11.0.3£¬sybaseÌṩÁË
Á½¸örpm¸ñʽµÄÈí¼þ°ü¡£ 
£¨ÕâÁ½¸öÎļþ¿ÉÒÔ¿´ÎÒ²©¿ ......

linux shellÖк¯Êý²ÎÊý¼°Æä±äÁ¿

linuxÖеÄSHELLº¯ÊýÊÇ¿ÉÒÔ´ø²ÎÊýµÄ.
====´úÂë===
#!/bin/bash
function show()
{
echo $0        #·µ»Ø½Å±¾±¾ÉíÃû×Ö¶ø²»ÊǺ¯ÊýÃû
echo $1        #·µ»Øµ÷ÓÃʱµÄµÚÒ»¸ö²ÎÊý
.
.
.
echo $9         ......

¡¾×ª¡¿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Îļþ£¬ÔÚÎļ ......

linuxÓû§(user)ºÍÓû§×é(group)

add user£º
[root@localhost ~]# useradd test
[root@localhost ~]# passwd test
add user to a group:
e.g. add nexus to admin
useradd -g admin nexus
default role£º
[root@localhost ~]# useradd -D
GROUP=100
HOME=/home
INACTIVE=-1
EXPIRE=
SHELL=/bin/bash
SKEL=/etc/skel
CREATE_MAIL_SPOOL=no
de ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ