summaryrefslogtreecommitdiff
path: root/sys/arch
AgeCommit message (Collapse)Author
27 hourskernel/amd64: i8042: Use DMI for quirk checkingIan Moffett
On certain embedded controllers (ECs) like the EC present on the Thinkpad T420s, writes to the i8042 controller configuration byte are not very liked by the EC internal logic and thus result in them asserting an NMI as a certain host bus error. To workaround this, Hyra falls back to polling on these specific devices. Previously, Hyra did not have DMI/SMBIOS capabilities and therefore had to rely on assuming *all* Lenovo devices were "hostile". As of now since we are capable grabbing the product version from DMI, we can target specific devices like the T420s and this commit provides that logic. This commit additionally implements logic to enable interrupts on PS/2 port 0 (aka the keyboard). Signed-off-by: Ian Moffett <ian@osmora.org>
27 hourskernel/amd64: Throw away any pre-kernel huge pagesIan Moffett
Before the Hyra kernel starts up, the Limine bootloader creates a mapping of the first 4 GiB of memory (identity mapped for base revisions of zero and mapped to the HDDM on higher base revisions). However, it usually will create a huge mapping over this which would be problematic during remaps of device MMIO base addresses as they typically reside at the 4 GiB region of RAM and as of this commit, huge pages are not a supported feature of the Hyra AMD64 pmap layer. Signed-off-by: Ian Moffett <ian@osmora.org>
27 hourskernel/amd64: Only use USER_DS in md_td_kick()Ian Moffett
The function md_td_kick() is only used for user threads and there is no need reference any kernel segments. Furthermore, the previous code would introduce a bug where rpl would always be 0. Signed-off-by: Ian Moffett <ian@osmora.org>
3 dayskernel: conf: Default to console fg of #B57614Ian Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
5 dayskernel/amd64: Only print SIMD logs on BSP initIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
5 dayskernel/amd64: Add SIMD (SSE + AVX) supportIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
5 dayskernel/amd64: mc1468xx: Add year, month and dayIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
7 dayskernel/amd64: intr: Add driver specific intr dataIan Moffett
Allow the intr_hand structure to carry driver specific and interrupt related data so that it can be passed to an interrupt handler when it is invoked. Signed-off-by: Ian Moffett <ian@osmora.org>
7 dayskernel/amd64: intr: Ensure intr_hand.name has '\0'Ian Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
7 dayskernel/aarch64: pmap: Handle PROT_EXEC prot flagIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
7 dayskernel/aarch64: Implement vas and map/unmap stubsIan Moffett
- Implement pmap_map() - Implement pmap_unmap() - Implement pmap_read_vas() - Implement pmap_switch_vas() Signed-off-by: Ian Moffett <ian@osmora.org>
7 dayskernel: pmap: Add arch-shared pmap_init() routineIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
8 dayskernel/aarch64: Add exception code + frame fixupsIan Moffett
- Add handle_exception() as higher level logic to handle the exceptions - Simplify frame.h - Call C handler in vector.S - Clean up stack after creating frame - Add register dump on exception Signed-off-by: Ian Moffett <ian@osmora.org>
8 dayskernel/aarch64: Remove stray alignment directiveIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
8 dayskernel/aarch64: Implement initial vector stubsIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
8 dayskernel/aarch64: Add intr_register() stubIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
8 dayskernel/aarch64: Make stubs up to dateIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
13 dayskernel/amd64: Return stack top after stack initIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-06-11kernel: pci: Add 'cam_hook' structure for PCI I/OIan Moffett
This change improves flexibility and allows for easy future integration of the PCI Express Enhanced Configuration Access Mechanism (ECAM) Signed-off-by: Ian Moffett <ian@osmora.org>
2025-06-09kernel/amd64: Flush TLB per cache attr updateIan Moffett
- Use pmap_update_tbl() to ensure that the TLB is flushed when caching attributes are updated. Signed-off-by: Ian Moffett <ian@osmora.org>
2025-06-09kernel/amd64: Add `alloc` to pmap_update_tbl()Ian Moffett
Add an `alloc' paramater to pmap_update_tbl() to ensure that functions like pmap_map() and pmap_unmap() have control over, whether or not to allocate new page table entries. This is useful as unmapping memory does not require new page table entries to be allocated and doing so anyways may result in undefined behaviour such as hangs. Signed-off-by: Ian Moffett <ian@osmora.org>
2025-06-08kernel/amd64: proc: Cleanup user stack vm_map()Ian Moffett
- Add prot var to keep track of flags to map with - OR prot flags with PROT_USER if rpl is 3 Signed-off-by: Ian Moffett <ian@osmora.org>
2025-06-07kernel/amd64: isa: Add AT PC MC1468XX driverIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-06-07kernel/amd64: Save %RCX before calling handlerIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-06-06kernel/amd64: isa: Add /dev/beep for pcspkrIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-06-01kernel/aarch64: pmap: Add dirty bit + cache stubsIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-06-01kernel/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>
2025-06-01kernel/amd64: Add support for TLB shootdownsIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-06-01kernel/amd64: Only use HALT_VECTORIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-06-01kernel/amd64: Reserve IDT vec 0x22 for TLB IPIsIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-06-01kernel/amd64: mp: Add BSP to `ci_list'Ian Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-06-01kernel/amd64: mp: Keep track of CPUs by indexIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-05-31kernel/amd64: proc: Support kicking kernel threadsIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-05-29kernel/amd64: hpet: Add hpet_time_nsec()Ian Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-05-28kernel: drivers: Add DRIVER_DEFER() macroIan Moffett
- Add DRIVER_DEFER() macro to schedule initialization for lower priority drivers - Expose `proc0' to the rest of the kernel Signed-off-by: Ian Moffett <ian@osmora.org>
2025-05-28kernel: syslog: Handle userspace kmsg loggingIan Moffett
- Add USER_KMSG option to configure if kernel messages should be logged in user contexts - Add syslog_silence() to silence kernel messages in user contexts if USER_KMSG is "yes" Signed-off-by: Ian Moffett <ian@osmora.org>
2025-05-28kernel: proc: Store kernel thread flag in `proc'Ian Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-05-28kconf: GENERIC: Add additional documentationIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-05-28kernel/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-22kernel/amd64: i8042: Remove conf r/w for nowIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-05-21kernel/amd64: i8042: Simplify init + handlingIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-05-21kernel/amd64: Unset CPU_IRQ(1) at kbd handler endIan Moffett
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/amd64: conf: Default to a nice green colorIan Moffett
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: i8042: Reduce logging verbosityIan 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>