feat: reboot_system
This commit is contained in:
parent
a3cf6f2760
commit
f79c6ad58b
1 changed files with 40 additions and 0 deletions
40
006-reboot_system.s
Normal file
40
006-reboot_system.s
Normal file
|
@ -0,0 +1,40 @@
|
|||
.global _start
|
||||
.intel_syntax noprefix
|
||||
.data
|
||||
magic_1:
|
||||
.int 0xfee1dead
|
||||
magic_2:
|
||||
.int 0x28121969
|
||||
cmd:
|
||||
.int 0x1234567
|
||||
.text
|
||||
_start:
|
||||
//hello world
|
||||
lea rsi, [hello_world]
|
||||
mov rdx, 13
|
||||
call printf
|
||||
|
||||
//sync
|
||||
mov rax, 162
|
||||
syscall
|
||||
|
||||
//reboot
|
||||
mov rax, 169
|
||||
mov rdi, [magic_1]
|
||||
mov rsi, [magic_2]
|
||||
mov rdx, [cmd]
|
||||
syscall
|
||||
|
||||
//exit
|
||||
mov rax, 60
|
||||
xor rdi, rdi
|
||||
syscall
|
||||
|
||||
hello_world:
|
||||
.asciz "Hello World\n"
|
||||
printf:
|
||||
mov rax, 1
|
||||
mov rdi, 1
|
||||
syscall
|
||||
xor rdi, rdi
|
||||
ret
|
Loading…
Add table
Add a link
Reference in a new issue