It's amusing how there was a point where Windows was portable across architectures while also supporting different operating system API's such as the OS2 and POSIX APIs. There was Power PC, MIPS, Arm, Alpha and even i960 ports of NT. The HAL was part of that effort to decouple NT from the hardware so a port to a new machine was writing a new HAL and drivers.
Too bad that idea never took off. Bell labs also did the same with Plan 9 and produced a tool chain and C design which enabled any platform bootstrap the other. That effort is now the foundation of Go's portability. It's nice to be able to boot 9 on a Pi, build the AMD64 user space and kernel, then net boot the x86 machine from the Pi. First class potability was a missed opportunity.