This commit is contained in:
2025-05-28 14:41:02 -05:00
commit 6d366537dd
73 changed files with 4448 additions and 0 deletions

30
include/panic.h Normal file
View File

@ -0,0 +1,30 @@
#ifndef _KERNEL_PANIC_H
#define _KERNEL_PANIC_H
#include <stddef.h>
#include <tty.h>
void panic(const char* arr)
{
uint8_t color = 0x1F;
uint8_t blank = 0xFF;
for (size_t y = 0; y < VGA_HEIGHT; y++)
{
for (size_t x = 0; x < VGA_WIDTH; x++)
{
const size_t index = y * VGA_WIDTH + x;
VGA_MEMORY[index] = (uint16_t) ' ' | (uint16_t) blank << 8;
}
}
int i;
for (i = 0; i < 75; i += 2)
{
VGA_MEMORY[i] = arr[i];
VGA_MEMORY[i + 1] = color;
}
}
#endif