Supervisor Call (svc)

Nitroblue 1·2025년 9월 11일
참고 출처
  1. Arm developer - SVC Handler
    -> In order to do this, a short piece of assembly code must be implemented as the start of the SVC handler. This identifies which stack the registers were saved to, extracts the SVC number from the instruction, and passes the number and a pointer to the arguments to the main body of the handler written in C.

Supervisor call

  • it's a hardware-level instruction that allows a user-mode program to request a service from the operating system's kernel, which runs in a more privileged supervisor (or kernel) mode. When an application executes an SVC instruction, the processor switches from user mode to kernel mode, transferring control to a specific system call handler within the OS. This allows user programs to perform privileged operations, such as file I/O, process management, or accessing protected system resources, which would otherwise be forbidden.

즉, 내가 원하는 Tock OS식 보안 체계를 구현하기 위해서는 svc를 통해 user mode에서 kernel mode로 진입하는 것이 필수이므로 이 기능을 내 프로젝트에 가져와야 한다.
How??


How it works?

  1. User Request
    유저 어플리케이션에서 커널 privileges를 필요로 하는 오퍼레이션을 요청한다.

  2. SVC Instruction occur
    해당 앱에서 'SVC number'를 포함한, 그래서 이게 SVC instruction임을 알 수 있는 명령어를 실행한다.

  3. Mode switch from User mode to Kernel mode.

  4. Kernel Handler
    Control is transferred to the operating system's SVC handler or system call handler.

  5. Service Execution:
    The kernel handler uses the SVC number to determine the requested service and performs the operation on behalf of the application.

  6. Return to User Mode:
    After completing the task, the kernel returns control to the user application, which resumes execution in user mode.

0개의 댓글