]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
switch off manually on linux x86_64
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 29 Apr 2010 11:36:53 +0000 (13:36 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 29 Apr 2010 11:36:53 +0000 (13:36 +0200)
tests/boot/linux.init-x86_64.S

index 17ba8040c19a032a514501c6e8dda52d555e7201..63dca5e204e7a46c981ecf2199fb23dc584527b3 100644 (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