For operating systems, they usually store the CODE, CONST, and INIT as a block. Perhaps on a file system. When the program is to be started, the operating system loads all of these into RAM. It may turn on protections, or not. It may patch things on the way, or not. But the CODE, CONST, and INIT sections must be stored somewhere. This could be disk, core memory, magtape, punch cards, paper tape, etc. I suppose it could be in your head, even, and you'd toggle them in with switches (as I've done.) A memory system I've used before, that most folks these days may not remember, is core memory. It's NV and also read-write and also fast. There were times when I would store the program in core when the power was off -- no disk, no tape, etc.
Jon