Operating System. Plug-and-play devices are detected and assigned resources (I/O addresses, IRQ lines) by the OS through device enumeration. The OS maintains a Hardware Abstraction Layer (HAL) allowing software/drivers to interact with hardware independent of platform specifics.
The BIOS performs initial hardware detection at boot, but resource assignment and ongoing management belong to the OS—enabling dynamic reconfiguration and hot-plugging.