linuxÇý¶¯ ×ÔÐýËøµÄÔËÓÃ
linuxÇý¶¯ ×ÔÐýËøµÄÔËÓÃ
//hello.c
#define __NO_VERSION__
#include <linux/module.h>
#include <linux/config.h>
#include <linux/version.h>
#include <asm/uaccess.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <asm/page.h>
#include <linux/poll.h>
#include <linux/kdev_t.h>
#include <asm/semaphore.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <asm/uaccess.h>
#include <asm/irq.h>
#include <linux/interrupt.h>
#include <linux/spinlock.h>
unsigned int test_major = 0;
static int global_var=0;
static int globalvar_count = 0;
char *mystr="wodeshen" ;
static struct semaphore sem;
static spinlock_t spin = SPIN_LOCK_UNLOCKED; //ºê¶¨Òå ÒѾ³õʼ»¯
static ssize_t read_test(struct file *file,char *buf,size_t count,loff_t *f_pos)
{
int left;
printk(KERN_INFO "read_test\n");
if (verify_area(VERIFY_WRITE,buf,count) == -EFAULT )
return -EFAULT;
if (down_interruptible(&sem))
{
return - ERESTARTSYS;
}
printk("copy_to_user======2=======\n");
copy_to_user(buf, mystr, strlen(mystr));
/*
for(left = count ; left > 0 ; left--)
{
__put_user('1',buf);
buf++;
}
*/
up(&sem);
//return sizeof(int);
return strlen(mystr);
}
static ssize_t write_test(struct file *file, const char *buf, size_t count, loff_t *f_pos)
{
if (down_interruptible(&sem))
{
return - ERESTARTSYS;
}
if (copy_from_user(&global_var, buf, sizeof(int)))
{
up(&sem);
return - EFAULT;
}
up(&sem);
printk(KERN_INFO "write_test\n");
return sizeof(int);
}
static int open_test(struct inode *inode,struct file *file )
{
spin_lock(&spin);
printk("globalvar open\n");
//ÁÙ½ç×ÊÔ´·ÃÎÊ
if (globalvar_count)
{
spin_unlock(&spin);
return - EBUSY;
}
globalvar_count++;
//ÊÍ·Å×Ô
Ïà¹ØÎĵµ£º
£¨L2CAPÐÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPÐÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼Á¬½Ó¿ØÖƺÍÊÊÅäÐÒé (L2CAP) ΪÉϲãÐÒéÌṩÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àÐÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãÐÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......
ת×Ô£ºhttp://www.cnblogs.com/hopeworld/archive/2009/08/07/1541444.html
ͳ¼Æ×ÜÊý´óС
du -sh xmldb/
du -sm * | sort -n //ͳ¼Æµ±Ç°Ä¿Â¼´óС ²¢°²´óС ÅÅÐò
du -sk * | sort -n
du -sk * | grep guojf //¿´Ò»¸öÈ˵ĴóС
&nb ......
Viʹ Óà ˵ Ã÷
Linux×÷Ϊһ¸ö¶àÓû§,¶àÈÎÎñµÄ²Ù×÷ϵͳ,ÓÐ×ÅÇ¿´óµÄ¹¦ÄÜ.±¾ÆªÎÒÃǶÔÕÕDOS½²½âһЩÓëDOS¹¦ÄÜÏàËƵÄLinuxÖ÷ÒªÃüÁî,Ï£ÍûÎÒÃÇ˳ÀûµÄ½øÈëµ½LinuxÊÀ½ç.¸üÏêϸµÄÃüÁîÔÚÒÔºóµÄƪ·ùÀïÒÔTurboLinuxΪÀý½øÐзÖƪ½éÉÜ
Ò»,Æô¶¯
LinuxµÄÆô¶¯²Ù×÷¹ý³ÌºÍDOSÏàËÆ(¾¡¹ÜÈç´Ë,µ«×÷Ϊ²Ù×÷ϵͳ±¾Éí,LinuxÔÚÆô¶¯ºÍÍ˳öʱËù×÷µÄ¹ ......
1¡¢LinuxÎļþϵͳÊÇ´Ó/¿ªÊ¼µÄ£»
ÔÚLinux²Ù×÷ϵͳµÄÎļþ¹ÜÀíÖУ¬ÃüÁîÐÐģʽ£¨ÔÚ¿ØÖÆ̨»òÖÕ¶ËÏ£©µÄÎļþ»òĿ¼¹ÜÀí£¬ÒªÉ漰·¾¶ÕâÒ»¸ÅÄÕâÊÇLinuxÃüÁîÐвÙ×÷µÄ×î»ù´¡µÄ»ù´¡¡£Èç¹ûÎÒÃÇÁ˽âÁË·¾¶µÄ¸ÅÄ¾Í¿ÉÒÔËæÐÄËùÓûµÄ½øÈëÈκÎĿ¼£¬½øÐÐÎÒÃÇÏëµÄ¹¤×÷¡£
Linux Îļþϵͳ£¬ÊÇÒ»¸ö³ÊÊ÷Ðνṹ£¬ÊÇ´Ó/×öΪÈë¿Ú£¬/£¨Ò²±»³ÆΪ¸ ......
ÔÚLinuxϵͳÉÏÃüÃûĿ¼µÄ·½Ê½ÊÇÏ൱ÒþÃصģ¬ÕâҪ׷Ëݵ½µçÄÔÓ²¼þ´¦ÀíÄÜÁ¦±È½ÏÈõ¶ø¼Û¸ñÓֱȽϹóµÄʱÆÚ¡£ÔÚLinuxϵͳÉÏÃüÃûĿ¼µÄ·½Ê½ËƺõÓе㱿׾£¬µ«ÓëÆäËûµÄÿ¼þÊÂÇéÒ»Ñù£¬ÕâÖ»Ð軨һЩʱ¼ä¼ÓÒÔÏ°¹ß¡£Í¨¹ýÃèÊöLinuxÎļþϵͳµÄÈ«¾°£¬Ê¹¶ÁÕß¿ÉÒÔ¶ÔLinuxµÄÎļþϵͳÓнÏÇå³þµÄÈÏʶ¡£
¸ùĿ¼(/)
¡¡¡¡Ä¿Â¼½á¹¹ÉϵÄ×î¸ßµã± ......