40 lines
868 B
C
40 lines
868 B
C
#ifndef KERNEL_H
|
|
#define KERNEL_H
|
|
|
|
#define PEPPEROS_VERSION_MAJOR "0"
|
|
#define PEPPEROS_VERSION_MINOR "0"
|
|
#define PEPPEROS_VERSION_PATCH "1"
|
|
|
|
enum ErrorCodes
|
|
{
|
|
ENOMEM,
|
|
EIO
|
|
};
|
|
|
|
#define CLEAR_INTERRUPTS __asm__ volatile("cli")
|
|
#define SET_INTERRUPTS __asm__ volatile("sti")
|
|
|
|
#include "io/serial/serial.h"
|
|
#include "io/term/printf.h"
|
|
#include "idt/idt.h"
|
|
|
|
#define DEBUG(log, ...) fctprintf((void*)&skputc, 0, "debug: [%s]: " log "\r\n", __FILE__, ##__VA_ARGS__)
|
|
|
|
#define CHECK_BIT(var,pos) ((var) & (1<<(pos)))
|
|
|
|
// printf("debug: [%s]: " log "\n", __FILE__, ##__VA_ARGS__);
|
|
|
|
void panic(struct cpu_status_t* ctx);
|
|
void hcf();
|
|
#define assert(check) do { if(!(check)) hcf(); } while(0)
|
|
|
|
struct boot_context
|
|
{
|
|
struct limine_framebuffer* fb;
|
|
struct limine_memmap_response* mmap;
|
|
struct limine_hhdm_response* hhdm;
|
|
struct limine_kernel_address_response* kaddr;
|
|
};
|
|
|
|
#endif
|