Intel-based (IA–32) startup
0xffff0(the IA–32 architecture uses a segment:offset form of addressing; the code segment is set to
0xf000and the instruction pointer is set to
0xffff0contains a jump instruction to the the BIOS (Basic Input/Output System) code. This is actually at the end of the BIOS ROM contains a jump instruction to a region of the BIOS that contains start-up code.
- Power-on self-test (POST)
- Detect the video card’s (chip’s) BIOS and execute its code to initialize the video hardware
- Detect any other device BIOSes and invoke their initialize functions
- Display the BIOS start-up screen
- Perform a brief memory test (identify how much memory is in the system)
- Set memory and drive parameters
- Configure Plug & Play devices (traditionally PCI bus devices)
- Assign resources (DMA channels & IRQs)
- Identify the boot device
0x7c00and jumps there.
Stage 1: the Master Boot Record
- First stage boot loader (≤ 440 bytes)
- Disk signature (4 bytes)
- Disk partition table (16 bytes per partition × 4 partitions)
Stage 2: the Volume Boot Record
Good-bye, BIOS. Hello EFI
- BIOS components
- preserved some components from the BIOS, including power management (Advanced Configuration & Power Interface, ACPI) and system management components (e.g., reading and setting date).
- Support for larger disks
- The BIOS only supported four partitions per disk, with a capacity of up to 2.2 TB per partition. EFI supports a maximum partition size of 9.4 ZB (9.4 × 1021 bytes).
- No need to start up in 16-bit (real) mode
- The pre-boot execution environment gives you direct access to all of system memory.
- Device drivers
- The EFI includes device drivers, including the ability to interpret architecture-independent EFI Byte Code (EBC) Operating systems use their own drivers, however, so – as with the BIOS – the drivers are generally used only for the boot process.
- Boot manager
- This is a significant one. EFI has its own command interpreter and complete boot manager. You no longer need a dedicated boot loader. As long as you place the bootable files into the EFI boot partition, which is formatted as a FAT file system (the standard file system format in older Windows systems; one that just about every operating system can handle).
- The firmware is extensible. Extensions to EFI can be loaded into non-volatile memory.
Booting with EFI
0x00000000. The flash memory containing start-up code will be remapped to address
0x00000000on reset. This code performs various initializations, including settiung up an exception vector table in RAM and copying application code from ROM to RAM (it runs faster in RAM). The code remaps the RAM to address 0 (the processor has a REMAP bit to change the mapping of flash memory). The memory system is then initialized. This involves setting up memory protection and setting up the stacks. I/O devices are then initialized and the processor is changed to user mode. This boot ROM code detects boot media and loads and runs the second stage boot loader. The second stage boot loader is typically GRUB for larger systems or uBoot for embedded systems. This second stage loader loads the operating system and transfers control to it.
Mac OS X
BootXis bootloader that then loads in the kernel.
The Mac today
/System/Library/CoreServices/boot.efion the root (often only) partition of the disk.
boot.efifile is loaded, the computer displays a metallic Apple logo on the screen. The boot loader loads in the kernel as well as essential driver extensions, which then runs launchd, which executes the various startup scripts and programs. Once the kernel is loaded, the spinning gear gear appears below the Apple logo. When the kernel runs the first process, launchd, the screen turns blue.
- Booting, Wikipedia
- System Boot Sequence, The PC Guide
- GNU Multiboot spec
- UEFI consortium and specifications
- EFI, Wikipedia article
- What UEFI Can Do For You, Tom’s Hardware
- GUID Partition Table, Wikipedia article
- EFI System Partition, Wikipedia article
- Boot Configuration Data in Windows Vista, Microsoft Hardware Developer Central
- Windows Vista startup process, Wikipedia article
- Windows NT startup process, Wikipedia article
- ELILO: EFI Linux Boot Loader
- ARM architecture tutorial
- Open Firmware Home Page
- Open Firmware, Wikipedia article
- What is Mac OS X, Mac OS X Internals
- Mac-OF-I, Mac OS X Reference Library, Apple Inc.
- Mac-OF-II, Mac OS X Reference Library, Apple Inc.