Reputation: 1746
I am running a custom os in virtualbox and have parsed the ACPI, FACP, DSDT etc tables to get the PM1a_CNT and SLP_TYPa values. These seem to be correct. However when I try to do an ACPI shutdown with:
xor eax, eax
mov edx, [PM1a_CNT]
mov ax, [SLP_TYPa]
or ax, (1 shl 13)
out dx, ax
Nothing happens. PM1a_CNT
is 0x4004 and SLP_TYPa
is 0, which seems reasonable compared to other values I have seen elsewhere. I also check PM1b_CNT which is zero so I don't bother with it.
Is there an issue or trick with virtualbox to get it working?
Upvotes: 2
Views: 644
Reputation: 947
Everything looks correct except that you're writing a 32-bit value to a 16-bit I/O port. Try replacing the final out dx, eax
with out dx, ax
.
Upvotes: 2