feat: added cross compiler and moved headers to include dir

This commit is contained in:
2021-03-09 19:45:20 +01:00
parent cefdb8ed90
commit dc4bf71b5a
77 changed files with 180 additions and 45 deletions

12
include/libc/kprintf.h Normal file
View File

@@ -0,0 +1,12 @@
//
// Created by rick on 06-02-21.
//
#ifndef NEW_KERNEL_KPRINTF_H
#define NEW_KERNEL_KPRINTF_H
int printf(const char *fmt, ...);
int sprintf(char *target, const char *fmt, ...);
#endif //NEW_KERNEL_KPRINTF_H

25
include/libc/libc.h Normal file
View File

@@ -0,0 +1,25 @@
/*
* libc.h
*
* Created on: Oct 11, 2018
* Author: rick
*/
#ifndef KERNEL_LIBC_LIBC_H_
#define KERNEL_LIBC_LIBC_H_
#include <types.h>
int memcpy(uint8_t *dst, const uint8_t *src, int amount);
int memset(uint8_t *dst, char data, int amount);
char *itoa(int value, char *buffer, int base);
int abs(int val);
int maxi(int a, int b);
int mini(int a, int b);
#endif /* KERNEL_LIBC_LIBC_H_ */

10
include/libc/readline.h Normal file
View File

@@ -0,0 +1,10 @@
//
// Created by rick on 01-02-21.
//
#ifndef NEW_KERNEL_READLINE_H
#define NEW_KERNEL_READLINE_H
char *readline(const char *prompt);
#endif //NEW_KERNEL_READLINE_H

19
include/libc/ringqueue.h Normal file
View File

@@ -0,0 +1,19 @@
//
// Created by rick on 30-01-21.
//
#ifndef NEW_KERNEL_RINGQUEUE_H
#define NEW_KERNEL_RINGQUEUE_H
#include <types.h>
#include <stdbool.h>
void *create_buffer(int count, int object_size);
void free_buffer(void *buffer);
void ring_buffer_put(void *buffer, void *item);
bool ring_buffer_get(void *buffer, void *target);
#endif //NEW_KERNEL_RINGQUEUE_H

11
include/libc/sort.h Normal file
View File

@@ -0,0 +1,11 @@
//
// Created by rick on 06-03-21.
//
#ifndef NEW_KERNEL_SORT_H
#define NEW_KERNEL_SORT_H
#include <types.h>
void qsort(void *base, size_t num, size_t size, int (*compar)(const void *, const void *));
#endif //NEW_KERNEL_SORT_H

18
include/libc/string.h Normal file
View File

@@ -0,0 +1,18 @@
//
// Created by rick on 01-02-21.
//
#ifndef NEW_KERNEL_STRING_H
#define NEW_KERNEL_STRING_H
int strcpy(char *dst, char *src);
int strlen(const char *str);
const char *strchr(const char *s, char c);
int strcmp(const char *s1, const char *s2);
int strncmp(const char *s1, const char *s2, int n);
#endif //NEW_KERNEL_STRING_H