[UEFI] UEFI 부팅 단계 / UEFI 드라이버와 Application 차이 / driver 호출 과정

예짱·2023년 5월 23일
0

UEFI

목록 보기
2/2

UEFI : 통합 확장 펌웨어 인터페이스 (Unified Extensible Firmware Interface)

  • BIOS를 대체하기 위해 등장한 시스템

  • Secure Booting이 가능하고 BIOS에 비해서 더욱 큰 디스트 용량을 지원함

Security(SEC) -> Pre EFI Initialization (PEI) -> Driver Execution Environment(DXE) -> Boot Device Select(BDS) -> Transient System Load (TSL) -> Runtime(RT)

1) Security(SEC)

  • Platform Initialization(PI) 아키텍처의 첫단계

  • 플랫폼 재시작 이벤트 처리

  • 시스템 제어 코드 초기화

2) Pre EFI Initialization (PEI)

  • PI 아키텍쳐의 두번째 단계

  • 메모리 초기화

  • 부트모드 결정

  • 프로세서와 칩셋 인터페이스를 초기화

  • PEI Phase에서만 인식 가능한 플랫폼 특정 자원들을 설정

3) DXE 단계

  • 드라이버를 이용하여 플랫폼 초기화 작업을 완료

  • 하드웨어 의존적인 Architectural Protocols를 수행

UEFI driver => support boot process / platform services 제공

A module of code typically inserted into the firmware via protocol interfaces.

Drivers may provide device support during the boot process or they may provide platform services.

It is important not to confuse UEFI drivers with OS drivers that load toprovide device support once the OS takes control of the platform

UEFI Application => 플랫폼 일을 하기 위해서 boot service에 로드되는것

Modular code that may be loaded in the boot services environment to accomplish platform specific tasks within that environment.

Examples of possible applications might include diagnostics or disaster recovery tools shipped with a platform that runoutside the OS environment.

UEFI applications may be loaded in accordance with policy implemented by the platform firmware to accomplish a specific task.

Control is then returned from the UEFI application to the platform firmware

  • loaded by the Boot Manager or by other UEFI applications

  • when boot manager loads a UEFI application, the image handle may be used to locate the "load options" for the UEFI application

Q. UEFI 드라이버와 어플리케이션 차이

⇒ UEFI driver는 드라이버 entry point에서 오류가 반환도지 않는 한 드라이버가 메모리에 상주한다는 점

UEFI drivers are different from UEFI applications in that, unless there is an error returned from the driver's entry point, the driver stays resident in memory. The UEFI platform firmware, the boot manager, and UEFI applications may load drivers.

Q. driver 호출 과정

→ efi 시스템 파티션에 있는 efi 파일

Driver Initialization

  • driver image file은 media에 의해 load되어야 함 // file on an UEFI-defined file system or throught the use of an UEFI-defined image loading service

→ UEFI defines NVRAM variables that are used to point to the file to be loaded

  • EFI_BOOT_SERIVCES.LoadImage()로 system memory 에 load됨

  • driver을 위한 handle 생성되며 Image Protocol 인스턴스가 해당 handle에 적재됨 = Image Handle // 이때까진 driver는 memory에서 대기

  • 드라이버가 LoadImage()로 로드되면 EFI_BOOT_SERVICES.StartImage()로 드라이버 시작

  • DriverOrder : list is used by the firmware's boot manager as the default load order for UEFI drivers that it should explicitly load

  • boot drivers는 EfiBootServicesCode로 marked되어 로드되어있다

  • 그리도 데이터 structure를 EfiBootServicesData형태로 할당한다

  • ExitBootServices() memory types는 available memory로 변환된다

profile
예짱이다

0개의 댓글