🆕 HPET驱动

This commit is contained in:
fslongjin
2022-04-08 12:20:53 +08:00
parent 8bf4da2afa
commit d887f9a0f7
12 changed files with 259 additions and 36 deletions

View File

@ -23,6 +23,7 @@
#include "driver/pci/pci.h"
#include "driver/disk/ahci/ahci.h"
#include <driver/timers/rtc/rtc.h>
#include <driver/timers/HPET/HPET.h>
unsigned int *FR_address = (unsigned int *)0xb8000; //帧缓存区的地址
@ -166,8 +167,9 @@ void system_initialize()
acpi_init();
// 初始化中断模块
irq_init();
HPET_init();
smp_init();
// 先初始化系统调用模块
@ -229,10 +231,16 @@ void Start_Kernel(void)
*/
// ipi_send_IPI(DEST_PHYSICAL, IDLE, ICR_LEVEL_DE_ASSERT, EDGE_TRIGGER, 0xc8, ICR_APIC_FIXED, ICR_No_Shorthand, true, 1); // 测试ipi
struct time tt;
rtc_get_cmos_time(&tt);
kinfo("Current Time: %04d/%02d/%02d %02d:%02d:%02d", tt.year, tt.month, tt.day, tt.hour, tt.minute, tt.second);
int last_sec = rtc_now.second;
while (1)
{
if (last_sec != rtc_now.second)
{
last_sec = rtc_now.second;
kinfo("Current Time: %04d/%02d/%02d %02d:%02d:%02d", rtc_now.year, rtc_now.month, rtc_now.day, rtc_now.hour, rtc_now.minute, rtc_now.second);
}
}
while (1)
hlt();
}