Linux ÄÚ´æ°ó¶¨ÔÚ¾Ö²¿´æ´¢Æ÷µÄʵÏÖ
3.2.1 Linux ÄÚ´æ°ó¶¨ÔÚ¾Ö²¿´æ´¢Æ÷µÄʵÏÖ×ÜÌå²½Öè
×ÜÌå²½Ö裺
l ²ÉÓ÷½°¸Èý£¬ÔÚÔÚÔÀ´·ÖÎöµÄ»ù´¡ÉÏ£¬ÒÔ¼°ÒÑÖªLinuxϵͳÄÚ´æµÄ³õʼ»¯µÄÇé¿ö£¬¶ÔÄں˴úÂë½øÐÐÐ޸ģ¬Ö÷Òª°üÀ¨È·¶¨ÐÂÇøµÄ·¶Î§£¬½¨Á¢ÐÂÇø£¬ÖØжԷÖÅäÄÚ´æµÄ·ÖÅä»úÖƽøÐÐÉèÖá£
l ÐÂÇø»®·Öºó£¬¶Ôн¨µÄÁ½¸öÇø½øÐÐÒ»¶¨³Ì¶ÈÉϵÄÑÓ³Ù£»
l ½¨Á¢ÏµÍ³µ÷Óã¬ÏµÍ³µ÷Óý«ÌṩÓû§½øÐÐÊÖ¶¯ÉèÖ÷ÃÎÊ·½Ê½¡£
l ¶ÔÄں˽øÐÐÅäÖ㬲¢½øÐÐÏà¹Øµ÷ʽ¡£
l Óû§³ÌÐò½øÐÐ×îÖյIJâÊÔ£¬²¢ÑéÖ¤Ïà¹Ø½áÂÛ¡£
3.2.2 Linux Äں˰ó¶¨ÔÚ¾Ö²¿´æ´¢Æ÷´úÂëʵÏÖ
(Ò»)¡¢Ð޸ĴúÂ룺
1) ÔÚinit/main.cÕâ¸öÎļþÖÐ,ÔÚÕâÒ»¶Î´úÂë
#ifdef CONFIG_X86_LOCAL_APIC
#include <asm/smp.h>
#endif
µÄÏÂÃæÔö¼ÓÕâ¶Î´úÂë:
unsigned long max_normal_low_pfn=0;
EXPORT_SYMBOL(max_normal_low_pfn);
ÕâÀïʹÓÃEXPORT_SYMBOLÊÇÉùÃ÷max_normal_low_pfnÊÇÈ«¾Ö±äÁ¿£¬ËùÓеÄÎļþ¶¼¿ÉÒÔʹÓã¬ËüµÄÓô¦ÊÇΪÁ˱ê¼ÇÐÂÇøZONE_NORMAL_LOWµÄ×î´ó¿ÉÓõÄÒ³¿òºÅ¡£
2) arch/x86/kernel/setup.cÕâ¸öÎļþ£º
l ÔÚstruct boot_params boot_params;
#endifÖ®ºóÌí¼Ó£¬ÉùÃ÷¸Ã±äÁ¿ÒѾÔÚ±ðµÄÎļþÓж¨ÒåÁË
extern unsigned long max_normal_low_pfn;
l ÔÚsetup_arch()Õâ¸öº¯ÊýÖУ¬ÔÚfind_low_pfn_range()Õâ¸öÖ®ºó£¬Ôö¼ÓÕâÒ»¾ä£º
max_normal_low_pfn = max_low_pfn/2;
¸Ã¾äÓÃÓÚ¼ÆËãÐÂÇø(ZONE_NORMAL_LOW)µÄ×î´ó¿ÉÓÃÒ³¿òºÅ¡£
3) ÔÚarch/x86/mm/init_32.cÎļþ
l ÔÚunsigned long max_low_pfn_mapped; unsigned long max_pfn_mapped;Ö®ºóÌí¼Óextern unsigned long max_normal_low_pfn;
l ÔÚstatic void __init zone_sizes_init(void)Õâ¸öº¯ÊýÖÐÔö¼ÓÕâ¾ä´ú
Ïà¹ØÎĵµ£º
linuxϵĵ÷ÊÔ¹¤¾ß
Ëæ×ÅXPµÄÁ÷ÐУ¬ÈËÃÇÔ½À´Ô½×¢ÖØÈí¼þµÄÇ°ÆÚÉè¼Æ¡¢ºóÆÚµÄʵÏÖ£¬ÒÔ¼°¹á´©ÓÚÆäÖеIJâÊÔ¹¤×÷£¬¾¹ýÕâ¸ö¹ý³Ì³öÀ´µÄ×ÔÈ»ÊǸßÖÊÁ¿µÄÈí¼þ¡£ÉõÖÁÓÐÈËÉù³ÆXP »áÌÔ̵÷ÊÔÆ÷£¡Õ⵱ȻÊÇÓÐÒ»¶¨µÀÀíµÄ£¬È»¶ø¾ÍÄ¿Ç°µÄÏÖʵÀ´¿´£¬Õ⻹ÊÇÒ»ÖÖÀíÏë¡£ÔÚÈÕ³£¹¤×÷ÖУ¬µ÷ÊÔ¹¤¾ß»¹ÊDZز»¿ÉÉٵġ£ÔÚLinuxÏ£¬µ÷ÊÔ¹¤¾ ......
Linux
2.6Äں˵ÄÒ»¸öÖØÒªÌØÉ«ÊÇÌṩÁËͳһµÄÄÚºËÉ豸ģÐÍ¡£Ëæ׿¼ÊõµÄ²»¶Ï½ø²½£¬ÏµÍ³µÄÍØÆ˽ṹԽÀ´Ô½¸´ÔÓ£¬¶ÔÖÇÄܵçÔ´¹ÜÀí¡¢ÈȲå°ÎÒÔ¼°plug and
playµÄÖ§³ÖÒªÇóÒ²Ô½À´Ô½¸ß£¬2.4ÄÚºËÒѾÄÑÒÔÂú×ãÕâЩÐèÇó¡£ÎªÊÊÓ¦ÕâÖÖÐÎÊƵÄÐèÒª£¬2.6Äں˿ª·¢ÁËȫеÄÉ豸ģÐÍ¡£
£±£® SysfsÎļþϵͳ
SysfsÎļþϵͳÊÇÒ»¸öÀàËÆÓÚprocÎļþÏ ......
ÔÚlinuxÏÂһЩ³£ÓõĹػú/ÖØÆôÃüÁîÓÐshutdown¡¢halt¡¢reboot¡¢¼°init£¬ËüÃǶ¼¿ÉÒÔ´ïµ½ÖØÆôϵͳµÄÄ¿µÄ£¬µ«Ã¿¸öÃüÁîµÄÄÚ²¿¹¤×÷¹ý³ÌÊDz»Í¬µÄ£¬Í¨¹ý±¾ÎĵĽéÉÜ£¬Ï£ÍûÄã¿ÉÒÔ¸ü¼ÓÁé»îµÄÔËÓø÷ÖֹػúÃüÁî¡£
¡¡¡¡ 1.shutdown
shutdownÃüÁȫµØ½«ÏµÍ³¹Ø»ú¡£ ÓÐЩÓû§»áʹÓÃÖ±½Ó¶ÏµôµçÔ´µÄ·½Ê½À´¹Ø±Õlinux£¬ÕâÊÇÊ®·Ö ......
3.2.1 Linux ÄÚ´æ°ó¶¨ÔÚ¾Ö²¿´æ´¢Æ÷µÄʵÏÖ×ÜÌå²½Öè
×ÜÌå²½Ö裺
l ²ÉÓ÷½°¸Èý£¬ÔÚÔÚÔÀ´·ÖÎöµÄ»ù´¡ÉÏ£¬ÒÔ¼°ÒÑÖªLinuxϵͳÄÚ´æµÄ³õʼ»¯µÄÇé¿ö£¬¶ÔÄں˴úÂë½øÐÐÐ޸ģ¬Ö÷Òª°üÀ¨È·¶¨ÐÂÇøµÄ·¶Î§£¬½¨Á¢ÐÂÇø£¬ÖØжԷÖÅäÄÚ´æµÄ·ÖÅä»úÖƽøÐÐÉèÖá£
l &n ......