Doom ran directly in the BIOS. The game appeared as a "payload" with the release of Coreboot 4.17, an open alternative to proprietary BIOS and UEFI.
Coreboot is a free and open-source BIOS implementation that not only initializes the hardware when the machine starts up, but also supports running additional software called "payloads". As such, Doom (called CoreDoom in this project) became available with the Coreboot 4.17 release in addition to Space Invaders and Tint (Tetris).
CoreDoom is based on the DoomGeneric port, and when Coreboot is installed, the game, along with its WAD files, is written directly to the motherboard drive.