diff options
| author | Fabian Imhof <fabian.imhof@ost.ch> | 2025-04-21 08:18:41 +0000 |
|---|---|---|
| committer | Fabian Imhof <fabian.imhof@ost.ch> | 2025-04-21 08:18:41 +0000 |
| commit | 0986058bb9ca5b4afd7c578c815dc3a4c08808a9 (patch) | |
| tree | 7820b35df1d58ca5a7367a77a5e16d5d914382d5 /arch/x86_64/src/context_switching/main.cpp | |
| parent | 5dc0e92a7211b44429c1a2e7efe19c146f5c4f9a (diff) | |
| download | teachos-0986058bb9ca5b4afd7c578c815dc3a4c08808a9.tar.xz teachos-0986058bb9ca5b4afd7c578c815dc3a4c08808a9.zip | |
WIP syscall
Diffstat (limited to 'arch/x86_64/src/context_switching/main.cpp')
| -rw-r--r-- | arch/x86_64/src/context_switching/main.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/x86_64/src/context_switching/main.cpp b/arch/x86_64/src/context_switching/main.cpp index 7be286a..faaf831 100644 --- a/arch/x86_64/src/context_switching/main.cpp +++ b/arch/x86_64/src/context_switching/main.cpp @@ -52,7 +52,14 @@ namespace teachos::arch::context_switching { kernel::cpu::validate_segment_registers(USER_DATA_SEGMENT_SELECTOR, USER_CODE_SEGMENT_SELECTOR); - asm volatile("INT $0x80"); + // TODO/INFO: + // https://stackoverflow.com/questions/46022184/osdev-syscall-sysret-and-sysenter-sysexit-instructions-enabling + // https://stackoverflow.com/questions/12806584/what-is-better-int-0x80-or-syscall-in-32-bit-code-on-linux + // + // People claim that SYSENTER is for 32-Bit, while SYSCALL is for 64-Bit! + + // asm volatile("INT $0x80"); + asm volatile("SYSCALL"); video::vga::text::write("Successfully entered user mode!", video::vga::text::common_attributes::green_on_black); } |
