asm version

master
LEdoian 2 weeks ago
parent 0d66c59676
commit 1fae0a8d82

1
.gitignore vendored

@ -1,2 +1,3 @@
/initrd/
/initrd.img
/myinit/init

@ -4,11 +4,12 @@
set -eu
mkdir "initrd"
cp "./init" "initrd/"
pushd myinit
make
popd
busybox="$(which busybox)"
cp "$busybox" "initrd/busybox"
mkdir "initrd"
cp "./myinit/init" "initrd/"
pushd "./initrd"
find . | cpio -o -H newc > ../initrd.img

@ -0,0 +1,3 @@
init: justreboot.S
musl-gcc -nostdlib --static justreboot.S -o init
strip init

@ -0,0 +1,10 @@
#include <sys/syscall.h>
.globl _start
_start:
movq $__NR_reboot, %rax;
movq $0xfee1dead, %rdi;
movq $0x05121996, %rsi;
movq $0x4321fedc, %rdx;
syscall;
Loading…
Cancel
Save