λ©λͺ¨λ¦¬ κ΄λ¦¬μ κΈ°λ³Έ κ°λ μ€ νλλ μ¬μ©μ μμ(User Space)κ³Ό 컀λ μμ(Kernel Space) μ¬μ΄μ ꡬλΆμ λλ€.
컀λ μμ (Kernel Space): μ΄μ체μ 컀λμ΄ λμνλ μμμ λλ€. μ΄ λΆλΆμ μμ€ν 리μμ€ λ° μ΄μ체μ μ ν΅μ¬ κΈ°λ₯μ μ§μνλ λ°μ΄ν° λ° μ½λλ‘ μ±μμ Έ μμ΅λλ€. 컀λ μμμ μΌλ°μ μΌλ‘ μμ€ν λ 벨μ κΆνμ΄ νμν μμ λ€μ μ²λ¦¬ν©λλ€.
μ¬μ©μ λͺ¨λ (User Space): μ¬μ©μ μμμ μ¬μ©μ μμ© νλ‘κ·Έλ¨μ΄ μ€νλκ³ λμνλ 곡κ°μ λλ€. μ¬κΈ°μλ ν μ€νΈ νΈμ§κΈ°, μΉ λΈλΌμ°μ , κ²μκ³Ό κ°μ μμ© νλ‘κ·Έλ¨λ€μ΄ μ¬μ©νλ λ©λͺ¨λ¦¬κ° ν¬ν¨λ©λλ€. μ΄ κ³΅κ°μμ μμ© νλ‘κ·Έλ¨μ μμ€ν 리μμ€μ μ νλ μ κ·Όμ κ°κ² λμ΄ κ²©λ¦¬μ 보μ μμ€μ΄ μ μ§λ©λλ€.
μ¬μ©μ μμμλ λ€μν μμλ€μ΄ μ‘΄μ¬ν©λλ€.
1) μ½λ μμ (Code Segment): νλ‘κ·Έλ¨μ μ€ν μ½λκ° μ μ₯λλ λΆλΆμ λλ€. CPUλ μ΄ μ½λλ₯Ό νλμ© μ€ννμ¬ νλ‘μΈμ€μ λμμ μνν©λλ€.
2) λ°μ΄ν° μμ (Data Segment): μ μ λ³μ, μ μ λ³μ λ± νλ‘κ·Έλ¨μ λ°μ΄ν°κ° μ μ₯λλ λΆλΆμ λλ€. νλ‘κ·Έλ¨μ΄ μ€νλλ©΄μ μμ±λλ λμ μΈ λ°μ΄ν°λ μ΄ μμμ ν λΉλ μ μμ΅λλ€.
3) μ€ν μμ (Stack Segment): ν¨μ νΈμΆκ³Ό κ΄λ ¨λ μ 보, μ§μ λ³μ, ν¨μμ λ°ν μ£Όμ λ±μ΄ μ μ₯λλ λΆλΆμ
λλ€. μ€νμ νμ
μ μΆ(LIFO) κ΅¬μ‘°λ‘ λ°μ΄ν°λ₯Ό μ μ₯νλ©°, ν¨μ νΈμΆκ³Ό λ°νμ λ°λΌ κ³μ λ³ν©λλ€.
4) ν μμ (Heap Segment): λμ ν λΉμ μν 곡κ°μΌλ‘ νλ‘κ·Έλ¨μ μ€ν μ€μ λμ μΌλ‘ ν λΉλλ λ©λͺ¨λ¦¬λ₯Ό μν μμμ λλ€. μ¬μ©μκ°(=νλ‘κ·Έλλ¨Έ) μ§μ λ©λͺ¨λ¦¬λ₯Ό ν λΉνκ³ ν΄μ νλ λ° μ¬μ©λλ©°, μ£Όλ‘ λμ λ°μ΄ν° ꡬ쑰λ κ°λ³ ν¬κΈ°μ λ°μ΄ν°λ₯Ό μ μ₯νλ λ° νμ©λ©λλ€. μμ¦ μΈμ΄λ€μ κ°λΉμ§ 컬λ μ μΌλ‘ ν λΉν 곡κ°μ μλμΌλ‘ μ κ±°ν΄μ€λλ€. νμ§λ§ CμΈμ΄μ κ°μ μΈμ΄λ€μ μ΄λ¬ν κΈ°λ₯μ΄ μκΈ° λλ¬Έμ 곡κ°μ μ¬μ©νκ³ λ°©μΉνλ©΄ λ©λͺ¨λ¦¬ λμ(Memory leak)κ° μΌμ΄λ©λλ€.
μ΄λ¬ν μμλ€μ νλ‘μΈμ€κ° μ€νλλ λμ λμ μΌλ‘ λ³νλ©°, κ°κ°μ μν μ λ°λΌ λ©λͺ¨λ¦¬κ° ν λΉλκ³ μ¬μ©λ©λλ€.
Kernel Space
The kernel space is a privileged area of memory where the core components of the operating system, including device drivers and system call interfaces, reside. It has elevated system-level permissions, allowing it to control hardware and manage critical system functions.
User Space
The user space is the memory region where user applications execute, isolated from the kernel. It contains the code, data, and stack segments of user programs, operating with restricted permissions to ensure security and stability.
'Computer Science > Operating System' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
7 Thread in Software (0) | 2023.12.28 |
---|---|
6 νλ‘μΈμ€ μνμ κ³μΈ΅ ꡬ쑰 (1) | 2023.12.28 |
4 Process Outline (+Kernel Space) (1) | 2023.12.23 |
3 Dual Mode (User & Kernel mode) + System Call (1) | 2023.12.21 |
2 컀λ (Kernel) (0) | 2023.12.21 |
λκΈ