Date functions (get current time)

This commit is contained in:
2026-03-26 17:59:02 +01:00
parent 532953da4d
commit 0fbaf6d26e
8 changed files with 142 additions and 3 deletions
+1 -1
View File
@@ -10,7 +10,7 @@
/* version */
#define PEPPEROS_VERSION_MAJOR "0"
#define PEPPEROS_VERSION_MINOR "0"
#define PEPPEROS_VERSION_PATCH "58"
#define PEPPEROS_VERSION_PATCH "109"
#define PEPPEROS_SPLASH \
"\x1b[38;5;196m \x1b[38;5;231m____ _____\r\n\x1b[0m"\
"\x1b[38;5;196m ____ ___ ____ ____ ___ _____\x1b[38;5;231m/ __ \\/ ___/\r\n\x1b[0m"\
+2
View File
@@ -7,6 +7,7 @@
#ifndef KERNEL_H
#define KERNEL_H
#include "limine.h"
enum ErrorCodes {
ENOMEM,
EIO
@@ -52,6 +53,7 @@ struct boot_context {
struct limine_memmap_response* mmap;
struct limine_hhdm_response* hhdm;
struct limine_kernel_address_response* kaddr;
struct limine_boot_time_response* bootdate;
};
// Are these modules initialized yet?
+1
View File
@@ -8,6 +8,7 @@
#define MEM_UTILS_H
#include <stddef.h>
#include <limine.h>
void* memcpy(void* restrict dest, const void* restrict src, size_t n);
void* memset(void* s, int c, size_t n);
+25
View File
@@ -0,0 +1,25 @@
/*
* @author xamidev <xamidev@riseup.net>
* @brief Date helper functions
* @license GPL-3.0-only
*/
#ifndef DATE_H
#define DATE_H
#include <stdint.h>
struct date {
uint64_t year;
uint8_t month;
uint8_t day;
uint8_t hour;
uint8_t minute;
uint8_t second;
};
struct date date_timestamp_to_date(uint64_t timestamp);
struct date date_now();
#endif