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

Linux Kernel時ÐòµÄÈý種機ÖÆ

×î½üÔÚ寫Driver時£¬³£³£Óöµ½ÐèÒª¡¸µÈ´ýÒ»¶Î時間¡¹ÔÙ處ÀíµÄ動×÷£¬ÒÔÍùÎÒ¶¼ÉµÉµµÄÓÃmsleep()»òmdelay()£¬Êâ²»Öª這種busy waiting會holdסcpu資Ô´£¬ÔÚ這¶ÎÆÚ間內¶¼無·¨讓給ÆäËûprocess執ÐУ¬時間¶Ì(10msÒÔϵÈ級)»ò許還¿ÉÒÔ£¬Ì«長¾Í²»ÐÐÁË£¬ËùÒÔÐèÒªKernel±¾Éí¾ÍÓÐÌṩµÄ¡¸時Ðò¡¹機ÖÆ來×ö處Àí£¬ì¶ÊÇÎÒ漸漸學會ÁËÈçºÎʹÓÃTimer¡¢TaskletºÍWorkqueueµÄÓ÷¨£¬ÔÚO'ReillyµÄLinux Device DriversµÚÆßÕÂÓÐ詳細µÄ講½â£¬ÎÒ將書Éϵľ«華茲簡單ÕûÀíÈçÏ£º
##CONTINUE##
Ò»¡¢Timer
#include <linux/timer.h>
struct timer_list
{
/* ... */
unsigned long expires;//ÆÚÍû運ÐÐµÄ jiffies Öµ
void (*function)(unsigned long);
unsigned long data;//傳給functionµÄ參數
};//ʹÓÃǰ±Ø須³õʼ»¯
void init_timer(struct timer_list *timer);
//³õʼ»¯Ò»個timer_list
struct timer_list TIMER_INITIALIZER(_function, _expires, _data);
//³õʼ»¯Ò»個靜態µÄtimer_list
void add_timer(struct timer_list * timer);
int mod_timer(struct timer_list *timer, unsigned long expires);
int del_timer(struct timer_list * timer);
int del_timer_sync(struct timer_list *timer);
//ͬ del_timer Ò»樣,µ«±£證º¯數return時£¬¶¨時Æ÷º¯數²»ÔÚÈκΠCPU ÉÏ運ÐÐ
//±ÜÃâÔÚSMP ϵ統ÉÏ競爭
int timer_pending(const struct timer_list * timer);
//·µ»ØÕæ»ò¼Ù來ָʾÊÇ·ñ¶¨時Æ÷Òѱ»運ÐÐ
¶þ¡¢Tasklet
#include <linux/interrupt.h>
struct tasklet_struct {
/* ... */
void (*func)(unsigned long);
unsigned long data;
};
void tasklet_init(struct tasklet_struct *t,
void (*func)(unsigned long), unsigned long data);
//將¶¨義ºÃµÄ結構體³õʼ»¯£¬²Å¿ÉÓÃ
DECLARE_TASKLET(name, func, data);
//Ö±½ÓÉêÃ÷¾Í¿ÉÓÃÁË
DECLARE_TASKLET_DISABLED(name, func, data);
void tasklet_disable(struct


Ïà¹ØÎĵµ£º

ʵսLinux Bluetooth±à³Ì(Áù) L2CAP±à³ÌʵÀý

ÀýÒ»£º·¢ËÍ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 ......

Linux»·¾³µÄAMP°²×° MSSQLÀ©Õ¹°²×°


LinuxÒª°²×°mssqlÀ©Õ¹£¬±ØÐëÊ×ÏȰ²×°freetds£¬°²×°¹ý³ÌÈçÏ£º
1¡¢¼ÙÉèÔ´ÎļþĿ¼Ϊ/webServ£¬°²×°Ä¿Â¼Îª/opt/freetds¡£
1) >cd /webServ
2) ÏÂÔØ£¬ >wget ftp://ftp.ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz
3) ½âѹ£¬ >tar -zxvf freetds-stable.tgz
4) ½øÈ룬 >cd freetds-0¡£ ......

LinuxϵͳÓÐÓõÄÒ»¸öÃüÁî

¸ú×ÙϵͳµÄÊä³ö:
     strace
     ÀýÈç:  strace -p 9034  -x -s 2048
     -p   ½ø³ÌºÅ
     -x    ²»ÊÇASCIIµÄÊä³öÓÃHEX±íʾ
     -s    ÿ´ÎÊä³öµ ......

LinuxϱéÀúijÎļþ¼ÐÏÂÎļþ£¨²»µü´ú½øÈë×ÓĿ¼£©

Ô­ÎĵØÖ·£ºhttp://www.wangzhongyuan.com/archives/487.html
ÒÔÏÂÊÇÒ»¸öLinux/UnixÏÂÏÔʾijһĿ¼ÏÂÎļþÁбíµÄC³ÌÐò£¬Ï൱ÓÚ×î»ù±¾µÄlsÃüÁîµÄ¹¦ÄÜ£¬ÏÔʾµÄÄÚÈݱ¨¸æ¸ÃĿ¼ÏµÄ×ÓĿ¼ÒÔ¼°ÎļþÃû:
#include <sys/types.h>
#include <dirent.h>
#include <stdio.h>
#include <errno.h>
int m ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ