wip: memory is almost fixed and working fine (infinite loop on zones linked lists)

This commit is contained in:
2024-10-19 23:20:13 +02:00
parent 55037b75fa
commit 73b8ffb3b8
10 changed files with 61 additions and 37 deletions

View File

@ -11,7 +11,7 @@
// BPZ = Blocks Per Zone, which is the max
// number of blocks for a new zone
enum { BPZ = 128, PAGES_TINY = 16, PAGES_SMALL = 64, MEM_ALIGN = 4 };
enum { BPZ = 128, PAGES_TINY = 16, PAGES_SMALL = 64, MEM_ALIGN = 8 };
typedef enum { TINY, SMALL, LARGE } block_type_t;

View File

@ -4,8 +4,10 @@
#include "kprintf.h"
#include <stdint.h>
#define PRINT_PTR(X) kprintf("%s: %p\n", #X, X)
#define PRINT_INT(X) kprintf("%s: %d\n", #X, X)
#define PRINT_PTR(X) kprintf("%s:%u %s: %p\n", __FILE__, __LINE__, #X, X)
#define PRINT_STR(X) kprintf("%s:%u %s: %s\n", __FILE__, __LINE__, #X, X)
#define PRINT_UINT(X) kprintf("%s:%u %s: %u\n", __FILE__, __LINE__, #X, X)
#define PRINT_INT(X) kprintf("%s:%u %s: %d\n", __FILE__, __LINE__, #X, X)
#define assert(X) \
do { \
if (!(X)) { \

View File

@ -13,4 +13,4 @@
#define KERN_DEBUG "8"
int kprintf(const char *restrict format, ...);
int kvprintf(const char *restrict format, va_list ap);
int kvprintf(const char *restrict format, va_list *ap);