LinuxÖ´ÐÐÒÔ¼°ÐéÄâÄÚ´æÖ®ÓÃ
Linux Execution and Virtual Memory Utilization
LinuxÖ´ÐÐÒÔ¼°ÐéÄâÄÚ´æÖ®ÓÃ
When Linux boots, it starts with the MMU disabled, so initially it deals only with physical
memory. The kernel image is copied to physical address 0x8000 in DRAM and executed. First a master page table is created and placed just before the kernel, which describes all available DRAM. The MMU is then switched on, mapping all of DRAM to virtual address 0xC0000000. The kernel reserves 64K of virtual memory for the interrupt handler code (usually at the very top of virtual memory), and sets up all the mappings for the hardware registers (UART, USB, LCD, GPIO, etc). Once kernel space is established and all drivers are initialized, the linux kernel moves on to establishing user space. This involves reading in the file system and actually executing processes.
µ±LinuxÆô¶¯Ê±£¬ÊÇÒÔMMU½ûÓÃÀ´¿ªÆôËüµÄÂÃ;µÄ£¬Òò´Ë£¬ËüÆð³õÖ»¹Ø×¢ÎïÀíÄÚ´æ¡£ÄÚºËÓ³Ïñ£¨kernel image£©±»¿½±´µ½DRAMµÄÎïÀíµØÖ· 0x8000´¦£¬²¢µÃµ½Ö´ÐÐȨ¡£µÚÒ»¸öÖ÷Ò³±í£¨ master page table£©´Ó¶øµ®Éú£¬²¢½ô°¤×ÅÄÚºËÓ³Ïñ´æ·Å£¬Õâ¸öÒ³±íÊǶÔÈ«²¿¿ÉÓÃDRAMµÄÃèÊö¡£´Ëºó£¬MMU±»ÆôÓ㬴Ӷø°ÑÈ«²¿DRAMÓ³Éäµ½´Ó0xC0000000¿ªÊ¼µÄÐéµØÖ·¡£ÄÚºËΪÖжϴ¦Àí³ÌÐò±£Áô64KÐéÄâÄڴ棨ͨ³£ÔÚÐéÄâÄÚ´æµÄ¶¥¶Ë£©£¬È»ºóΪËùÓеÄÓ²¼þ¼Ä´æÆ÷(UART, USB, LCD, GPIO, etc)½¨Á¢Ó³Éä¡£Ò»µ©Äں˿ռ佨Á¢ÆðÀ´£¬²¢ÇÒËùÓеÄÇý¶¯³ÌÐò¶¼±»³õʼ»¯£¬ÔòLinuxÄÚºËתÏò½¨Á¢Óû§¿Õ¼ä¡£ÕâÉæ¼°µ½ÔÚÎļþϵͳÖжÁÈ¡²¢Êµ¼ÊÖ´Ðнø³Ì¡£
Each process that runs on the system does so in its own memory “context”. Each context
has its virtual memory space established and maintained by the kernel using a separate page table. So each process can “see” the entire user space, but its underlying physical memory is different from the other processes. Multiple processes and their contexts are run in time slices. This means that each process executes for a time, then is halted, and execution is passed to the next process in a rotating queue. The act of passing execution is called “context switching&r
Ïà¹ØÎĵµ£º
ÍøÉϺܶàÌû×ÓÎÊxhellÁ¬½ÓlinuxÖÐÎÄÂÒÂ룬¾ø´ó²¿·ÖÊǽ«LANGÊôÐÔÖµÉèÖÃÓ¢ÎÄ£¬¼´export LANG=en_US.UTF-8;
µ«ÊÇÎÒÃǽ«ÏµÍ³ÉèÖÃΪÖÐÎÄ£¬µ±È»ÊÇÒòΪ×Ô¼ºÓÃÖÐÎÄ¿ÉÒÔÌá¸ßЧÂÊ£¬¼õÉÙ³ö´í¡£
ÕâÖÖ·½Ê½Ö»ÄÜÖα겻ÄÜÖα¾£¬Ï´ÎʹÓÃsshÁ¬linuxʱ»¹ÊÇ»áÂÒÂ룬
ÏÖÔÚ½«ÎÒ×Ô¼ºµÄ½â¾ö·½Ê½¹²Ïí¸ø´ó¼Ò¡£
±à¼/etc/sysconfig/i18n
½«ÎļþÖе ......
ÒÔÏÂÔÚcentos5.3ÉÏʵÑé¡£ÔÚlinuxÖÐsignalº¯ÊýÊÇͨ¹ýµ÷ÓÃsigactionÀ´ÊµÏֵģ¬ÓÉ´ËËü²»´æÔÚÐźŶªÊ§ÒÔ¼°Ã¿´ÎÐźŴ¦Àíºó»á°ÑÐźŴ¦Àí¸Ä³ÉĬÈÏ´¦Àí·½Ê½¡£µ«¶ÔÓÚϵͳµ÷Óú¯Êý±»ÐźŴò¶Ïʱ£¬ÏµÍ³µ÷ÓÃÊÇ·ñ»á×Ô¶¯Æô¶¯ºÃÏñûÔõô˵Ã÷¡£²»¹ý¿ÉÒÔ×Ô¼º¶¯ÊÖ¿´Ò»Ï£º
signal(SIGTERM, term_handle ......
NFSÍøÂçÎļþϵͳÊÇͨ¹ýÎļþϵͳʵÏÖ×ÊÔ´¹²ÏíµÄÒ»ÖÖ×îÖØÒªµÄ·½Ê½¡£
c/s ¿Í»§»ú ·þÎñÆ÷
B/S ä¯ÀÀÆ÷ ·þÎñÆ÷
NFS·þÎñ¶ËÅäÖãº
±à¼/etc/exportsÎļþÒÔÅäÖÿª·Å·¾¶¡£/home/share 192.168.0.123£¨ro£©/(rw).
/etc/init.d/portmap restart
/etc/init.d/nfs&nb ......
#!/bin/bash
while getopts "ab:cd:" Option
# b and d take arguments
#
do
case $Option in
a) echo -e "a = $OPTIND";;
b) echo -e "b = $OPTIND $OPTARG";;
c) echo -e "c = $OPTIND";;
d) echo -e "d = $OPTIND $OPTARG";;
esac
done
shift $(($OPTIND - 1)) ......
-------------------------------------------------------------------------------------------------------
//By:yuyongbao
//QQ:673360056
//ƽ̨powerpc mpc8379e linux 2.6.22
£±¡¢ÏÈÓÃfdisk ¸øÓ²ÅÌ·ÖÒ»¸öÇø£¬ÓÃ×÷Îļþϵͳ¡£²ÎÕÕu-boot-ppc±àÒë˵Ã÷Ò»ÎÄ¡£
£²¡¢ÓÃmke2fs¸ñʽ»¯Ó²Å̵ÄÒ»¸ö·ÖÇømke2fs /dev/sd ......