MushOS  0.1
A UNIX-like OS prototype, written from scratch
Loading...
Searching...
No Matches
core/kernel/heap.c
Go to the documentation of this file.
1/**
2 * @file
3 *
4 * @brief Kernel exception handler
5 */
6
7#include "../../lib/base/heap.h"
8#include "../../lib/base/stdio.h"
9#include "../../lib/base/exceptions.h"
10
11
12extern void print_string_color(string str, byte text_color, byte back_color, u_dword length);
13
14
15static void handle_allocation_exception() {
16 print_string_color("Kernel heap exhausted!\n", HIGH_RED, BLACK, 0);
17 asm volatile ("jmp .");
18}
19
20extern void initialize_kernel_heap_handler() {
21 handle_exceptions(allocation_exception_id, handle_allocation_exception);
22}
#define allocation_exception_id
Definition: heap.h:25