diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/Makefile | 10 | ||||
-rw-r--r-- | kernel/scalls/sigaction.c | 9 | ||||
-rw-r--r-- | kernel/scalls/sigaction.h | 3 |
3 files changed, 12 insertions, 10 deletions
diff --git a/kernel/Makefile b/kernel/Makefile index 5098944..8fd5df1 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -15,16 +15,6 @@ all: myos.iso myos.bin: $(OBJ) $(CC) $(INCLUDE) -shared -T linker.ld -o myos.bin -ffreestanding -nostdlib $(CFLAGS) $^ -lgcc -debug: - qemu-system-i386 -no-reboot -no-shutdown -serial file:./serial.log -hda ext2.img -m 1G -cdrom myos.iso -s -S & - gdb -x .gdbinit - -nk: - qemu-system-i386 -d int -netdev user,id=n0,hostfwd=udp:127.0.0.1:6001-:6000 -device rtl8139,netdev=n0 -no-reboot -no-shutdown -serial file:./serial.log -hda ext2.img -m 1G -cdrom myos.iso -s - -run: - qemu-system-i386 -enable-kvm -netdev user,id=n0,hostfwd=udp:127.0.0.1:6001-:6000 -device rtl8139,netdev=n0 -object filter-dump,id=id,netdev=n0,file=netout -d int -no-reboot -no-shutdown -chardev stdio,id=char0,logfile=serial.log,signal=off -serial chardev:char0 -hda ext2.img -m 1G -cdrom myos.iso -s - myos.iso: myos.bin cp myos.bin isodir/boot grub-mkrescue -o myos.iso isodir diff --git a/kernel/scalls/sigaction.c b/kernel/scalls/sigaction.c new file mode 100644 index 0000000..0166fab --- /dev/null +++ b/kernel/scalls/sigaction.c @@ -0,0 +1,9 @@ +#include <scalls/sigaction.h> +#include <signal.h> +#include <sched/scheduler.h> + +int syscall_sigaction(int sig, const struct sigaction *restrict act, + struct sigaction *restrict oact) { + set_signal_handler(sig, act->sa_handler); + return 0; +} diff --git a/kernel/scalls/sigaction.h b/kernel/scalls/sigaction.h new file mode 100644 index 0000000..0f0aa5f --- /dev/null +++ b/kernel/scalls/sigaction.h @@ -0,0 +1,3 @@ +#include <signal.h> +int syscall_sigaction(int sig, const struct sigaction *restrict act, + struct sigaction *restrict oact) ; |