Linux ã«ã¼ãã«ããã¯ãå§ããåã«ç¥ã£ã¦ãããããã¨
ã«ã¼ãã«ããã¯ã®å ¥éçãªå 容ã«ã¤ãã¦ããã¾ãã¾ã¨ã¾ã£ãæ å ±ããªãããã«æã£ãã®ã§ãè¨äºã«ãã¦ã¿ããã¨æãã¾ããã
ããããåå¼·ãå§ãã¦ã¿ããã¨æãããæ¹ã®åèã«ãªãã°å¹¸ãã§ãã
ã¦ã¼ã¶ã¼ç©ºéã¨ã«ã¼ãã«ç©ºé
Linux ã®ãã㪠UNIX ç³» OS ã§ã¯ãã¦ã¼ã¶ã¼ç©ºéã¨ã«ã¼ãã«ç©ºéã¨ãã°ããï¼ç¨®é¡ã®ç©ºéã§ããã°ã©ã ãå®è¡ãã¾ãã
ã¦ã¼ã¶ã¼ç©ºéã§å®è¡ãããããã°ã©ã ã¯ãã¦ã¼ã¶ã¼ç©ºéã¢ããªã±ã¼ã·ã§ã³ã¨ãå¼ã°ããæ¥é å©ç¨ãã¦ããå¤ãã®ã¢ããªã±ã¼ã·ã§ã³ãä¾ãã°ããã©ã¦ã¶ãWeb ãµã¼ãã¼ãOffice ã½ããã¦ã§ã¢ã¯ã¦ã¼ã¶ã¼ç©ºéã§åä½ãããã®ã§ãã
ã«ã¼ãã«ç©ºéã§å®è¡ãããããã°ã©ã ã¯ãã¾ãã«ã«ã¼ãã«ã§ãOS ã¨å¼ã°ããé¨åã«ãããã¾ãã
ã¦ã¼ã¶ã¼ç©ºéã¨ã«ã¼ãã«ç©ºéã®å¤§ããªéãã¯ãã¦ã¼ã¶ã¼ç©ºéã§å®è¡ãããããã°ã©ã ã«ã¤ãã¦ã¯ãCPU æ©è½ã«ãã£ã¦ãã§ãããã¨ãå¶éããã¦ããä¸æ¹ãã«ã¼ãã«ç©ºéã§å®è¡ãããããã°ã©ã ã«ã¯ããã®å¶éããªãç¹ã«ããã¾ãã
| User-space Application | <= Unprivileged -------------------------- | Kernel | <= Privileged
ä¿è·æ©è½
ãã®ããã«ãããã°ã©ã ãäºã¤ã®ç©ºéã«åãã¦å®è¡ãã大ããªçç±ã®ä¸ã¤ã¯ãã·ã¹ãã å ¨ä½ãä¿è·ãããã¨ã§ãã
æ³åãé£ãããããã¾ããããã³ã³ãã¥ã¼ã¿ã¼ã§ã¯ãããã°ã©ã ã«ãã£ã¦ä¸é©åãªæä½ãè¡ãã¨ãã·ã¹ãã å ¨ä½ãæ©è½åæ¢ç¶æ ã«ãããã¨ãã§ãã¾ããããã¯ãæå³çã§ã¯ãªãã¦ããããã°ã©ã ã®ãã°çã«ãã£ã¦ã·ã¹ãã å ¨ä½ãåæ¢ã§ãããã¨ãæå³ãã¾ãã
Linux ã®ãã㪠UNIX ç³» OS ã§ã¯ããªãã¹ãã·ã¹ãã å ¨ä½ãæ©è½åæ¢ããªãã§åä½ãç¶ããããããã«ããããã®ã¢ããã¼ãã¨ãã¦ãæ¬å½ã«å¿ è¦ãªå ´åãé¤ãã¦ãä¸é©åãªåä½ãããããå®è¡ã§ããªãããã«ãããã¨ããæ¦ç¥ãã¨ã£ã¦ãã¾ãã
å ·ä½çã«ã¯ãããã°ã©ã ã®å¤§é¨åãã¦ã¼ã¶ã¼ç©ºéã§å®è¡ãããã°ããªãä¿¡é ¼ã«è¶³ãããã°ã©ã ã ããã«ã¼ãã«ç©ºéã§å®è¡ãã¾ãã
ãã®æ¦ç¥ã«ããã¦ãã¦ã¼ã¶ã¼ç©ºéã§ã¯ãã·ã¹ãã å ¨ä½ã«å½±é¿ãä¸ããããæä½ãã§ããªãããã«å¶éããã¦ãããããã¦ã¼ã¶ã¼ç©ºéããã°ã©ã ã¯ãã°ã ãã§ã¯ãªãæªæããã£ã¦ããã·ã¹ãã ãç ´å£ã§ããªãããã«ãªã£ã¦ãã¾ãã
ã¦ã¼ã¶ã¼ç©ºéã«ããã¦å¶éãããæä½
ã¦ã¼ã¶ã¼ç©ºéã§ã¯ã主ã«ï¼ç¹ãCPU ã®ç¹æ¨©å½ä»¤ãçºè¡ã§ããªããã¾ããéãããã¡ã¢ãªé å以å¤ã«ã¢ã¯ã»ã¹ã§ããªããã¨ããå¶éãããã¾ãã
å ·ä½çã«ã¯ãä¾ãã°ãååæ¼ç®ã¯ç¹æ¨©å½ä»¤ã§ã¯ããã¾ããããCPU ãã·ã£ãããã¦ã³ããå½ä»¤ã¯ç¹æ¨©å½ä»¤ã§ãã
ã¾ããããã¤ã¹ã®å ¥åºåã«é¢ããç®æãç¹æ¨©å½ä»¤ããããã¯ç¹å®ã®ã¡ã¢ãªé åã¸ã®ã¢ã¯ã»ã¹ãå¿ è¦ã¨ãªããããé常ãã¦ã¼ã¶ã¼ç©ºéããã¯ç´æ¥ããã¤ã¹ã®æä½ãè¡ããã¨ã¯ã§ãã¾ããã
ã·ã¹ãã ã³ã¼ã«
CPU ã®ç¹æ¨©å½ä»¤ã¨ãã¡ã¢ãªã¢ã¯ã»ã¹ãå¶éãããå ´åããã®ã¾ã¾ã§ã¯ã¦ã¼ã¶ã¼ç©ºéããã°ã©ã ã¯ç°¡åãªé»åããã°ã©ã ããå®è¡ã§ãã¾ããããã¼ãã¼ããããã¤ã¹ã®ä¸ç¨®ãªã®ã§å ¥åã¯ç¹æ¨©ããªããã°åãåããªãä¸ãçµæããã£ã¹ãã¬ã¤ã¸åºåããããã«ãç¹æ¨©ãå¿ è¦ã ããã§ãã
ã«ã¼ãã«ã¯ãã¦ã¼ã¶ã¼ç©ºéããã°ã©ã ããæ©è½ãå¶éãããç¶æ ã§ãç¹æ¨©ãå¿ è¦ãªæ©è½ã«ã¢ã¯ã»ã¹ã§ããããã«ãCPUãããã¤ã¹ã¨ã¦ã¼ã¶ã¼ç©ºéããã°ã©ã ã仲ä»ãã¾ãã
ã¦ã¼ã¶ã¼ç©ºéããã°ã©ã ããç¹æ¨©ãå¿ è¦ãªæ©è½ã¸ã¢ã¯ã»ã¹ããå ´åã«ã¯ãé常ãã·ã¹ãã ã³ã¼ã«ã¨å¼ã°ããç¹æ®ãªé¢æ°ãã³ã¼ã«ãã¾ãã
ã¦ã¼ã¶ã¼ç©ºéããã°ã©ã ããã·ã¹ãã ã³ã¼ã«ãå¼ã³åºãã¨ã対å¿ããã«ã¼ãã«ç©ºéå é¨ã®é¢æ°ã«å¦çã移è¡ããç¹æ¨©ã®ããç¶æ ã§ã«ã¼ãã«ç©ºéã®ããã°ã©ã ãå®è¡ã§ãã¾ãã
ã¦ã¼ã¶ã¼ç©ºéããä»»æã®ã·ã¹ãã ã³ã¼ã«ãã«ã¼ãã«ç©ºéã§å®è¡ã§ããã®ã§ãä¿è·æ©è½ã«é¢ãã¦è¨ãã¨æ¬æ«è»¢åã«è¦ããããããã¾ããããã·ã¹ãã ã³ã¼ã«ã«å¯¾å¿ããé¢æ°ã®å®è£ ã¯ãã«ã¼ãã«ã®ä¸é¨ãªã®ã§ãã¦ã¼ã¶ã¼ç©ºéã¯ãã·ã¹ãã ã³ã¼ã«èªä½ã®å¦çãæ¹å¤ãããã¨ã¯ã§ãããã·ã¹ãã ã³ã¼ã«ã®å®è£ èªä½ã«åé¡ããªããã°ãã¦ã¼ã¶ã¼ç©ºéããã«ã¼ãã«ããã³ãã·ã¹ãã å ¨ä½ã«æªå½±é¿ãä¸ãããã¨ã¯ã§ãã¾ããã
ã·ã¹ãã ã³ã¼ã«ã¨ããä»çµã¿ãç¨ããããçç±ã¯ãã¦ã¼ã¶ã¼ç©ºéãã決ããããæ¹æ³ï¼ã¤ã¾ããã·ã¹ãã ã³ã¼ã«ï¼ä»¥å¤ã§ã«ã¼ãã«ç©ºéã®æ©è½ã«ã¢ã¯ã»ã¹ã§ããªãããã«ããããã§ãã
ã¦ã¼ã¶ã¼ç©ºéããã°ã©ã ã¯ãã·ã¹ãã ã³ã¼ã«ä»¥å¤ã§ã«ã¼ãã«ç©ºéã®æ©è½ã«ã¢ã¯ã»ã¹ã§ããªãã®ã§ãã«ã¼ãã«ã¯ãæ°ã«éããããã·ã¹ãã ã³ã¼ã«ã ãé©åã«å®è£ ããã°ã·ã¹ãã å ¨ä½ã®æ©è½ã®å®å ¨æ§ãæ ä¿ã§ãã¾ãã
| User-space Application | <= Unprivileged | ||| | -----< system call >------ | ||| | | Kernel | <= Privileged
ã«ã¼ãã«å é¨ã«å®è£ ãããæ©è½
ã«ã¼ãã«ã¯ãã¦ã¼ã¶ã¼ç©ºéã§å®è¡ã§ããªã CPU ã®ç¹æ¨©å½ä»¤ã¨ã¡ã¢ãªã¢ã¯ã»ã¹ãã¾ãããããã使ã£ãããã¤ã¹ã¸ã®ã¢ã¯ã»ã¹ãçµã¿åããã¦ãã¦ã¼ã¶ã¼ç©ºéã§åä½ããããã°ã©ã ãå¹çããã¢ããªã±ã¼ã·ã§ã³æ©è½ãå®è£ ã§ãããããªä»çµã¿ãæä¾ãã¾ãã
ã©ã®ãããªæ©è½ãã«ã¼ãã«å ã«å®è£ ãã¹ããã¨ããè°è«ã¯å¤ãããããã¾ãããUNIX 系㮠OS ã§ã¯ä»¥ä¸ã®ãããªæ©è½ãã«ã¼ãã«ã®ä¸é¨ã¨ãã¦å®è£ ããã¦ãã¾ããï¼ä»ã«ãããããããã¾ããï¼
- ããã»ã¹ã¹ã±ã¸ã¥ã¼ã©
- ã¡ã¢ãªç®¡ç
- ãããã¯ã¼ã¯ã¹ã¿ãã¯
- ãã¡ã¤ã«ã·ã¹ãã
- ããã¤ã¹ãã©ã¤ã
- ä»®æ³åãµãã¼ã
| User-space Application | <= Unprivileged | ||| | -----< system call >------ | ||| | | Kernel | <= Privileged - Scheduler - Memory Management - Network Stack - File System ...
ä¸è¨ã®æ©è½ã¯ãå¿ è¦ã«å¿ãã¦ãã·ã¹ãã ã³ã¼ã«ãéãã¦ã¦ã¼ã¶ã¼ç©ºéããã°ã©ã ããã¢ã¯ã»ã¹ã§ããããã«å®è£ ããã¦ãã¾ãã
ä¾ãã°ãããã»ã¹ã¹ã±ã¸ã¥ã¼ã©ã«é¢ãã¦ãããã»ã¹ã®çæããªã¯ã¨ã¹ãã§ããããã«ãfork ã·ã¹ãã ã³ã¼ã«ãç¨æããã¦ãã¾ãã
ã¡ã¢ãªç®¡çã«é¢ãã¦ã¯ãã¦ã¼ã¶ã¼ç©ºéã®ããã°ã©ã ã¯ãæ°ããã¡ã¢ãªé åã brk ã·ã¹ãã ã³ã¼ã«ãããã㯠mmap ã·ã¹ãã ã³ã¼ã«ãéãã¦ãªã¯ã¨ã¹ãã§ãã¾ãã
ãããã¯ã¼ã¯ã¹ã¿ãã¯ããã¡ã¤ã«ã·ã¹ãã ã¯ãread ã write ã·ã¹ãã ã³ã¼ã«ãéãã¦èªã¿æ¸ãããªã¯ã¨ã¹ãã§ãã¾ãã
ããã¤ã¹ãã©ã¤ãã«é¢ãã¦ã¯ãå¤ãã®å ´åãç´æ¥å¦çããªã¯ã¨ã¹ãããã·ã¹ãã ã³ã¼ã«ã¯å®è£ ããã¦ãã¾ãããããããã¯ã¼ã¯ã¹ã¿ãã¯ãããã¡ã¤ã«ã·ã¹ãã ãå©ç¨ãã¦ãã¾ãã
ã«ã¼ãã«ããã¯ã§ä½ãã§ããã®ã
ã«ã¼ãã«ããã¯ãããã¨ãå è¿°ã®ãããªãã«ã¼ãã«ã®ä¸é¨ã¨ãã¦å®è£ ããã¦ããæ©è½ã追å ãæ¹å¤ãããã¨ãã§ãã¾ãã
ã«ã¼ãã«ãæ¹å¤ãããã¨ã®å©ç¹ã¯ä¸»ã«ãç¹æ¨©ãå¿ è¦ãªããã°ã©ã ãå®è£ ã§ãããã¨ã¨ãï¼å®è£ ã«ããã¾ããï¼ã¦ã¼ã¶ã¼ç©ºéããã°ã©ã ãå¤æ´ãããã¨ãªããã·ã¹ãã ã®æåãå¤æ´ã§ãããã¨ã§ãã
ä¾ãã°ããã¡ã¤ã«ã·ã¹ãã ã®æ§è½ãæ¹åããã¨ããããã¼ã¿ãã¼ã¹ã¢ããªã±ã¼ã·ã§ã³ã«ã¤ãã¦å ¨ãå¤æ´ãå ããªãã¦ããæ§è½ãåä¸ã§ãããã¨ãããã¾ãã
ã«ã¼ãã«ãæ¹å¤ãããã¨ã®æ¬ ç¹ã¯ãå¯æ¬æ§ãä½ããã¨ã§ããã«ã¼ãã«ã«ãã°ãããã¨ã·ã¹ãã å ¨ä½ãç ´æããããããã¯ã»ãã¥ãªãã£ä¸ã®åé¡ãçºçããå¯è½æ§ãããã®ã§ãå®å ¨æ§ã®ä¿è¨¼ããã¦ããªãã«ã¼ãã«ã®ã³ã¼ããå©ç¨ããã®ã¯å±éºãä¼´ãã¾ãããªã®ã§ãæ°ããã«ã¼ãã«ã®æ©è½ãåãè¾¼ããã¨ã«ã¯å¤ãã®ã¦ã¼ã¶ã¼ã«ã¨ã£ã¦æµæãããã¾ãã
ãªã®ã§ããããã¯ã·ã§ã³ç°å¢ã§å©ç¨ããããã°ã©ã ãæ³å®ãããã¤ãOS ã®ãã©ã³ãã«ãã¼ã¸ããããã¨ãæå³ããªãã®ã§ããã°ãã«ã¼ãã«å é¨ã®ããã°ã©ãã³ã°ã¯æ¬è³ªçã«é¿ããã¹ãã§ããã¨æããã¾ãã
ã§ãããOS ã®ç¥èãæè¡ç²å¾ã®ããã«ã¯è¯ãææã§ãããç¶ç¶ããã° OS ã«ãã¼ã¸ãããããã°ã©ã ãæ¸ããããã«ãªããããããªãã®ã§ãåãçµã価å¤ãããã¨æãã¾ãã
ã¾ããã«ã¼ãã«ã®ããã¯ã®æ¹æ³ã«ãã£ã¦ã¯ä¸è¨ã®æ¬ ç¹ãããç¨åº¦è£ããã¨ãã§ãããããã«ã¤ãã¦ä»¥ä¸ã§è¿°ã¹ããã¨æãã¾ãã
ã«ã¼ãã«ããã¯ã®ï¼éãã®æ¹æ³
ã«ã¼ãã«ãããã¯ããå ´åã主ã«ãã«ã¼ãã«ã®ã½ã¼ã¹ã³ã¼ãèªä½ãæ¹å¤ããããããã¯ãã«ã¼ãã«ã¢ã¸ã¥ã¼ã«ãä½æãããã¨ããï¼éãã®æ¹æ³ãããã¾ãã
ã«ã¼ãã«ã®ã½ã¼ã¹ã³ã¼ãèªä½ãæ¹å¤ããå ´åãæåéããªãã§ãã§ãã¾ããã§ãããæ¹å¤ã®é©ç¨ã«ã¯ã«ã¼ãã«ãã³ã³ãã¤ã«ããã®ã¡åèµ·åãã¦ãæ°ããã«ã¼ãã«ããã¼ããç´ãå¿ è¦ãããã¾ãã
ä¸æ¹ã§ãã«ã¼ãã«ã¢ã¸ã¥ã¼ã«ã¯ãã§ãããã¨ãå¶éããã¾ãããOS ãåèµ·åãããã¨ãªãã¢ã¸ã¥ã¼ã«ããã¼ããããã¨ãã§ãã¾ããã¾ããã«ã¼ãã«ã®ã½ã¼ã¹ã³ã¼ãã®æ¹å¤ã¨åã³ã³ãã¤ã«ãä¸è¦ã§ãã
ãã®ãã¨ãããã«ã¼ãã«ã¢ã¸ã¥ã¼ã«ã§å®çµããã·ã¹ãã ã§ããã°ãæ¯è¼çå¯æ¬æ§ãæ ä¿ã§ãã¾ãã
ã«ã¼ãã«ã¢ã¸ã¥ã¼ã«ã§å®è£ ããã¦ãããLinux ã«ãã¼ã¸ããã¦ããªãæåãªã½ããã¦ã§ã¢ã¨ãã¦ãZFS ãããã¾ããZFS ã¯ã©ã¤ã»ã³ã¹ã®çç±ã§ Linux ã«ãã¼ã¸ããã¦ãã¾ããããæ°ãããã¼ã¸ã§ã³ã® Linux ã«ã¼ãã«ã§å©ç¨å¯è½ãªããã«æ´æ°ãç¶ç¶ããã¦ãããã«ã¼ãã«ã¢ã¸ã¥ã¼ã«ã¨ãã¦ãã«ãå¯è½ãªã½ã¼ã¹ã³ã¼ããé å¸ããã¦ãã¾ãã
ã«ã¼ãã«ã®ã½ã¼ã¹ã³ã¼ããæ¹å¤ããªããã°ãªããªãå ´å
å¯æ¬æ§ã®è¦³ç¹ããããªãã¹ãã«ã¼ãã«ã¢ã¸ã¥ã¼ã«ã¨ãã¦å®è£ ãåºæ¥ãã¨è¯ãã®ã§ããããããã§ããªãå ´åãããã¾ãã
ã«ã¼ãã«ã¯ãã«ã¼ãã«ã¢ã¸ã¥ã¼ã«ã®ããã«ç¹å®ã®ã¤ã³ã¿ã¼ãã§ã¼ã¹ãæä¾ãã¦ããããã®æ çµã¿ã®ä¸ã§ã«ã¼ãã«ã¢ã¸ã¥ã¼ã«ãå®è£ ããããã¨ãæ³å®ãã¦ãã¾ãããªã®ã§ãã«ã¼ãã«ãæ³å®ãã¦ããªãæ©è½ã«ã¤ãã¦ãã«ã¼ãã«ã¢ã¸ã¥ã¼ã«ã§å®è£ ãããã¨ãã¨ã¦ãé£ããå ´åãããã¾ãã
ä¾ãã°ãããã»ã¹ã¹ã±ã¸ã¥ã¼ã©ã¯ãOS ã®ä¸å¿é¨ã«ããããããã«ã¼ãã«èªä½ã¯ã¹ã±ã¸ã¥ã¼ã©ã«é¢ããã¢ã¯ã»ã¹ãã«ã¼ãã«ã¢ã¸ã¥ã¼ã«ã«å¯¾ãã¦æ示çã«æä¾ãã¾ããããªã®ã§ãã¹ã±ã¸ã¥ã¼ãªã³ã°ã¢ã«ã´ãªãºã ã追å ããå ´åã«ã¯ãã«ã¼ãã«ã®ã½ã¼ã¹ã³ã¼ããæ¹å¤ããå¿ è¦ãããã¨æããã¾ãã
ä¸æ¹ã§ããã¡ã¤ã«ã·ã¹ãã ã«ã¤ãã¦ã¯ã¢ã¸ã¥ã¼ã«ã¨ãã¦å®è£ å¯è½ãªããã«ãã«ã¼ãã«ãã¤ã³ã¿ã¼ãã§ã¼ã¹ãæä¾ãã¦ãã¾ããçµæã¨ãã¦ãZFS ã®ãããªãã¡ã¤ã«ã·ã¹ãã ã¯ç¬ç«ããã«ã¼ãã«ã¢ã¸ã¥ã¼ã«ã¨ãã¦å®è£ ããã¦ãã¾ãã
ãã®ããã«ãããæ©è½ãã«ã¼ãã«ã¢ã¸ã¥ã¼ã«ã¨ãã¦å®è£ å¯è½ãã©ããã«ã¤ãã¦ã¯ãã«ã¼ãã«èªä½ãæ³å®ãã¦ãããã©ããã«ããã¨ããã大ããã§ãã
ã«ã¼ãã«ããã¯ãå§ããéã«ã¯ãã¢ã¸ã¥ã¼ã«ã¨ãã¦å®è£ å¯è½ãªç®æããå§ãã¦ããã¨ãæ軽ã§è¯ããã¨æããã¾ãã
ã¾ã¨ã
- Linux ã®ãã㪠UNIX ç³» OS ã§ã¯ãããã°ã©ã ã¯ã¦ã¼ã¶ã¼ç©ºéã¨ã«ã¼ãã«ç©ºéã®ï¼ç¨®é¡ã®ç©ºéã§å®è¡ããã
- ã¦ã¼ã¶ã¼ç©ºéã¯ãã·ã¹ãã ä¿è·ã®ãããã§ãããã¨ãå¶éããã¦ãã
- ã«ã¼ãã«ç©ºéã§ã¯ãªãã§ãã§ãã
- ã«ã¼ãã«ããã¯ã¯ãã«ã¼ãã«ç©ºéã§åä½ããæ©è½ã追å ãæ¹å¤ãã
- Linux ã§ã¯ã«ã¼ãã«ã®ã½ã¼ã¹ã³ã¼ããæ¹å¤ããããã«ã¼ãã«ã¢ã¸ã¥ã¼ã«ãä½ããã¨ã§ã«ã¼ãã«ããã¯ãã§ãã
- ã§ããã ãã«ã¼ãã«ã¢ã¸ã¥ã¼ã«ã¨ãã¦æ©è½ãå®è£ ããã»ããä½ãæã使ãæããæ軽ã§ãããã