Files
SUB-OS/arch/x86_64/cpu/arch.c
T
subhobhai943 70d5925b16 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
2026-08-18 10:50:58 +05:30

33 lines
689 B
C

#include <arch/arch.h>
#include <arch/x86_64/gdt.h>
#include <arch/x86_64/idt.h>
#include <arch/x86_64/isr.h>
#include <arch/x86_64/pic.h>
#include <arch/x86_64/pit.h>
#include <arch/x86_64/cpuid.h>
#include <kernel/timer.h>
void arch_early_init(void) {
// x86_64 serial and tty initialized in main
}
void arch_init(void) {
gdt_init();
idt_init();
isr_init();
pic_init();
pit_init(100);
timer_wheel_init();
arch_enable_interrupts();
}
const char* arch_get_name(void) {
return "x86_64 (AMD64)";
}
uint32_t arch_get_cpu_id(void) {
uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0;
cpuid(1, &eax, &ebx, &ecx, &edx);
return (ebx >> 24) & 0xFF;
}