summaryrefslogtreecommitdiff
path: root/sys/arch/amd64/amd64
AgeCommit message (Collapse)Author
6 dayskernel/amd64: pmap: Add PTE dirty bit handlingIan Moffett
Add support for managing the page table entry dirty bit. This will allow vm(9) to know when to page-out data to backing store, among other things. Signed-off-by: Ian Moffett <ian@osmora.org>
6 dayskernel/amd64: Add support for TLB shootdownsIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 dayskernel/amd64: Only use HALT_VECTORIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 dayskernel/amd64: Reserve IDT vec 0x22 for TLB IPIsIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 dayskernel/amd64: mp: Add BSP to `ci_list'Ian Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 dayskernel/amd64: mp: Keep track of CPUs by indexIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
8 dayskernel/amd64: proc: Support kicking kernel threadsIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
10 dayskernel/amd64: hpet: Add hpet_time_nsec()Ian Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
10 dayskernel: proc: Store kernel thread flag in `proc'Ian Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
10 dayskernel/amd64: trap: Log page fault flagsIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-05-22kernel/amd64: Improve GDT implementationQuinn Stephens
* Switched to using macros for the GDT entry bits, to improve clarity and make the code easier to modify. Also got rid of some junk values in a few of the entries. * Shrunk the GDT data array from 256 entries to 7 (GDT_ENTRY_COUNT) since the GDT will only ever use 7 of the entries for now. * Aligned the GDT using __cacheline_aligned, because the GDT entries will be read every time a segment selector is loaded. * Modified code dealing with the GDTR to just use `g_gdtr`, since the same GDT/GDTR is always used. * In `gdt_load()`, changed `eax` -> `ax`, since segment registers are only 16 bits. Also replaced the `gdtr` to just use `g_gdtr`. Additionally, used the inline assembly formatting to supply segment selectors with KERNEL_CS/DS macros. Signed-off-by: Quinn Stephens <quinn@osmora.org> Signed-off-by: Ian Moffett <ian@osmora.org>
2025-05-19kernel/amd64: Deprecate intr_alloc_vector()Ian Moffett
Replace intr_alloc_vector() with a cleaner and more machine independent intr_register() Signed-off-by: Ian Moffett <ian@osmora.org>
2025-05-19kernel: syscall: Add SYS_reboot syscallIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-05-19kernel/amd64: Add reboot RESET and POWEROFF flagsIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-05-19kernel/amd64: mp: Improve AP bootstrap logicIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-05-19kernel/amd64: Stop sycning per timer interruptIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-05-16kernel/amd64: trap: Remove trap_quirks()Ian Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-05-16kernel: Add cpu_halt_others() and harden panic()Ian Moffett
Ensure interrupts are disabled at the start of panic() to prevent any interrupts from further degrading the state of the system. Also adds a newline before "panic: " to clean up the logs. Signed-off-by: Ian Moffett <ian@osmora.org>
2025-05-15kernel: proc: Do not introduce fork()Ian Moffett
Simplicity is divine, fork() may be powerful but is no longer simple. It became a thing in the late 70s during the early days of UNIX when computing was simple, when CPUs were only 16-bits, MMUs were not prevalent and RAM was only 512 KB. However it isn't 1971 anymore, process management, CPUs and memory architecture has advanced significantly since. This commit ceases work on the fork() syscall as implementing it would only introduce unnecessary complexity, security issues, hefty processing overhead and would perpetuate what should now be considered legacy. The current best alternative would be providing a form of process spawning as well as a mechanism to wait for the child process to complete. Signed-off-by: Ian Moffett <ian@osmora.org>
2025-04-17kernel/amd64: isa: Add i8042 keyboard supportIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-04-17kernel/amd64: machdep: Add sync.h headersIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-04-17kernel: Enable interrupts upon sched entryIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-03-19kernel/amd64: bus: Check bus_set() statusIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-02-21kernel: Update kernel log styleIan Moffett
Kernel logs must now all be lowercase for consistency. A new style called Peripheral Description Notation (PDN) has also been introduced to describe devices. Signed-off-by: Ian Moffett <ian@osmora.org>
2025-02-19kernel/amd64: bus: Add bus resource interfaceIan Moffett
This commit introduces a bus resource abstraction. A bus resource encapsulates bus specific information and semantics. Along with abstracting away bus specific details and providing an overall smoother interface, this additionally provides flexibility, access control and security by keeping track of permissions and allowing things to be turned on or off. Signed-off-by: Ian Moffett <ian@osmora.org>
2025-02-16project: Update copyright date to 2025Ian Moffett
Was supposed to happen on Jan 1, sorry! Happy late new year! Signed-off-by: Ian Moffett <ian@osmora.org>
2025-02-15kernel/amd64: lapic: Get rid of unused functionIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-02-15kernel/amd64: uart: Fix newline errorsIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-02-15kernel: amd64: Add more defines to UART driverQuinn Stephens
Added more defines and comments to the UART driver, based on the 16550 chip datasheet, to make it more clear how each operation works. Signed-off-by: Quinn Stephens <quinn@osmora.org> Signed-off-by: Ian Moffett <ian@osmora.org>
2024-12-20kernel/amd64: proc: Protect SWAPGS with LFENCEIan Moffett
Ensure all loads preceding SWAPGS are serialized using LFENCE. This mitigates the possibility of SWAPGS being speculatively bypassed which would lead to security issues. Signed-off-by: Ian Moffett <ian@osmora.org>
2024-12-20kernel/amd64: backtrace() -> md_backtrace()Ian Moffett
Maintain naming consistency between public machine-dependent and machine-independent functions. Signed-off-by: Ian Moffett <ian@osmora.org>
2024-12-20kernel/amd64: Add panic backtraceIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2024-10-27kernel/amd64: acpi: Remove trailing newlineIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2024-08-16kernel/amd64: trap: Handle user trapsIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2024-08-12kernel/amd64: proc: Set curtd upon thread kickIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2024-07-29kernel/amd64: Don't try IPIs with null cpu_infoIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2024-07-29kernel/amd64: cpu: Write cpu_info to IA32_GS_BASEIan Moffett
Instead of writing cpu_info to IA32_KERNEL_GS_BASE then using SWAPGS, write the cpu_info pointer directly to IA32_GS_BASE Signed-off-by: Ian Moffett <ian@osmora.org>
2024-07-29kernel/amd64: Use only defines + handle err codesIan Moffett
- Use only defines in frame.h - Improve handling of trap error codes Signed-off-by: Ian Moffett <ian@osmora.org>
2024-07-16kernel/amd64: trap: Set IPL_HIGH in trap_handler()Ian Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2024-07-16kernel/amd64: mp: Lock only around cpu_startup()Ian Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2024-07-11kernel/amd64: bus: Move MMIO_OFFSET to bus.hIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2024-07-10kernel/amd64: reboot: Halt all with REBOOT_HALTIan Moffett
This commit changes how reboot() handles REBOOT_HALT. Now instead of one core being halted, all cores will be halted through an IPI to a halt vector. Signed-off-by: Ian Moffett <ian@osmora.org>
2024-07-10kernel/amd64: mp: Add missing "static"Ian Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2024-07-10kernel/amd64: bus: Fix memory mapping conflictsIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2024-07-09kernel/amd64: bus: Add bus abstraction layerIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2024-07-09kernel/amd64: Add function to set cache policyIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2024-07-07kernel/amd64: Add serial debug loggingIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2024-07-06kernel/amd64: Add 8250 UART driverIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2024-07-04kernel/amd64: Add syscall support + SYS_exitIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2024-07-02kernel/amd64: machdep: Fix mistake in commentIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>