Problem: As our kernel grows we need more complex datastructures and functions these would come from the standard C/C++ library with normal programs. The kernel is a freestanding programme and has no access to standard libraries. Solution: We build a mini version of the standard C/C++ library which will contain the datastructures and functions we want. This library can then be statically linked into our kernel binary. Making it a statically linked library also gives more structure to the project. Keeping these random functions and datastructures in the kernel just clutters the kernel source code with less relevant source code.
12 lines
263 B
C
12 lines
263 B
C
#pragma once
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
void* memset (void* ptr, int value, size_t num);
|
|
|
|
int memcmp( const void* ptr1, const void* ptr2, size_t num);
|
|
|
|
size_t strlen(const char* str);
|
|
|
|
int strncmp ( const char* str1, const char* str2, size_t num ); |