Skip to content

Commit acbda1d

Browse files
committed
WIP
1 parent 9469a1b commit acbda1d

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

kernel/include/types.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
typedef __kernel_size_t size_t;
1212
#endif /* ifndef _SIZE_T */
1313

14+
#ifndef NULL
15+
#define NULL (void *)0x0
16+
#endif /* ifndef _NULL */
17+
1418
#ifndef _INT_TYPES
1519
#define _INT_TYPES
1620
typedef __kernel_int8_t int8_t;

kernel/makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ BUILD_DIR = ../build/kernel
55
TARGET = $(BUILD_DIR)/kernel.bin
66
ASM_OBJS = kernel_asm.o util/portio_asm.o
77
OBJS = kernel.o video/video.o interrupt/interrupt.o \
8-
interrupt/handler.o serial/serial.o
8+
interrupt/handler.o serial/serial.o memory/alloc.o
99
INCLUDE = util/portio.h video/video.h util/types.h interrupt/interrupt.h \
10-
util/keyboard_map.h config.h serial/serial.h debug/debug.h
10+
util/keyboard_map.h config.h serial/serial.h debug/debug.h \
11+
memory/alloc.h
1112
INCLUDE_DIR = include
1213

1314
all: $(TARGET)

kernel/memory/alloc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include "alloc.h"
2+
3+
void * malloc(size_t size)
4+
{
5+
return NULL;
6+
}

kernel/memory/alloc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef ALLOC_H_FCDE3OCS
22
#define ALLOC_H_FCDE3OCS
33

4+
#include <types.h>
5+
46
void * malloc (size_t size);
57
void * realloc (void *ptr, size_t size);
68
void * calloc (size_t nmemb, size_t size);

0 commit comments

Comments
 (0)