switch off manually on linux x86_64

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-04-29 13:36:53 +02:00
parent 3bd6968e56
commit 6406a79dff

View file

@ -18,6 +18,7 @@
#define SYSCALL_WRITE 1
#define SYSCALL_RESET 169
#define SYSCALL_IOPL 172
#define SYSCALL_EXIT 60
#define STDOUT 1
@ -25,6 +26,8 @@
#define SHUTDOWN_MAGIC2 0x28121969
#define SHUTDOWN_MAGIC3 0x4321fedc
#define SHUTDOWN_PORT 0x8900
.text
.global start, _start
_start:
@ -36,6 +39,28 @@ start:
movq $(messageend-message), %rdx
syscall
movq $SYSCALL_IOPL, %rax
movq $3, %rdi
syscall
movw $SHUTDOWN_PORT, %dx
movb $'S', %al
outb %al, %dx
movb $'h', %al
outb %al, %dx
movb $'u', %al
outb %al, %dx
movb $'t', %al
outb %al, %dx
movb $'d', %al
outb %al, %dx
movb $'o', %al
outb %al, %dx
movb $'w', %al
outb %al, %dx
movb $'n', %al
outb %al, %dx
/* shutdown. */
movq $SYSCALL_RESET, %rax
movq $SHUTDOWN_MAGIC1, %rdi