Get RTC date

This commit is contained in:
2025-10-15 23:08:23 +02:00
parent 846ddd54f3
commit eefff6e492
4 changed files with 129 additions and 0 deletions

View File

@ -13,12 +13,22 @@
#include "proc/proc.h"
#include "dev/dev.h"
#include "randcrypto/randcrypto.h"
#include "time/time.h"
void log_bootinfo(void) {
char buf[100];
LOG("kmain", "Memory total = %s\n", human_size(BOOT_INFO.memmap_total, buf, sizeof(buf)));
}
void log_time(void) {
Time time;
time_get(&time);
timeunix_t unix = time_tounix(&time);
LOG("kmain", "TIME: %02u/%02u/%02u %02u:%02u:%02u (%lu)\n", time.day, time.month, time.year,
time.hour, time.minute, time.second,
unix);
}
static volatile LIMINE_BASE_REVISION(2);
void kmain(void) {
@ -29,6 +39,7 @@ void kmain(void) {
bootinfo_init();
term_init(BOOT_INFO.fb->address);
log_bootinfo();
log_time();
hal_init();
pmm_init();
hal_vmm_init();