Linux kernel development Chapter2 ½ø³Ì¹ÜÀí
1 ½ø³Ì¹ÜÀíÏà¹Ø´úÂë
1.1 thread_info½á¹¹£¬ÔÚÎļþ<asm/thread_info.h>Öж¨Òå
struct thread_info {
struct task_struct *task;
struct exec_domain *exec_domain£»
unsigned long flags;
__u32 cpu;
__s32 preempt_count;
mm_segment_t addr_limit;
u8 supervisor_stack[0];
};
ÿ¸öÈÎÎñµÄthread_info½á¹¹ÔÚÆäÄÚºËÕ»¶¥¶Ë·ÖÅ䣬ÆätaskÓòÖ¸Ïò¸ÃÈÎÎñµÄʼþtask_struct½á¹¹¡£
1.2 ÈÎÎñ¶ÓÁУ¨task list£©
Ë«ÏòÑ»·Á´±í£¬Á´±íÿһÏÊÇÒ»¸ötask_struct(¶¨ÒåÔÚinclude/linux/sched.hÖÐ),¸Ã½ø³ÌÃèÊö·û°üº¬ÁËÒ»¸ö½ö½ø³ÌµÄËùÓÐÐÅÏ¢¡£
1.3 slab
linuxͨ¹ýslab»úÖÆ·ÖÅätask_struct½á¹¹£¬ÒÔ´ïµ½¶ÔÏó¸´Óúͻº´æ×ÅÉ«µÄÄ¿µÄ¡£
1.4 pid
linuxͨ¹ýpid£¨pid_tÀàÐÍ,integer)À´±êʾÿһ¸öÈÎÎñ½ø³Ì¡£ÎªÁËÓëÀÏ°æ±¾unixºÍlinux¼æÈÝ£¬pid×î´óֵΪ32767.Èç¹ûÐèÒª¸ü¶à½ø³Ì£¬¿ÉÒÔͨ¹ý
ÐÞ¸Ä/proc/sys/kernel/pid_maxÀ´Ìá¸ßÉÏÏÞ¡£
1.5 currentºê
currentºêÓÃÓÚ²éÕÒµ±Ç°ÕýÔÚÔËÐнø³ÌµÄ½ø³ÌÃèÊö·û¡£²»Í¬µÄÓ²¼þÌåϵ½á¹¹µÄʵÏÖ²»Í¬¡£
ÔÚx86¼Ü¹¹ÖУ¬¼Ä´æÆ÷²»¶à£¬²»ÄÜʹÓÃרÃŵļĴæÆ÷Ö¸Ïòµ±Ç°½ø³ÌµÄtask_struct.ËüµÄ·½Ê½ÊÇͨ¹ýÔÚÄÚºËÕ»¶¥¶Ë´´½¨thread_info½á¹¹£¬¼ä½ÓµÄ
²éÕÒtask_struct½á¹¹£º
£¨1£©Í¨¹ýÆÁ±ÎÕ»Ö¸Õ루esp£©µÄºó13¸öÓÐЧλ»ñµÃthread_info½á¹¹£¬ÔÚcurrent_thread_info()º¯ÊýÍê³É£º
&n
Ïà¹ØÎĵµ£º
£¨L2CAPÐÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPÐÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼Á¬½Ó¿ØÖƺÍÊÊÅäÐÒé (L2CAP) ΪÉϲãÐÒéÌṩÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àÐÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãÐÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......
µãÆÀ£º°²×°Èí¼þ°ü rpm -i °üÈ«Ãû ɾ³ý rpm -e name(²»ÊÇ°üÃû) ²ÎÊý -ivh »ñµÃÒ»¸öÏêϸµÄ°²×°½ø³Ì --nodeps ºöÂÔÒÀÀµ¹Øϵ --force Ç¿ÖÆ°²×° -U °üÃû:Éý¼¶°²×° -F ¸üв»¹ÜÊÇʲôֱ½Ó¸²¸Ç --replacepkgsÕâÑù RPM ½«ºöÂԸôíÎóÐÅÏ¢ -vih --repla
ÄÚÈÝÀ´×Ô: ½Å±¾Ö®¼Ò www.jb51.net
°²×°Èí¼þ°ü
rpm -i °üÈ ......
ÒÔÇ°ÒѾ½Ó´¥WindowsϵÄSocket±à³Ì£¬×î½üÒ²³¢ÊÔ×ÅÔÙlinuxÏÂʹÓÃSocket±à³Ì£¬ÏÂÃæÊÇÔÚÍøÉÏÕÒµÄÀý×Ó(ÒѾ²âÊÔ¹ý)
tcp_server.c:
#include <stdio.h>
#include <sys/socket.h>
#include <unistd.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <stdlib.h>
# ......
Ò»±ßѧϰubuntu,Ò»±ß·¢ÏÖÎÊÌ⣬Ŀǰ·¢ÏÖµÄÎÊÌâÓÐÒÔϼ¸¸ö£¬²¢³É¹¦½â¾ö¡£
Ê×ÏÈ£¬´ò¿ªfirefox,flash²»ÄÜÕýÈ·ÏÔʾ£¬°²×°adobe flash ×îвå¼þ¾Í¿ÉÒÔ½â¾ö£¬ÆäËûflash²å¼þЧ¹û²»Ì«ºÃ¡£ºóÀ´´ò¿ªQQÅ©³¡µÄflash£¬ÖÐÎÄÏÔʾ¿Õ¸ñ£¬½â¾ö·½·¨£¬´ò¿ªÖնˣ¬ÊäÈëÒÔÏÂÃüÁ ......