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

LinuxÄÚ´æÏßÐÔµØÖ·¿Õ¼ä²¼¾Ö½âÎö


 
LinuxÄÚ´æÏßÐÔµØÖ·¿Õ¼ä´óСΪ4GB£¬·ÖΪ2¸ö²¿·Ö£ºÓû§¿Õ¼ä²¿·Ö£¨Í¨³£ÊÇ3G£©ºÍÄں˿ռ䲿·Ö£¨Í¨³£ÊÇ1G£©¡£ÔÚ´ËÎÒÃÇÖ÷Òª¹Ø×¢Äں˵ØÖ·¿Õ¼ä²¿·Ö¡£
ÄÚºËͨ¹ýÄÚºËҳȫ¾ÖĿ¼À´¹ÜÀíËùÓеÄÎïÀíÄڴ棬ÓÉÓÚÏßÐÔµØÖ·Ç°3G¿Õ¼äΪÓû§Ê¹Óã¬ÄÚºËҳȫ¾ÖĿ¼ǰ768Ï¸ÕºÃ3G£©³ý0¡¢1Á½ÏîÍâÈ«²¿Îª0£¬ºó256Ï1G£©ÓÃÀ´¹ÜÀíËùÓеÄÎïÀíÄÚ´æ¡£ÄÚºËҳȫ¾ÖĿ¼ÔÚ±àÒëʱ¾²Ì¬µØ¶¨ÒåΪswapper_pg_dirÊý×飬¸ÃÊý×é´ÓÎïÀíÄÚ´æµØÖ·0x101000´¦¿ªÊ¼´æ·Å¡£
ÓÉͼ¿É¼û£¬ÄÚºËÏßÐÔµØÖ·¿Õ¼ä²¿·Ö´ÓPAGE_OFFSET£¨Í¨³£¶¨ÒåΪ3G£©¿ªÊ¼£¬ÎªÁ˽«ÄÚºË×°ÈëÄڴ棬´ÓPAGE_OFFSET¿ªÊ¼8MÏßÐÔµØÖ·ÓÃÀ´Ó³ÉäÄÚºËËùÔÚµÄÎïÀíÄÚ´æµØÖ·£»½ÓÏÂÀ´ÊÇmem_mapÊý×飬mem_mapµÄÆðʼÏßÐÔµØÖ·ÓëÌåϵ½á¹¹Ïà¹Ø£¬±ÈÈç¶ÔÓÚUMA½á¹¹£¬ÓÉÓÚ´ÓPAGE_OFFSET¿ªÊ¼16MÏßÐÔµØÖ·¿Õ¼ä¶ÔÓ¦µÄ16MÎïÀíµØÖ·¿Õ¼äÊÇDMAÇø£¬mem_mapÊý×éͨ³£¿ªÊ¼ÓÚPAGE_OFFSET+16MµÄÏßÐÔµØÖ·£»´ÓPAGE_OFFSET¿ªÊ¼µ½VMALLOC_START – VMALLOC_OFFSETµÄÏßÐÔµØÖ·¿Õ¼äÖ±½ÓÓ³Éäµ½ÎïÀíÄÚ´æ¿Õ¼ä£¨Ò»Ò»¶ÔÓ¦Ó°É䣬ÎïÀíµØÖ·<==>ÏßÐÔµØÖ·-PAGE_OFFSET£©£¬Õâ¶ÎÇøÓòµÄ´óСºÍ»úÆ÷ʵ¼ÊÓµÓеÄÎïÀíÄÚ´æ´óСÓйأ¬Õâ¶ùVMALLOC_OFFSETÔÚX86ÉÏΪ8M£¬Ö÷ÒªÓÃÀ´·ÀÖ¹Ô½½ç´íÎó£»ÔÚÄÚ´æ±È½ÏСµÄϵͳÉÏ£¬ÓàϵÄÏßÐÔµØÖ·¿Õ¼ä£¨»¹ÒªÔÙ¼õÈ¥¿Õ°×Çø¼´VMALLOC_OFFSET£©±»vmalloc()º¯ÊýÓÃÀ´°Ñ²»Á¬ÐøµÄÎïÀíµØÖ·¿Õ¼äÓ³Éäµ½Á¬ÐøµÄÏßÐÔµØÖ·¿Õ¼äÉÏ£¬ÔÚÄÚ´æ±È½Ï´óµÄϵͳÉÏ£¬vmalloc()ʹÓôÓVMALLOC_STARTµ½VMALLOC_END£¨Ò²¼´PKMAP_BASE¼õÈ¥2Ò³µÄ¿Õ°×Ò³´óСPAGE_SIZE£©µÄÏßÐÔµØÖ·¿Õ¼ä£¬´ËʱÓàϵÄÏßÐÔµØÖ·¿Õ¼ä£¨»¹ÒªÔÙ¼õÈ¥2Ò³µÄ¿Õ°×Çø¼´VMALLOC_OFFSET£©ÓÖ¿ÉÒÔ·Ö³É2²¿·Ö£ºµÚÒ»²¿·Ö´ÓPKMAP_BASEµ½FIXADDR_STARTÓÃÀ´ÓÉkmap()º¯ÊýÀ´½¨Á¢ÓÀ¾ÃÓ³Éä¸ß¶ËÄڴ棻µÚ¶þ²¿·Ö£¬´ÓFIXADDR_STARTµ½FIXADDR_TOP£¬ÕâÊÇÒ»¸ö¹Ì¶¨´óСµÄÁÙʱӳÉäÏßÐÔµØÖ·¿Õ¼ä£¬£¨ÒýÓãºFixed virtual addresses are needed for subsystems that need to know the virtual address at compile time such as the APIC£©£¬ÔÚX86Ìåϵ½á¹¹ÉÏ£¬FIXADDR_TOP±»¾²Ì¬¶¨ÒåΪ0xFFFFE000,´ËʱÕâ¸ö¹Ì¶¨´óС¿Õ¼ä½áÊøÓÚÕû¸öÏßÐÔµØÖ·¿Õ¼ä×îºó4KÇ°Ã棬¸Ã¹Ì¶¨´óС¿Õ¼ä´óСÊÇÔÚ±àÒëʱ¼ÆËã³öÀ´²¢´æ´¢ÔÚ__FIXADDR_SIZE±äÁ¿ÖС£
ÕýÊÇÓÉÓÚvmalloc()ʹÓÃÇø¡¢kmap()ʹÓÃÇø¼°¹Ì¶¨´óСÇø£¨kmap_atomic()ʹÓÃÇø£©µÄ´æÔÚ²ÅʹZONE_NORMALÇø´óСÊܵ½ÏÞÖÆ£¬ÓÉÓÚÄÚºËÔÚÔËÐÐʱÐèÒªÕâЩº¯Êý£¬Òò´ËÔÚÏßÐÔµØÖ·¿Õ¼äÖÐÖÁÉÙÒªVMALLOC_RESERVE´óСµÄ¿Õ¼ä¡£VMALLOC_RES


Ïà¹ØÎĵµ£º

´ÓÒ»µÀÃæÊÔÌâ̸LinuxÏÂforkµÄÔËÐлúÖÆ

ijÍâÆóÃæÊÔlinux¿ª·¢Ö°Î»ÃæÊÔÌ⣺
¸ø³öÈçÏÂC³ÌÐò£¬ÔÚlinuxÏÂʹÓÃgcc±àÒ룺
#include "stdio.h"
#include "sys/types.h"
#include "unistd.h"
int main(void)
{
pid_t pid1;
pid_t pid2;
pid1 = fork();
pid2 = fork();
printf("pid1:%d, pid2:%d\n", pid1, pid2);
}

    ......

linuxϵͳ½Å±¾µÄ³£¼ûÆô¶¯Ë³Ðò(FW)


ÓÉÓÚÏà¹Ø±äÁ¿¶¨Ò岻ͬ,
ËùÒÔÒÔÏÂÆô¶¯Ë³Ðò½ö¹©²Î¿¼
ÔÚRedhat
Redflag centos fc linuxϵͳÀïÃæ½Å±¾µÄÆô¶¯
ÏȺó£º
µÚÒ»²½£ºÍ¨¹ý/boot/vm½øÐÐ
Æô¶¯ vmlinuz
µÚ¶þ²½£ºinit /etc/inittab
µÚÈý²½£ºÆô¶¯ÏàÓ¦µÄ½Å±¾£¬²¢ÇÒ´ò¿ªÖÕ¶Ë
rc.sysinit
rc.d(Àï
ÃæµÄ½Å±¾£©
rc.local
µÚËIJ½£ºÆô¶¯loginµÇ¼½çÃæ login
µÚÎå² ......

LinuxÏÂmysqlÖÐÎÄÂÒÂë½â¾ö·½·¨

ÉÏ´ÎÔÚÅöµ½ÕâÎÊÌ⣬ÔÚÍøÉÏÕÒÁ˽â¾ö·½·¨£¬¿ÉÊÇû¼ÇÏÂÀ´¡£ÕâÐÇÆÚÒª»»»úÆ÷£¬Òª°ÑÔ­À´linuxϵÄmysqlÊý¾Ý¿âÒƵ½Áíһ̨·þÎñÆ÷ÉÏ¡£°²×°suseϵͳ¡¢ÔÙÅäÖÃtelnet¡¢ftp·þÎñ¡¢°²×°java JDK²¢ÅäÖá¢ÔÙ°²×°eclipseºÍmysql,ÓÖ»¨ÁËÒ»ÌìµÄʱ¼ä¡£¸Ð¾õ»¹ÊDz»ÊìÁ·£¬ÅäÖ÷À»ðǽÀÏÊDz»Äܽ«telnetºÍftp·þÎñÅÅÍâ¡£mysqlÓÖÅöµ½ÁËÖÐÎÄÂÒÂëÎÊÌ⣬ÓÖÔÚ ......

×è°­LinuxÔÚÖйú·¢Õ¹µÄÒòËØ

     
     Linux²»Êǽâ¾öÖйú·¢Õ¹¹ý³ÌÖдæÔÚµÄËùÓÐÎÊÌâµÄÍòÄÜÒ©£¬ËüÖ»ÊÇΪÎÒÃÇÌṩÁËÒ»¸ö¿ÉÒÔÃ÷ÏÔ½µµÍ³É±¾¡¢´Ù½ø¹ú¼ÊºÏ×÷ºÍ»ñµÃ¸ü¹ãÀ«·¢Õ¹Ç°¾°µÄÑ¡ÏîÖ®Ò»¡£Í¨³£Çé¿öÏ£¬¹ÍÓùúÍâÓÅÐã¹ÜÀíºÍ¼¼ÊõÈËÔ±ËùÐèµÄ·ÑÓûá¸ßµÄ¾ªÈË¡£²»½öÒªÏòÕâЩÈËÖ§¸¶¸ß¶îµÄ³ê½ð£¬Í¬Ê±ÒªÎªËûÃÇÓªÔìÒ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ