mirror of
https://github.com/subhobhai943/SUB-OS.git
synced 2026-10-26 00:52:50 +00:00
feat(arch): Add AArch64 / ARMv8i CPU support, cross-compilation & Linux Kconfig TUI
- Implement AArch64 HAL, vector table (16 aligned vectors), GICv2, Generic Timer, Stage-1 MMU (39-bit VA), PL011 UART - Build unified multi-architecture abstraction layer in include/arch/arch.h - Create interactive Linux-like Kconfig TUI menuconfig in scripts/kconfig/menuconfig.py - Support make menuconfig, defconfig, x86_64_defconfig, aarch64_defconfig - Update master Makefile for cross-compiling x86_64 (x86_64-elf-) and AArch64 (aarch64-linux-gnu-) - Dynamic architecture awareness across printk, uname, neofetch, and LazyBox
This commit is contained in:
1 parent
125a891621
commit
70d5925b16
41 files changed
+1926
-187
No files matched your search
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#if defined(__x86_64__)
|
||||
|
||||
static inline void outb(uint16_t port, uint8_t val) {
|
||||
__asm__ volatile ("outb %0, %1" : : "a"(val), "Nd"(port));
|
||||
}
|
||||
@@ -49,4 +51,20 @@ static inline void hlt(void) {
|
||||
__asm__ volatile ("hlt");
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
// Portable Stubs for non-x86 architectures
|
||||
static inline void outb(uint16_t port, uint8_t val) { (void)port; (void)val; }
|
||||
static inline uint8_t inb(uint16_t port) { (void)port; return 0; }
|
||||
static inline void outw(uint16_t port, uint16_t val) { (void)port; (void)val; }
|
||||
static inline uint16_t inw(uint16_t port) { (void)port; return 0; }
|
||||
static inline void outl(uint16_t port, uint32_t val) { (void)port; (void)val; }
|
||||
static inline uint32_t inl(uint16_t port) { (void)port; return 0; }
|
||||
static inline void io_wait(void) { }
|
||||
static inline void cli(void) { __asm__ volatile("msr daifset, #2" ::: "memory"); }
|
||||
static inline void sti(void) { __asm__ volatile("msr daifclr, #2" ::: "memory"); }
|
||||
static inline void hlt(void) { __asm__ volatile("wfi"); }
|
||||
|
||||
#endif
|
||||
|
||||
#endif // _ARCH_X86_64_IO_H
|
||||
Reference in new issue
Block a user