3 ms·
I think the main difference is really that in user space there is an os always doing something in the background. On a gameboy though when you say halt it truly
by sbradford26 8y ago
I think the main difference is really that in user space there is an os always doing something in the background. On a gameboy though when you say halt it truly halts the hardware unlike an idle loop which just spins. So an actual hardware interrupt is needed to restart things.
For embedded software without an os it is not uncommon when not explicitly doing something to enter a spin table.
- anyfoo 8y agoThe idle loop of an OS usually halts the core and waits for an actual hardware interrupt, too. And if your user space program is e.g. waiting on a disk read, there is a pretty good chance that the OS has nothing else to do and hits that loop, halting the core, until the disk delivers, or maybe a timer interrupt kicks in. So there's not much difference between a Game Boy and a modern computer in that particular regard, other than the many thick abstraction layers between the system call invocation and the halt instruction.