This program , written for Gnu Assembler on an x86 linux system is supposed to cause a triple fault and then reboot.
.text
.global _start
_start:
# write our string to stdout
movl $len,%edx # third argument: message length
movl $msg,%ecx # second argument: pointer to message to write
movl $1,%ebx # first argument: file handle (stdout)
movl $4,%eax # system call number (sys_write)
int $0x80 # call kernel
# Triple Fault -- reboot
movq $1, %rsp # Load the stack pointer with a one
pushq %rax # Push the A register, should cause a triple fault.
# and exit
movl $0,%ebx # first argument: exit code
movl $1,%eax # system call number (sys_exit)
int $0x80 # call kernel
.data # section declaration
msg:
.ascii "Will reboot by triple fault!\n" # our dear string
len = . - msg # length of our dear string
It causes a segmentation fault instead. Is it possible to get this to work from user mode, If run as root?