뭐라도 끄적이는 BLOG

Boot Process 본문

Operating System

Boot Process

Drawhale 2022. 5. 16. 15:27

windows 11 boot screen

1단계 Boot loader (First-stage boot loader)

컴퓨팅에서 부팅은 전원 버튼 같은 하드웨어 또는 소프트웨어 명령을 통해 컴퓨터를 시작하는 프로세스입니다.

처음 부팅을 시작하게 되면 Power Supply는 들어온 전압을 현재 시스템에서 사용할 수 있는 전압으로 변환하여 연결된 부품들 사이에 전원을 공급합니다. 이 전기적 흐름은 CPU로도 전달되어 CPU가 가지고 있는 이전 값들을 지우고 CPU레지스터 중 하나인 Program Counter(PC)를 초기화시킵니다.

 

Reset vector - Wikipedia

In computing, the reset vector is the default location a central processing unit will go to find the first instruction it will execute after a reset. The reset vector is a pointer or address, where the CPU should always begin as soon as it is able to execu

en.wikipedia.org

초기화되는 값은 Reset Vector라고 하며 CPU가 리셋 후 처음 실행할 명령을 찾기 위해가는 기본 위치를 말합니다. 보통 메인보드에 위치한 ROM내부의 boot loader 주소 값을 가리키게 됩니다.

 

Firmware - Wikipedia

From Wikipedia, the free encyclopedia Jump to navigation Jump to search Low-level computer software A television remote control is an example of a product that contains firmware. In computing, firmware is a specific class of computer software that provides

en.wikipedia.org

이렇게 ROM, EPROM, EEPROM 및 플래시 메모리와 같은 비휘발성 메모리 장치에 저장되어 하드웨어에 대한 제어를 제공하는 컴퓨터 소프트웨어를 펌웨어라고 합니다. BIOS, UFEI는 메인보드에 저장되어 있는 펌웨어라고 할 수 있습니다.

 

Bootloader - Wikipedia

From Wikipedia, the free encyclopedia Jump to navigation Jump to search Software responsible for starting the computer and load other software to the CPU memory GNU GRUB, a popular open source bootloader A bootloader, also spelled as boot loader[1][2] or c

en.wikipedia.org

ROM 내부 펌웨어인 boot loader는 bootstrap, bootstrap loader라고도 불립니다. boot loader는 최종적으로 커널(운영체제)을 주기억 장치에 가져오는 역할을 합니다. 부트로더는 한 단계로 이루어질 수도 있지만 여러 단계가 추가될 수도 있습니다. 대표적으로 1단계 boot loader로 BIOS, UEFI 등 (coreboot, Libreboot, Das U-boot)이 있고 2단계는 GNU GRUB, NTLDR 등이 추가됩니다.

 

Comparison of boot loaders - Wikipedia

From Wikipedia, the free encyclopedia Jump to navigation Jump to search The following tables compare general and technical information for a number of available boot loaders. General information[edit] and Comercial ^ While most parts of GRUB4DOS are under

en.wikipedia.org

1단계 boot loader인 BIOS/UEFI는 POST(Power-On Self-Test)를 진행합니다. POST는 컴퓨터 또는 다른 전자 장치의 전원이 켜진 직후 firmware 또는 software에 의해 수행되는 프로세스 입니다. 컴퓨터가 POST를 통과하지 못하면 컴퓨터 내에서 무엇이 오작동하는지 나타내는 비프음이 울립니다. 이 비프 코드는 제조업체마다 달라 메인보드 제조업제 홈페이지또는 설명서를 통해서 확인 해야 합니다.

 

POST는 CPU레지스터 확인, BIOS코드 자체의 무결성을 확인, DMA, RTC(Real-Time Clock) Interrupt controller와 같은 기본 구성 요소를 확인, 시스템 주  메모리 초기화 및 크기 조정 및 확인, BIOS 초기화, 구성 및 선택, 시스템 버스 테스트, 시스템 비디오 구성요소 테스트, 키보드 등 시스템에 연결된 모든 드라이브를 테스트한 뒤 결과가 CMOS(RTC/NVRAM)에 저장된 구성 값과 일치하는지 검사합니다. 그리고 부팅에 사용할 수 있는 장치 식별 또 추가적인 BIOS가 있을 경우 BIOS를 RAM으로 로드합니다. 

wikipedia flow-diagram computer-booting-sequences 중 일부

이 과정에서 오류가 발생한다면 메인보드에서 비프음이 들리거나 화면에 오류를 출력하게 됩니다. 성공하게 된다면 BIOS또는 UEFI에서 HDD, SSD, CD, USB와 같은 부트 장치에서 boot loader software를 찾으려고 시도 합니다. BIOS 또는 UEFI에서 설정한 부팅 우선순위에 따라 부트장치를 찾습니다.

2단계 boot loader (Second-stage boot loader)

GRUB, rEFInd, BOOTMGR, Syslinux, NTLDR, iBoot와 같은 다양한 2단계 boot loader가 있습니다. 이중 대부분의 Linux 배포판에서 사용하는 GRUB와 Windows가 사용한는 NTLDR이 가장 잘 알려져 있습니다. 이러한 boot loader들은 운영체제를 로드한다는 목적은 모두 같습니다.

Legacy Boot : https://en.wikipedia.org/wiki/File:Legacy_BIOS_boot_process.png참고

boot loader는 운영체제를 로드하기 위해 인식한 드라이브 내에서 첫 번째 섹터를 읽습니다. 드라이브의 첫 번째 섹터에는 MBR(Master Boot Record)이 위치하고 있습니다. MBR은 0부터 512byte까지의 boot sector입니다. (MBR 첫 번째 섹터의 마지막 2바이트에는 MBR boot signature(0x55AA)가 있다.) MBR의 크기는 32비트로 제한되어 512byte 섹터가 있는 하드 디스크의 경우 MBR파티션 테이블에서 최대 크기가 2TiB까지 허용됩니다. (2^32 * 512byte) 이러한 제한으로 인해 현재는 64ZiB까지 제공되는 GPT로 대체되고 있습니다.

 

Master boot record - Wikipedia

From Wikipedia, the free encyclopedia Jump to navigation Jump to search First sector of a partitioned computer disk This article is about a PC-specific type of boot sector on partitioned media. For the first sector on non-partitioned media, see volume boot

en.wikipedia.org

MBR에서 부팅 가능한 파티션을 찾는 작업을 수행합니다. Boot flag(파티션 레코드의 시작 부분에 값이 0x80)를 발견하면 MBR은 VBR에서 Boot Sector를 실행합니다.

VBR은 OS마다 다르지만 주요 기능은 파티션에서 2단계 부트 로더인 운영 체제 부트 로더 파일(bootmgr 또는 ntldr)을 로드하여 운영체제의 커널을 메모리에 로드하는 작업을 수행합니다.


참고 자료

 

 

윈도우 부팅 절차 (Windows Boot Process) | FORENSIC-PROOF

 

forensic-proof.com

 

BIOS - Wikipedia

From Wikipedia, the free encyclopedia Jump to navigation Jump to search Firmware for hardware initialization and OS runtime services This article is about the BIOS as found in personal computers. For other uses, see Bios (disambiguation). A pair of AMD BIO

en.wikipedia.org

 

Booting - Wikipedia

From Wikipedia, the free encyclopedia Jump to navigation Jump to search Process of starting a computer "Quick boot" redirects here. For the feature of the Quarterdeck memory manager, see Quickboot (QEMM). This article is about bootstrapping operating syste

en.wikipedia.org

반응형