From 8a9208612eec8ddae4c418485d848ecfa0613699 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Mon, 30 Oct 2023 22:12:14 +0100 Subject: Meta: Move kernel and userland to their own folders. This is to allow both the kernel and the userland to share certain header files and to make the folder structure a bit more clear. --- kernel/signal.s | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 kernel/signal.s (limited to 'kernel/signal.s') diff --git a/kernel/signal.s b/kernel/signal.s new file mode 100644 index 0000000..38604a4 --- /dev/null +++ b/kernel/signal.s @@ -0,0 +1,18 @@ +.intel_syntax noprefix +.global jump_signal_handler +jump_signal_handler: + mov ebx, [esp+8] + mov ecx, [esp+4] + mov ax, (4 * 8) | 3 # ring 3 data with bottom 2 bits set for ring 3 + mov ds, ax + mov es, ax + mov fs, ax + mov gs, ax # SS is handled by iret + + mov eax, ebx + push (4 * 8) | 3 # data selector + push eax + pushf + push (3 * 8) | 3 + push ecx + iret -- cgit v1.2.3