diff --git a/stl/mem.c b/stl/mem.c index fea6c70..56d8050 100644 --- a/stl/mem.c +++ b/stl/mem.c @@ -12,3 +12,6 @@ int memcmp(const void* left, const void* right, const size_t size) { } return 0; } + +void* memalloc(const size_t size) { +} diff --git a/stl/mem.h b/stl/mem.h index 7622014..75ff8d8 100644 --- a/stl/mem.h +++ b/stl/mem.h @@ -1,5 +1,11 @@ +struct MemSpace { + size_t size; + void* buffer; +}; /* Returns 0: if both memory buffers are the same * Return !0: if the memory buffers are not the same * */ int memcmp(const void* left, const void* right, const size_t size); + +void* memalloc(const size_t); diff --git a/stl/stlio.h b/stl/stlio.h new file mode 100644 index 0000000..edae890 --- /dev/null +++ b/stl/stlio.h @@ -0,0 +1,2 @@ +// General input/output reharding stdio + file io + diff --git a/stlio.c b/stlio.c new file mode 100644 index 0000000..9e1f5a9 --- /dev/null +++ b/stlio.c @@ -0,0 +1,10 @@ +#include "stlio.h" + +u64 write(const s8* buffer, const u64 size) { + s32 offset = Frame_Buffer_Cursor; + u64 i; + for(i = 0; i < size; i++) { + write_cell_fb((u64)offset + i, buffer[i], Green, White); + } + return i; +} diff --git a/stlio.h b/stlio.h new file mode 100644 index 0000000..dd16dcc --- /dev/null +++ b/stlio.h @@ -0,0 +1,5 @@ +#include "types.h" +#include "framebuffer.h" +// Frame buffer driver + +u64 write(const s8*, const u64); diff --git a/tests.c b/tests.c new file mode 100644 index 0000000..ead6112 --- /dev/null +++ b/tests.c @@ -0,0 +1,8 @@ +// Module for testing drivers and other things +#include "tests.h" + +void test_write() { + clear_fb(); + s8* msg1 = (s8*)"big yeet"; + write(msg1, sizeof(msg1)); +} diff --git a/tests.h b/tests.h new file mode 100644 index 0000000..926dc57 --- /dev/null +++ b/tests.h @@ -0,0 +1,3 @@ +#include "types.h" +#include "stlio.h" +void test_write();