--- /dev/null
+#ifndef _STRING_H
+#define _STRING_H
+
+#include <sys/types.h>
+
+void* memset(void *dst, int val, u32_t n);
+void* memcpy(void *dst, const void *src, u32_t n);
+size_t strlen(const char*);
+
+#endif /* _STRING_H */
-OBJECTS = arch/arch.o core/core.o
-DEPS = arch core
+OBJECTS = arch/arch.o core/core.o klibc/klibc.a
+DEPS = arch core klibc
LDFLAGS = --oformat=elf32-i386 -b elf32-i386 -m elf_i386
CFLAGS = -m32 -Wall -nostdlib -nodefaultlibs -nostartfiles -ffreestanding
PHONY = $(DEPS) clean
#include <corax/types.h>
#include <debug.h>
+#include <string.h>
#define ABS(x) (((x) < 0) ? (-(x)) : (x))
return(dividend);
}
-void* memset(void *dst, int val, u32_t n)
-{
- char *ptr;
-
- ptr = dst;
- while(n--) {
- *ptr++ = val;
- }
- return(dst);
-}
-
-void* memcpy(void *dst, const void *src, u32_t n)
-{
- char *d;
- const char *s;
-
- d = dst;
- s = src;
- while(n--) {
- *d++ = *s++;
- }
- return(dst);
-}
-
static void _putchar(int c)
{
if(c == '\n') {
#include <corax/errno.h>
#include <debug.h>
+#include <string.h>
#include "paging.h"
#include "heap.h"
#include <multiboot.h>
#include <debug.h>
#include <arch.h>
+#include <string.h>
#include "cpu.h"
#include "paging.h"
#include "heap.h"
#include <debug.h>
#include <process.h>
#include <signal.h>
+#include <string.h>
#include "fd.h"
#include "sched.h"
#define PANIC(msg) dbg_panic(__func__, __FILE__, __LINE__, msg)
-void* memset(void *dst, int val, u32_t n);
-void* memcpy(void *dst, const void *src, u32_t n);
-
int dbg_printf(const char*, ...);
void dbg_panic(const char*, const char*, i32_t, const char*);