moved drivers to root level directory for now and created some basic test module

This commit is contained in:
shockrah 2019-09-16 13:48:25 -07:00
parent 92c5b32b12
commit e6a5966fe6
7 changed files with 37 additions and 0 deletions

View File

@ -12,3 +12,6 @@ int memcmp(const void* left, const void* right, const size_t size) {
}
return 0;
}
void* memalloc(const size_t size) {
}

View File

@ -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);

2
stl/stlio.h Normal file
View File

@ -0,0 +1,2 @@
// General input/output reharding stdio + file io

10
stlio.c Normal file
View File

@ -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;
}

5
stlio.h Normal file
View File

@ -0,0 +1,5 @@
#include "types.h"
#include "framebuffer.h"
// Frame buffer driver
u64 write(const s8*, const u64);

8
tests.c Normal file
View File

@ -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));
}

3
tests.h Normal file
View File

@ -0,0 +1,3 @@
#include "types.h"
#include "stlio.h"
void test_write();