What runs before an OS is ready?
At power-on, the CPU starts firmware provided by the platform. Firmware lives in nonvolatile memory; installed OS boot files are usually on storage. We follow a simplified UEFI computer and a Linux-style user-space startup.
Diagram
The firmware stage is visible before the OS kernel has loaded.