ÈçºÎÔÚUbuntu±àÒëLinuxÄÚºË
Ê×ÏÈÐèÒªÏÂÔØLinux kernel£¬ÔÚwww.kernel.orgÀïÃæÏÂÔØ¡£È»ºóÐèÒª°²×°kernel-package£¬fakeroot¡£ÕâÑù×¼±¸¹¤×÷¾ÍÍê³ÉÁË¡£
ÏÂÃ濪ʼÄں˵ÄÅäÖá£×îÖØÒªµÄÒ»µãÊÇÈ¥µôkenerl hackingÑ¡ÏÏÂÃæµÄ“±àÒëÄں˴øÓÐdebugÐÅÏ¢”Ñ¡Ï·ñÔò±àÒë³öÀ´µÄÄÚºËÎÞ±ÈÅÓ´ó
¡£È»ºó¸ù¾Ý¸öÈËÐèҪȥµôһЩÇý¶¯¡£²»¹ý±ØÐëÇå³þÖªµÀ×Ô¼ºÔÚ¸Éʲô£¬·ñÔòÆô¶¯²»ÁËÊǺÜÕý³£µÄ¡£
Òò
Ϊ´ó²¿·Ö»úÆ÷¶¼ÊǶàºËµÄÁË£¬ËùÓжà¸öjobͬʱ½øÐÐÄÜÓÐЧµØÌá¸ßЧÂÊ¡£¿ÉÒÔexport±äÁ¿CONCURRENCY_LEVEL=£££¨££Îª¹¤×÷µÄÊýÄ¿£¬Ê®
½øÖÆ£©£¬À´ÉèÖÃͬʱ½øÐеŤ×÷Êý¡£¼ÙÈçÄãµÄUÊÇË«ºË£¬¶øÓÖÏëÔÚ±àÒëµÄʱºòÉÏÉÏÍøÖ®À࣬ÉèÖÃΪ2¡£ÈôÏëÈ«Á¦¿ª¹¤£¬ÉèÖÃΪ3¡£ÕâÊÇÒòΪ½ø³ÌµÄ´´½¨ÐèҪһЩÏû
ºÄ£¬¸ü¶àµÄ½ø³Ì²ÅÄÜÍêÕûµØÏûºÄÍêCPU¡£ÕâÑùÖ´ÐÐmake-kpkgÃüÁ fakeroot make-kpkg --initrd
--append_to_version=-lin20070227 kernel_image kernel_headers
ÆäÖÐappend_to_versionÑ¡ÏîÊǸöÈËϲºÃ£¬»¹ÓÐkernel_imageºÍkernel_headersµÄλÖò»Äܵ÷»»¡£
±àÒëºÃ£¬Ë«»÷°²×°imageºÍheaders¡£ÖØÆô£¨±ØÐ룩
¡£
×îºóÒ»²¿ÊÇÉèÖÃ/lib/module/`uname --kernel-release`ÀïÃæµÄbuild·ûºÅÁ´½Ó£¬°ÑËüÐÞ¸ÄΪ/usr/src/linux-headers-`uname --kernel-release`/
enjoy!
Ïà¹ØÎĵµ£º
1.ÔÚ´æ·Å¹²ÏíÎļþµÄ·þÎñÆ÷ÉèÖù²ÏíÎļþ¼Ð,
1) ¸ü¸Ä/etc/exports Îļþ, ½«ÐèÒª¹²ÏíµÄÎļþ¼ÐÉèÖóɹ²ÏíĿ¼,rw´ú±í¿É¶Á¿Éд,sync´ú±íͬ²½µÄÒâ˼,Ç°ÃæµÄ*±íʾËùÓÐIP¶¼¿ÉÒÔ·ÃÎÊ
/tmp/update *(rw,sync)
/opt/orabackup/prd *(root_squash,rw,sync)
&n ......
½ø³Ìƪ
²é¿´Ä³½ø³Ì¶Ë¿ÚºÅ
netstat -anp | grep 80
lsof -i :port
Àý£º ×¢Òâ":"ºó£¬½ô¸ú¶Ë¿ÚºÅ£¬Ã»Óпոñ
#lsof -i :443
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
java 2731 root 35u IPv6 7778 TCP *:https (LI ......
C×Ö·û´®´¦Àíº¯ÊýµÄʵÏÖ£¨Linux£©
#include <stddef.h>
char * ___strtok = NULL;
char * strcpy(char * dest,const char *src)
{
char *tmp = dest;
while ((*dest++ = *src++) != '\0')
/* nothing */;
return tmp;
}
char * strncpy(char * des ......
LinuxÏÂCºÍC++¿ª·¢»ù´¡
»ù±¾±à³Ì¸ÅÄî
n ±à³ÌÓïÑÔ£ºC ¡¢C++
n ±àÒë(compile)£ºÔ´Îļþ£¨.c£©->Ä¿±êÎļþ(.o)
n Á¬½Ó(link)£ºÄ¿±êÎļþ(.o)->¿ÉÖ´ÐÐÎļþ
n ¿â(library)£º¾²Ì¬Á¬½Ó¿â(.a)¡¢¶¯Ì¬Á¬½Ó¿â(.so)
LinuxÏ¿ª·¢¹¤¾ß
n±à¼Æ÷£ºvi¡¢emacs¡¢´°¿Ú±à¼Æ÷
n±àÒëÆ÷£ºGCC
nµ÷ÊÔÆ÷£ºGDB
n¿ÉÖ´ÐÐÎļþ¹¤¾ß£ ......