littlekernel / lk

LK embedded kernel
MIT License
3.14k stars 615 forks source link

Halt == spinning forever #199

Open wenhuizhang opened 7 years ago

wenhuizhang commented 7 years ago

When close using "poweroff", it does not close the qemu socket

travisg commented 7 years ago

Which qemu target were you running? It's possible that not all of the poweroff paths are implemented for every target.

antoneliasson commented 7 years ago

Reproducible on ARM (per the instructions in the README). Also happens for the reboot command

travisg commented 7 years ago

Ah yes that's just because the platform_halt() path isn't implemented on all of the platforms, and the default one just drops to a spin like that. It doesn't seem to be implemented in the qemu emulated ones, so that's the behavior that's expected. I'd be easy enough to add it for the qemu target.

wenhuizhang commented 7 years ago

Qemu lm3s6965evb-test and also nearly all qemu arm versions

travisg commented 7 years ago

Correct. It has nothing at all to do with qemu, it's because the individual platform/target code in LK doesn't necessarily have the final mechanism to shut down the emulated system, so it has a fallback path that just spins the cpu.