본문 바로가기
Linux

[Linux] Syscall

by 꾸압 2023. 11. 4.

 

<설명>

  - System calls, 시스템 호출의 약어

  - Linux 에서 User 공간과 Kernel 간 통신을 위한 통로 역할

  - Function Call 과 달리 User 공간에서 Linux Kernel 로 요청을 전달하는 특수 어셈블리 명령어.

  - Syscall 은 파일 작업에서 Process 제어 등 다양.

  - Syscall이 호출되면 User 모드에서 Kernel 모드로 전환되어, User 프로그램을 대신하여 Kernel 권한이 있는 작업 수행.

 

  - 어셈블리 언어 수준에서 Syscall 수행을 하려면 최신 x86 아키텍처에선 Syscall 이란 Trap Instruction 을 수행해야 함.

  - 같은 프로그램 내에서 함수로 이동하는 Function Call 과 모드 전환을 Trigger 하여 실행 흐름을 Kernel 루틴으로 전환.

  - 이런 전환을 통해 System 수준 작업을 안전하게 실행하므로, User 프로그램이 잠재적인 시스템 불안정선 혹은 보안 위험을 야기할 Kernel Resource에 직접 Access 하지 않음.

 

  - Syscall 메커니즘은 System Service 요청을 라우팅하는데 중요한 역할을 하는 Syscall Table을 중심으로 구성.

  - 한 쪽에는 일반적으로 glibc 같은 라이브러리의 Wrapper function 을 통해 User 친화적 방식으로 Syscall 표시하는 User 공간에 Code Layer 가 있음.

  - 다른 쪽에는 요청된 Service를 구현하는 Kernel Function 이 있음.

  - 이런 구조화된 접근 방식은 Syscall 이 User Application과 System Resource 간 Control Bridge 역할을 하여, 서로의 상호 작용을 효율적이고 안전하게 Capsulating 및 관리.

 


 

 

<출처_1> https://opensource.com/article/17/5/beginners-guide-syscalls

 

A beginner's guide to Linux syscalls

Learn how system calls can handle a lot of functions, simple and complex, in Linux applications.

opensource.com

 

<출처_2> https://w3.cs.jmu.edu/kirkpams/OpenCSF/Books/csf/html/Syscall.html

 

2.4. System Call Interface — Computer Systems Fundamentals

User-mode programs can execute standard CPU instructions that are focused on performing a calculation or implementing a logical control flow. However, user-mode programs have no direct access to any shared computing resource outside the CPU. For instance,

w3.cs.jmu.edu

 

<출처_3> https://www.cs.miami.edu/home/burt/learning/Csc521.081/notes/linux_syscall.html#:~:text=The%20syscall%20and%20the%20syscall,function%20which%20implements%20the%20service

 

Linux Syscall

Linux Syscall System calls on the Intel architecture involve a special trap instruction. This instruction both modifies the flow of control and the privilege state of the processor. After the trap, the processor is running in kernel mode, with access to th

www.cs.miami.edu

 

 

 

'Linux' 카테고리의 다른 글

[Linux] IO CTL  (0) 2023.11.04
[Linux] UEFI 란?  (0) 2023.10.29
[Linux] Linux OS 부팅 순서  (0) 2023.10.28
[Kali] Kali 설치  (2) 2023.02.27

댓글