Can I use `strlen()`, `strcpy()`, `strrev()`, `strcmp()` or `strcat()` when creating a kernel in C?

Viewed 176

I am trying to make a kernel which has some functions that print out characters, draw, etc. And these functions will later be linked with assembly. I was wondering if I could still use these functions: strlen() strcpy() strrev() strcmp() strcat()

3 Answers

Anyways, I found this snippet of code from osdev.org, which I am going to build off of, to have the strlen() function, although I cant find a way to create the other functions that I listed in the title if this question.

size_t strlen(const char* str) 
{
    size_t len = 0;
    while (str[len])
        len++;
    return len;
}

I've found out after experimenting, that you can actually use some libraries, like stdint.h and stdbool.h even when making a kernel in C. Although this can be done, I have implemented my own versions of the functions that I asked about above...

Related