Fixup C++ compiler path in makefile of CoreLib

memcpy implementation added
This commit is contained in:
Nigel Barink 2023-02-25 20:04:34 +01:00
parent 644ff5b1f5
commit 745656eb2d
3 changed files with 15 additions and 1 deletions

View File

@ -1,4 +1,4 @@
CPP = ${HOME}/opt/cross/bin/i686-elf-g++
CPP = /opt/cross/bin/i686-elf-g++
CFLAGS = -ffreestanding -Og -ggdb -Wall -Wextra
BUILD_DIR = ../build/CoreLib
@ -12,6 +12,7 @@ all: $(OUTPUTFILE)
cp *.h $(BUILD_DIR)/include/CoreLib
$(OUTPUTFILE): $(OFILES)
pwd
ar -rc $(OUTPUTFILE) $(OFILES)
$(OBJ_FOLDER)/memory.o: Memory.cpp

View File

@ -32,6 +32,17 @@ int memcmp( const void* ptr1, const void* ptr2, size_t num)
}
void memcpy (void* dest, const void* src, size_t count ){
for( int i = 0; i < count; i++){
((char *)dest)[i] = ((const char*)src)[i];
}
}
size_t strlen(const char* str) {
size_t len = 0;
while(str[len]){

View File

@ -7,6 +7,8 @@ void* memset (void* ptr, int value, size_t num);
int memcmp( const void* ptr1, const void* ptr2, size_t num);
void memcpy (void* dest, const void* src, size_t count );
size_t strlen(const char* str);
int strncmp ( const char* str1, const char* str2, size_t num );