linux»ù±¾Çý¶¯ºÍlinux×Ö·ûÉ豸Çý¶¯
ÏÈÕ³ÌùÒ»¸ölinux×î¼òµ¥µÄÇý¶¯£¬Æäʵ¶ÔÓÚÒ»¸ö´Ó2.4ÍæÉÏÀ´µÄÈËÀ´Ëµ£¬Çý¶¯²»¸´ÔÓ£¬±È½Ï²»Ï°¹ßµÄÊÇÄǸömakefile
Çý¶¯±¾Éí£º
hello.c:
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
MODULE_LICENSE("Dual BSD/GPL");
static int hello_init(vodi){
printk(KERN_ALERT "hello world\n");
return 0;
}
static void hello_exit(vodi){
printk(KERN_ALERT"bye bye\n");
}
module_init(hello_init);
module_exit(hello_exit);
Makefile:
obj-m := hello.o
KERNELDIR :=/lib/modules/$(shell uname -r)/build
all:
make -C $(KERNELDIR) M=$(shell pwd) modules
clean:
rm -rf *.o *.ko
È»ºó¸½¹ýÀ´Ò»¸öÇý¶¯£¬ÔÝʱûÓÐÑéÖ¤£¬ÊÇ×Ö·ûÐ͵ģ¬Èç¹ûÑéÖ¤ºÃÓã¬ÎÒÔÙ¸üÐÂÕâÆªÈÕÖ¾
±¾ÀýÊÇ·ë¹ú½øµÄ ¡¶Ç¶ÈëʽLinux Çý¶¯³ÌÐòÉè¼Æ´ÓÈëÃŵ½¾«Í¨¡·µÄµÚÒ»¸öÀý×Ó
¸Ð¾õÕæÊǺÃÊé Ç¿ÁÒÍÆ¼ö
×¢ÊÍÊÇdeep_pro¼ÓµÄ ×ªÔØÇë×¢Ã÷£¡ÎÒµÄÌØµãÊÇÎIJ»¼Óµã£¡
Õâ¸öÇý¶¯ÊÇÔÚÄÚ´æÖзÖÅäÒ»¸ö256×ֽڵĿռ䣬¹©Óû§Ì¬Ó¦ÓóÌÐò¶Áд¡£
ÏÈÊÇÍ·Îļþ demo.h
#ifndef _DEMO_H_
#define _DEMO_H_
#include <linux/ioctl.h> /* needed for the _IOW etc stuff used later */
/********************************************************
* Macros to help debugging
********************************************************/
#undef PDEBUG /* undef it, just in case */
#ifdef DEMO_DEBUG
#ifdef __KERNEL__
# define PDEBUG(fmt, args...) printk( KERN_DEBUG "DEMO: " fmt, ## args)
#else//usr space
# define PDEBUG(fmt, args...) fprintf(stderr, fmt, ## args)
#endif
#else
# define PDEBUG(fmt, args...) /* not debugging: nothing */
#endif
#undef PDEBUGG
#define PDEBUGG(fmt, args...) /* nothing: it's a placeholder */
//É豸ºÅ
#define DEMO_MAJOR 224
#define DEMO_MINOR 0
#define COMMAND1 1
#define COMMAND2 2
//×Ô¼º¶¨ÒåµÄÉ豸½á¹¹
struct DEMO_dev
{
struct cdev cdev; /* Char de
Ïà¹ØÎĵµ£º
ÀýÒ»£º·¢ËÍSignaling Packet£º
Signaling CommandÊÇ2¸öBluetoothʵÌåÖ®¼äµÄL2CAP²ãÃüÁî´«Êä¡£ËùÒÔµÃSignaling CommandʹÓÃCID 0x0001.
¶à¸öCommand¿ÉÒÔÔÚÒ»¸öC-frame£¨control frame£©Öз¢ËÍ¡£
Èç¹ûÒªÖ±½Ó·¢ËÍSignaling Command.ÐèÒª½¨Á¢SOCK_RAWÀàÐ͵ÄL2CAPÁ¬½ÓSocket¡£ÕâÑù²ÅÓлú»á×Ô¼ºÌî³äCommand Code£¬Identi ......
1£¬½â¿ªtar.zµÄѹËõ°ü
# tar xvfz backup.tar.Z
»ò# uncompress backup.tar.Z
#tar xvf backup.tar
2£¬½â¿ª.tgzµÄÎļþ
#gunzip backup.tgz
3£¬ÈçºÎѹËõºÍ½âѹ.bz2µÄÎļþ
&nbs ......
screen.width*0.7)
{this.resized=true; this.width=screen.width*0.7; this.alt='Click here
to open new window\nCTRL Mouse wheel to zoom in/out';}"
onmouseover="if(this.width>screen.width*0.7) {this.resized=true;
this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='C ......
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>
#include <semaphore.h>
#define M 10 // »º³åÊýÄ¿
int in = 0; // Éú²úÕß·ÅÖòúÆ·µÄλÖÃ
int out = 0; // Ïû·ÑÕßÈ¡²úÆ·µÄλÖÃ
int buff[M] = {0}; // »º³å³õʼ»¯Îª0£¬ ¿ªÊ¼Ê±Ã ......
Ò» °²×°DHCP·þÎñÆ÷
1.ÏȲ鿴ϵͳÊÇ·ñ°²×°DHcp
#rpm -qa|grep dhcp
2.°²×°RPM°ü,Èç¹ûÊÇRea Hat LInux9°²×°°üÔÚµÚ¶þÕ¹âÅÌ,¹ÒÔÚÁ˹âÇýºó¿ÉÓòéÕÒÃüÁîÕÒDHCP°ü
#find /mnt/cdrom/ -name "dhcp"
3.²é¿´findÃüÁîËѳöÀ´µÄÎļþ·¾¶½øÐа²×°
#rpm -ivh/mnt/cdrom/RedHat/RPMS/dhcp*/dhcpd*(¸ù¾Ý×Ô¼ºÊµ¼ÊÎļþ·¾¶)
4. ......