Kernel: Add basic fixed width allocator for userspace

We have to move process stacks to the general heap and maybe map
kernel to higher half.
This commit is contained in:
Bananymous
2023-05-06 18:10:38 +03:00
parent 9c07add00f
commit bcfd838131
10 changed files with 267 additions and 9 deletions

View File

@@ -1,7 +1,18 @@
#include <stdio.h>
#include <stdlib.h>
int main()
{
void* ptr = malloc(10);
if (ptr == NULL)
{
perror("malloc");
return 1;
}
*(int*)ptr = 5;
putc('0' + *(int*)ptr, stdout);
return 0;
FILE* fp = fopen("/boot/grub/grub.cfg", "r");
if (fp == NULL)
{