ʵÏÖLinuxϵͳµ÷ÓýٳÖ
¹ØÓÚϵͳµ÷ÓýٳÖ
Èç¹ûÒ»¸öľÂíÒªÒþ²ØÆðÀ´£¬²»±»ÏµÍ³¹ÜÀíÔ±·¢ÏÖ¡£½Ø»ñϵͳµ÷ÓÃËƺõÊDZØÐëµÄ¡£´ó²¿·ÖÇé¿öÏ£¬Í¨¹ýÐÞ¸Äϵͳµ÷ÓñíÀ´ÊµÏÖϵͳµ÷ÓõĽٳ֡£ÏÂÃæÊÇÒ»¸öµäÐ͵Ľػñϵͳµ÷ÓõÄÄ£¿é£º
Ä£¿éÒ»£º
#include
#include
#include
#include
#include
#include
#include
#include
#include
MODULE_LICENSE("GPL");
extern void* sys_call_table[]; /*sys_call_table is exported, so we can accessit. But in some system this will cause problem */
int (*orig_mkdir)(const char *path); /*the original systemcall*/
int hacked_mkdir(const char *path)
{
return 0; /*everything is ok, but he new systemcall does nothing*/
}
int init_module(void) /*module setup*/
{
orig_mkdir=sys_call_table[SYS_mkdir];
sys_call_table[SYS_mkdir]=hacked_mkdir;
return 0;
}
void cleanup_module(void) /*module shutdown*/
{
sys_call_table[SYS_mkdir]=orig_mkdir;
/*set mkdir syscall to the origal one*/
}
ÓÃÕâÖÖ·½·¨ÊµÏÖϵͳµ÷ÓÃÓиöÇ°Ìᣬ¾ÍÊÇϵͳ±ØÐëµ¼³ösys_call_tableÄں˷ûºÅ£¬µ«ÊÇÔÚ2.6Äں˺ÍÓÐЩ2.4Äں˵Äϵͳ£¨±ÈÈç
redhat as 3£©ÖУ¬sys_call_table²»ÔÙµ¼³ö¡£Ò²¾ÍÊÇ˵ģ¿éÖв»ÄÜÔÙͨ¹ý¼òµ¥µÄextern void
*sys_call_table[];À´»ñµÃϵͳµ÷ÓñíµØÖ·¡£ËùÐÒµÄÊÇ£¬¼´Ê¹Äں˲»µ¼³ösys_call_table£¬Ò²¿ÉÒÔÔÚÄÚ´æÖÐÕÒµ½ËüµÄµØÖ·£¬ÏÂÃæ
ÊÇËüµÄʵÏÖ·½·¨£º
Ä£¿é¶þ£º(2.4ºÍ2.6Äں˲âÊÔͨ¹ý)
#include
#include
#include
#include
#include
MODULE_LICENSE("GPL");
MODULE_AUTHOR("
[email=xunil@bmy]xunil@bmy[/email]
");
MODULE_DESCRIPTION("Different from others, this module automatically locate the entry of
sys_call_table !");
unsigned long *sys_call_table=NULL;
asmlinkage int (*orig_mkdir)(const char *,int);
struct _idt
{
unsigned short offset_low,segment_sel;
unsigned char reserved,flags;
unsigned short offset_high;
};
unsigned long *getscTable(){
Ïà¹ØÎĵµ£º
£¨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·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......
Ò»¡¢GCC (×î×î³£¼û:gcc hello.c –o hello) ¢Ù³£ÓÃÑ¡Ïî -c:½ö¶ÔÔ´Îļþ½øÐбàÒë
-o:¶ÔÉú³ÉµÄ´úÂë½øÐÐÓÅ»¯£¬ÓÐ0£¬1£¬2£¬3ËĸöµÈ¼¶£¬Ä¬ÈÏΪ2
-g:¼ÓÈëµ÷ÊÔÐÅÏ¢
-I dir:±àÒëÔ´ÎļþÊÇÔö¼ÓÒ»¸öËÑË÷¿âÎļþµÄĿ¼
-w:½ûÖ¹ËùÓо¯¸æ
-W warning:ÔÊÐí ......
¼¶±ð£º ³õ¼¶
·¶Ïþ¾æ (xiaoju_f@263.net), ÁªÏë(±±¾©)ÓÐÏÞ¹«Ë¾Èí¼þÉè¼ÆÖÐÐÄǶÈëʽÑз¢´¦¿ª·¢¹¤³Ìʦ, ÁªÏë(±±¾©)ÓÐÏÞ¹«Ë¾Èí¼þÉè¼ÆÖÐÐÄ
2003 Äê 8 ÔÂ 11 ÈÕ
¶ÔÓÚÒÆÖ² linux µ½ÆäËü¿ª·¢°åµÄÈËÀ´Ëµ£¬±àд boot loader ÊÇÒ»¸ö²»¿É±ÜÃâµÄ¹ý³Ì¡£¶ÔÓÚѧϰlinuxµÄÈËÀ´½²£¬±àд bootloader Ò²ÊÇÒ»¸öºÜÓÐÌôÕ½ÐԵŤ×÷¡£±¾ÎÄͨ¹ý¶Ô li ......
1£ºlinuxÏÂÅúÁ¿½«´óдĿ¼»òÎļþÃû¸ÄΪСдÃüÁî
ZIP ÏÈ´ò³É°ü£¬ZIP -r A A/*£¬ÔÙUNZIP -LL A B (A/*±íʾAĿ¼ÏµÄËùÓÐÎļþ)£¨AºÍB¶¼Îª.zipÎļþ,-LL ±ä´óдΪСдµÄ²ÎÊý£©
Ôò£¬A°üÀïµÄ´óдĿ¼ºÍÎļþ ......