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
Ïà¹ØÎĵµ£º
£¨L2CAPÐÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPÐÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼Á¬½Ó¿ØÖƺÍÊÊÅäÐÒé (L2CAP) ΪÉϲãÐÒéÌṩÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àÐÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãÐÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......
Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖÐÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀÐÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......
ÈçºÎ°²×°:
ÏÈ°Ñ Mingming µÄ Launchpad PPA Ìí¼Óµ½ÄãµÄÈí¼þÔ´£º
½«ÏÂÃæÁ½ÐÐÌí¼Óµ½ /etc/apt/sources.list/totem-pps.list
deb http://ppa.launchpad.net/portis25/ppa/ubuntu karmic main
deb-src http://ppa.launchpad.net/portis25/ppa/ubuntu karmic main
ÔÚÖÕ¶ËÖÐÖ´ÐÐÏÂÃæµÄÃüÁîÀ´»ñÈ¡ÉÏÊö PPA Ô´µÄÃÜÔ¿¡£ ......
http://www.openchess.org/noitatsko/programming/ (2001-05-24 16:47:48)
ÐźŴ¦Àí
--------------------------------------------------------------------------------
ÐźŴ¦Àí¸Å˵
ËͳöÐźÅ
½ÓÊÕÐźÅ
ÐźŵĴ¦Àí
ÈÎÎñ¿ØÖÆ
----------------------------------- ......
ÎÒÃÇÔÚµ÷ÊÔÓ²¼þ°åʱ£¬¾³£ÐèÒª×ö¶à¸öjffs2µÄ¸ùÎļþϵͳӳÏñ£¬ÓÐʱҲҪ¶Ô±ÈÆäËû;¾¶µÃµ½µÄ¿ÉÓõÄjffs2¸ùÎļþϵͳӳÏñ¡£µ«jffs2µÄÎļþϵͳӳÏñ²»Ïó¹âÅ̵ÄÓ³ÏñÎļþÒ»Ñù¿ÉÒÔͨ¹ýloopÉ豸À´¹ÒÔØ£¬×ܲ»¿ÉÄÜÒ»¸ö¸öÉÕ¼µ½Ó²¼þ°åÈ¥¿´°É¡£ ºóÀ´µ½ÍøÉÏgoogleÁËÒ»°Ñ£¬×ó·ÓÒ·Ö®ºó×ÜËãÕÒµ½ÁËÒ»¸ö·½·¨¡£ÒòΪjffs2Êǹ¹½¨ÓÚMTDÉ豸ÉϵÄÎļ ......