You cannot use any libraries, so how to do IO? Some ways that this can be done:
Showdown and restart can be managed with either:
APM
ACPI https://en.wikipedia.org/wiki/Advanced_Configuration_and_Power_Interface
Newer and better.
Now managed by the same group that manages UEFI.
Spec:
See also: http://wiki.osdev.org/Shutdown