Hendiadyoin1
9b7e48c6bd
Kernel: Replace raw asm functions with naked ones
2021-07-05 16:40:00 +02:00
Gunnar Beutner
8c14488106
Kernel: Get rid of of some of the duplicate kernel base address macros
2021-07-05 12:28:45 +02:00
Gunnar Beutner
040fe0054b
Kernel: Merge the x86 and x86_64 boot code into a single file
...
They're mostly the same apart from some x86_64-specific parts.
2021-07-05 12:28:45 +02:00
Gunnar Beutner
5ca95b3957
Kernel: Replace some hard-coded memory addresses with macros
2021-07-04 01:07:28 +02:00
Liav A
458ac9bbba
Kernel/x86_64: Halt if we happen to boot on non-x86_64 machine
2021-07-03 18:40:37 +02:00
Gunnar Beutner
db334b50d0
Kernel: Don't byteswap the ISR number on interrupt entry
...
Let's just add the padding before we jump to interrupt_common_asm_entry.
2021-07-01 23:36:17 +02:00
Hendiadyoin1
6b9cf8376e
Kernel: Remove not needed comment in Processor.h
2021-07-01 17:32:34 +02:00
Hendiadyoin1
90cd11fa8c
Kernel: Support starting up secondary processors on x86_64
2021-07-01 10:50:00 +02:00
Gunnar Beutner
e37576440d
Kernel: Fix stack alignment on x86_64
...
These were already properly aligned (as far as I can tell).
2021-06-30 15:13:30 +02:00
Gunnar Beutner
50839bd1f1
Kernel: Properly initialize r8-r15 for new threads on x86_64
2021-06-30 15:13:30 +02:00
Gunnar Beutner
36ce2a2b76
Kernel: Fix struct layout for interrupt entries on x86_64
2021-06-29 20:03:36 +02:00
Gunnar Beutner
df9e73de25
Kernel: Add x86_64 support for fork()
2021-06-29 20:03:36 +02:00
Gunnar Beutner
e979a88af4
Kernel: Implement do_assume_context for execve() on x86_64
2021-06-28 22:29:28 +02:00
Gunnar Beutner
a8587fbfb9
Kernel: Use FlatPtr for register-sized values
2021-06-28 22:29:28 +02:00
Gunnar Beutner
b5aad1c81d
Kernel: Fix GDT and segment selectors to make userland work on x86_64
...
Userland faulted on the very first instruction before because the
PML4T/PDPT/etc. weren't marked as user-accessible. For some reason
x86 doesn't care about that.
Also, we need to provide an appropriate userspace stack segment
selector to iretq.
2021-06-28 22:29:28 +02:00
Gunnar Beutner
32840dfa17
Kernel: Implement more x86_64 context switching functionality
2021-06-28 15:55:00 +02:00
Gunnar Beutner
076692b1ef
Kernel: Implement entry code for x86_64 interrupts
...
With this fixed we can now properly handle interrupts (e.g. timer
interrupts) on x86_64.
2021-06-28 15:55:00 +02:00
Gunnar Beutner
328d44e227
Kernel: Fix stack for new threads on x86_64
...
Unlike on x86 iretq always pops rsp and ss.
2021-06-28 15:55:00 +02:00
Gunnar Beutner
9ed051fe25
Kernel: Implement initializing threads on x86_64
2021-06-27 15:46:42 +02:00
Gunnar Beutner
f285241cb8
Kernel: Rename Thread::tss to Thread::regs and add x86_64 support
...
We're using software context switches so calling this struct tss is
somewhat misleading.
2021-06-27 15:46:42 +02:00
Gunnar Beutner
df530941cc
Kernel: Implement safe_* memory access functions for x86_64
2021-06-27 15:46:42 +02:00
Gunnar Beutner
79ab9cce18
Kernel: Clear segment registers on x86_64
...
They're supposedly unused but iretq doesn't like ss being non-zero.
2021-06-27 15:46:42 +02:00
Gunnar Beutner
065c6c307d
Kernel: Add support for interrupts on x86_64
2021-06-27 15:46:42 +02:00
Gunnar Beutner
4c555684b7
Kernel: Set an appropriate GDT for 64-bit mode
2021-06-25 15:19:09 +02:00
Gunnar Beutner
d84abe51f5
Kernel: Use PML4T for 64-bit mode
2021-06-25 15:19:09 +02:00
Gunnar Beutner
13e4093da4
Kernel: Move Multiboot header into a separate file
2021-06-25 15:19:09 +02:00
Gunnar Beutner
19c0498ccc
Kernel: Update the x86_64 boot code to match i386's code
2021-06-25 15:19:09 +02:00
Gunnar Beutner
38fca26f54
Kernel: Add stubs for missing x86_64 functionality
...
This adds just enough stubs to make the kernel compile on x86_64. Obviously
it won't do anything useful - in fact it won't even attempt to boot because
Multiboot doesn't support ELF64 binaries - but it gets those compiler errors
out of the way so more progress can be made getting all the missing
functionality in place.
2021-06-24 09:27:13 +02:00
Hendiadyoin1
62f9377656
Kernel: Move special sections into Sections.h
...
This also removes a lot of CPU.h includes infavor for Sections.h
2021-06-24 00:38:23 +02:00
Hendiadyoin1
7ca3d413f7
Kernel: Pull apart CPU.h
...
This does not add any functional changes
2021-06-24 00:38:23 +02:00