summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2017-07-14 15:13:02 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2017-07-14 15:13:02 +0200
commitf31f7960bd260cb90ffdd766393d51bd85a547d1 (patch)
tree6a9404909186c22c6bc989624b2488830e50e64e /src
parent36bc53591247bbd16e42bbf7d5d4744a5416dfa8 (diff)
downloadabaos-f31f7960bd260cb90ffdd766393d51bd85a547d1.tar.gz
abaos-f31f7960bd260cb90ffdd766393d51bd85a547d1.tar.bz2
removed stddef.h and limits.h (come with the compiler header files)
added a stub stdint.h (only sometimes comes with the compiler) added a guide on cross compiling adapted to cross compilation, for now tcc works
Diffstat (limited to 'src')
-rw-r--r--src/README4
-rw-r--r--src/drivers/video/vga.h2
-rw-r--r--src/gui/composite_widget.c2
-rw-r--r--src/gui/desktop.c2
-rw-r--r--src/gui/text_widget.c2
-rw-r--r--src/gui/widget.c2
-rw-r--r--src/gui/window.c2
-rw-r--r--src/hardware/interrupts.h2
-rw-r--r--src/hardware/port.h2
-rw-r--r--src/kernel/console.c2
-rw-r--r--src/kernel/kernel.c2
-rw-r--r--src/kernel/memorymanagement.h3
-rw-r--r--src/kernel/tasks.h2
-rw-r--r--src/libc/limits.h7
-rw-r--r--src/libc/setjmp.h2
-rw-r--r--src/libc/stddef.h10
-rw-r--r--src/libc/stdint.h15
-rw-r--r--src/libc/stdio.c2
-rw-r--r--src/libc/stdio.h2
-rw-r--r--src/libc/stdlib.c2
-rw-r--r--src/libc/stdlib.h2
-rw-r--r--src/libc/string.h2
22 files changed, 34 insertions, 39 deletions
diff --git a/src/README b/src/README
index 7b1b51c..a1c75e4 100644
--- a/src/README
+++ b/src/README
@@ -65,10 +65,6 @@ libc
Stub C library implementation.
-C library definitions
-* stddef.h - definition of NULL, size_t
-* limits.h - domain range constants like INT_MAX
-
C library routines
* string.c - string, memory functions
* stdlib.c - UNIX standard library functions
diff --git a/src/drivers/video/vga.h b/src/drivers/video/vga.h
index 0947856..9a637a2 100644
--- a/src/drivers/video/vga.h
+++ b/src/drivers/video/vga.h
@@ -4,7 +4,7 @@
#include <stdbool.h>
#include "string.h"
-#include "stddef.h"
+#include <stddef.h>
#include "interrupts.h"
#include "port.h"
diff --git a/src/gui/composite_widget.c b/src/gui/composite_widget.c
index 743360f..07056c0 100644
--- a/src/gui/composite_widget.c
+++ b/src/gui/composite_widget.c
@@ -1,7 +1,7 @@
#include "composite_widget.h"
#include "string.h"
-#include "stddef.h"
+#include <stddef.h>
static composite_widget_vtable_t const composite_widget_vtable = {
{
diff --git a/src/gui/desktop.c b/src/gui/desktop.c
index 98fb900..9851b78 100644
--- a/src/gui/desktop.c
+++ b/src/gui/desktop.c
@@ -1,7 +1,7 @@
#include "desktop.h"
#include "string.h"
-#include "stddef.h"
+#include <stddef.h>
static desktop_vtable_t const desktop_vtable = {
{
diff --git a/src/gui/text_widget.c b/src/gui/text_widget.c
index 49c1be7..5e468c7 100644
--- a/src/gui/text_widget.c
+++ b/src/gui/text_widget.c
@@ -1,7 +1,7 @@
#include "text_widget.h"
#include "string.h"
-#include "stddef.h"
+#include <stddef.h>
static text_widget_vtable_t const text_widget_vtable = {
{
diff --git a/src/gui/widget.c b/src/gui/widget.c
index 3620761..58b03ef 100644
--- a/src/gui/widget.c
+++ b/src/gui/widget.c
@@ -1,7 +1,7 @@
#include "widget.h"
#include "string.h"
-#include "stddef.h"
+#include <stddef.h>
static widget_vtable_t const widget_vtable = {
widget_draw,
diff --git a/src/gui/window.c b/src/gui/window.c
index 80c0b6c..fd53920 100644
--- a/src/gui/window.c
+++ b/src/gui/window.c
@@ -1,7 +1,7 @@
#include "window.h"
#include "string.h"
-#include "stddef.h"
+#include <stddef.h>
static window_vtable_t const window_vtable = {
{
diff --git a/src/hardware/interrupts.h b/src/hardware/interrupts.h
index c325d4f..64040cb 100644
--- a/src/hardware/interrupts.h
+++ b/src/hardware/interrupts.h
@@ -1,7 +1,7 @@
#ifndef INTERRUPTS_H
#define INTERRUPTS_H
-#include <stdint.h>
+#include "stdint.h"
#include "port.h"
#include "tasks.h"
diff --git a/src/hardware/port.h b/src/hardware/port.h
index ec96d09..8203fea 100644
--- a/src/hardware/port.h
+++ b/src/hardware/port.h
@@ -1,7 +1,7 @@
#ifndef PORT_H
#define PORT_H
-#include <stdint.h>
+#include "stdint.h"
typedef struct {
uint16_t number; // port number, e.g. 0x3d4 VGA index register
diff --git a/src/kernel/console.c b/src/kernel/console.c
index 8caefc8..04fb44f 100644
--- a/src/kernel/console.c
+++ b/src/kernel/console.c
@@ -1,7 +1,7 @@
#include "console.h"
#include "string.h"
-#include "stddef.h"
+#include <stddef.h>
void console_init( console_t *console )
{
diff --git a/src/kernel/kernel.c b/src/kernel/kernel.c
index 3be8758..a472cde 100644
--- a/src/kernel/kernel.c
+++ b/src/kernel/kernel.c
@@ -1,5 +1,5 @@
#include <stdbool.h>
-#include <stdint.h>
+#include "stdint.h"
#include <stdarg.h>
#include "vgatext.h"
diff --git a/src/kernel/memorymanagement.h b/src/kernel/memorymanagement.h
index 647c05d..299fa4c 100644
--- a/src/kernel/memorymanagement.h
+++ b/src/kernel/memorymanagement.h
@@ -1,7 +1,8 @@
#ifndef MEMORYMANAGEMENT_H
#define MEMORYMANAGEMENT_H
-#include "stddef.h"
+#include <stddef.h>
+#include "stdint.h"
typedef struct {
size_t offset;
diff --git a/src/kernel/tasks.h b/src/kernel/tasks.h
index dddf9bb..b982d13 100644
--- a/src/kernel/tasks.h
+++ b/src/kernel/tasks.h
@@ -1,7 +1,7 @@
#ifndef TASKS_H
#define TASKS_H
-#include <stdint.h>
+#include "stdint.h"
#define TASK_STACK_SIZE 4096
diff --git a/src/libc/limits.h b/src/libc/limits.h
deleted file mode 100644
index 1fc4e37..0000000
--- a/src/libc/limits.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef LIMITS_H
-#define LIMITS_H
-
-#define INT_MAX 2147483647
-#define INT_MIN -2147483648
-
-#endif // LIMITS_H
diff --git a/src/libc/setjmp.h b/src/libc/setjmp.h
index 5f987f1..4322124 100644
--- a/src/libc/setjmp.h
+++ b/src/libc/setjmp.h
@@ -1,7 +1,7 @@
#ifndef SETJMP_H
#define SETJMP_H
-#include <stdint.h>
+#include "stdint.h"
// C99 states this should be an array so we can address it without
// the & operator, see prototypes of setjmp and longjmp
diff --git a/src/libc/stddef.h b/src/libc/stddef.h
deleted file mode 100644
index 4333661..0000000
--- a/src/libc/stddef.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef STDDEF_H
-#define STDDEF_H
-
-#include <stdint.h>
-
-#define NULL ( (void *)0 )
-
-typedef uint32_t size_t;
-
-#endif /* STDDEF_H */
diff --git a/src/libc/stdint.h b/src/libc/stdint.h
new file mode 100644
index 0000000..e0f35b6
--- /dev/null
+++ b/src/libc/stdint.h
@@ -0,0 +1,15 @@
+#ifndef STDINT_H
+#define STDINT_H
+
+#if defined( __PCC__ ) || defined( __TINYC__ )
+// TODO: no stdint.h in pcc-libs/pcc or tcc, mock one, but this one is
+// most likely very incorrect
+typedef unsigned int uint32_t;
+typedef signed int int32_t;
+typedef unsigned short uint16_t;
+typedef signed short int16_t;
+typedef unsigned char uint8_t;
+typedef signed char int8_t;
+#endif
+
+#endif // STDINT_H
diff --git a/src/libc/stdio.c b/src/libc/stdio.c
index 631cfbb..87b70ef 100644
--- a/src/libc/stdio.c
+++ b/src/libc/stdio.c
@@ -1,5 +1,5 @@
#include "stdio.h"
-#include "stddef.h"
+#include <stddef.h>
#include "stdlib.h"
#include "string.h"
diff --git a/src/libc/stdio.h b/src/libc/stdio.h
index 33d7946..58c80b1 100644
--- a/src/libc/stdio.h
+++ b/src/libc/stdio.h
@@ -3,7 +3,7 @@
#include <stdarg.h>
-#include "stddef.h"
+#include <stddef.h>
#ifdef OS_ABAOS
#include "console.h"
diff --git a/src/libc/stdlib.c b/src/libc/stdlib.c
index 07eabd4..4fea56e 100644
--- a/src/libc/stdlib.c
+++ b/src/libc/stdlib.c
@@ -1,7 +1,7 @@
#include <stdbool.h>
#include "string.h"
#include "stdlib.h"
-#include "stddef.h"
+#include <stddef.h>
#include "kernel.h"
diff --git a/src/libc/stdlib.h b/src/libc/stdlib.h
index 5b2521f..f7cfc8c 100644
--- a/src/libc/stdlib.h
+++ b/src/libc/stdlib.h
@@ -1,7 +1,7 @@
#ifndef STDLIB_H
#define STDLIB_H
-#include "stddef.h"
+#include <stddef.h>
#include "memorymanagement.h"
diff --git a/src/libc/string.h b/src/libc/string.h
index 6c0fa01..f078d48 100644
--- a/src/libc/string.h
+++ b/src/libc/string.h
@@ -1,7 +1,7 @@
#ifndef STRING_H
#define STRING_H
-#include "stddef.h"
+#include <stddef.h>
void *memset( void *s, int c, size_t n );
void *memmove( void *d, const void *s, size_t n );