Curiosity about multi-architecture OSes
Posted: Wed Jan 27, 2021 10:06 am
So I've always been confused about this. x86 seems to be the "exception" to this (or maybe its the other way around). I've looked at other CPU architectures like RISC-V and ARM and wondered how people can actually write an OS for them at all. From what I can tell, there's no "standard" way of device detection like there is on x86, or any way of detecting what memory address goes to what device or anything like that, and all these other architectures seem to be MMIO based (which is a good thing). I know that PCI/PCIe is architecture-agnostic, but I'm still confused.
Take Linux, for example. From what I've read (primarily this answer on stack overflow, ARM, at least, has nothing like the BIOS for detecting memory or anything like that. Taking embedded systems as another, such as the recently released Raspberry Pico, I've noticed that all of them appear to have predefined memory maps. But if I'm writing an OS for the generic Aarch64 architecture, I'd say its safe to assume that if my OS is device agnostic I wouldn't know what device I'm running on, and therefore wouldn't know what memory map to use. So I'm just curious how that process actually works. I can't seem to find *any* information on doing this, which is weird. You can find guides for writing an OS for the RPi, but I doubt Linux's ARM port was written with the Pi in mind. So what exactly am I missing and how did people even figure this stuff out when there seems to be a lack of standards to rely on?
Take Linux, for example. From what I've read (primarily this answer on stack overflow, ARM, at least, has nothing like the BIOS for detecting memory or anything like that. Taking embedded systems as another, such as the recently released Raspberry Pico, I've noticed that all of them appear to have predefined memory maps. But if I'm writing an OS for the generic Aarch64 architecture, I'd say its safe to assume that if my OS is device agnostic I wouldn't know what device I'm running on, and therefore wouldn't know what memory map to use. So I'm just curious how that process actually works. I can't seem to find *any* information on doing this, which is weird. You can find guides for writing an OS for the RPi, but I doubt Linux's ARM port was written with the Pi in mind. So what exactly am I missing and how did people even figure this stuff out when there seems to be a lack of standards to rely on?