Cosmos can not shutdown the machine but only boot it and do reboot.
To implement a proper shutdown Cosmos ACPI support should be enanched to support the HALT command; at the user level the expected interface is simply kernel.Stop().
A starting point:
http://wiki.osdev.org/Shutdown
I have this problem with MonoOS, that based on linux.
When I run /sbin/poweroff, It stops working and screen will freeze.
On Linux HALT is surely implemented I usually do: 'shutdown -h now' not poweroff...
Please left this issue for the actual Cosmos implementation of the HALT command.
Thank you.
It appears as though the current implementation doesn't even implement reboot.
The Kernel.Restart method is empty?
Is this expected?
Edit* Nevermind, I see it implemented in the CPU class in Core. It just doesnt bubble up.
Yes Kernel is an abstract class with apparently all empty methods but are plugged somewhere else I think.
However I've read that there were version of Halt command implemented in user kernel so why don't port this implementation where it should be inside the Cosmos source tree?
Found it:
https://files.gitter.im/CosmosOS/Cosmos/v8bF/ACPI.cs
@fanoI
That code seems like it will do the trick. I can implement this in the core and bubble it up to the kernel layer but this wont be a full implementation of ACPI. In fact, to fully implement acpi would be a huge undertaking by itself which is why intel releases the acpica (https://github.com/acpica/acpica)
This will, however, be good enough for now.
Do you mean the difficulties are to implement the standby / resume and so on? For now having the possibility to really shutdown the machine will be sufficient for us.
The code I've linked I'd say needs refactoring as too much unsafe code is needed probably it will need to splitted between Core (were unsafe can be used) and HAL rings.
@jp2masa the code I've linked has been written by you?
@fanoI No, I found that code in a tutorial, in the start of the file it says:
/// <summary>
/// ACPI and Power Management Functions
///
/// Provided by Grunt to app-builder on the Cosmos discussion boards
/// </summary>
Most helpful comment
On Linux HALT is surely implemented I usually do: 'shutdown -h now' not poweroff...
Please left this issue for the actual Cosmos implementation of the HALT command.
Thank you.