summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorMichal Idziorek <m.i@gmx.at>2015-05-12 22:22:06 +0200
committerMichal Idziorek <m.i@gmx.at>2015-05-12 22:22:06 +0200
commit2c1148e7920cf1d4c772d0d81757a7f8d736648e (patch)
treeeed84fead5fae2efb3526094eed05eeae127f915 /kernel
parent0a9f1b1fb19ea7e0c54c884b7ae8c709ea738d1f (diff)
migrating to grub and elf kernel format
Diffstat (limited to 'kernel')
-rw-r--r--kernel/config.h2
-rw-r--r--kernel/kernel.c19
-rw-r--r--kernel/syscalls.c1
3 files changed, 20 insertions, 2 deletions
diff --git a/kernel/config.h b/kernel/config.h
index 26d056d..216641c 100644
--- a/kernel/config.h
+++ b/kernel/config.h
@@ -9,7 +9,7 @@
#define FOOLOS_CONSOLE_AUTOBREAK // add newline automatically at end of line
//#define FOOLOS_LOG_OFF // do not log anything
-//#define FOOLOS_CONSOLE // otherwise VESA will be used!
+#define FOOLOS_CONSOLE // otherwise VESA will be used!
#define FOOLSOS_SHOW_VESAMODES
#define MEM_PRINT_MEMORYMAP
#define LOG_BUF_SIZE 4069
diff --git a/kernel/kernel.c b/kernel/kernel.c
index 401204a..8bd60ca 100644
--- a/kernel/kernel.c
+++ b/kernel/kernel.c
@@ -16,6 +16,7 @@
#include "console.h"
+#include <stddef.h>
// for built-in shell
#include "lib/buffer/ringbuffer.h"
@@ -25,6 +26,22 @@
// mp informs us if this if this is the main processor
void kernel_main(uint32_t initial_stack, int mp)
{
+
+/*
+ int i=0;
+ while(true)
+ {
+ size_t *terminal_buffer = (uint16_t*) 0xB8000;
+ uint16_t c16='X';
+ i++;
+ if (i%2)c16='_';
+
+ c16 = c16 | 4 << 8;
+ terminal_buffer[2] = c16;
+ }
+ */
+
+
log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"initial_stack: 0x%08X",initial_stack);
//
// Configuring the PIT timer.
@@ -55,7 +72,7 @@ void kernel_main(uint32_t initial_stack, int mp)
// log buffered messages to console
log_log();
- while(1);
+ //while(1);
//
// Setup Interrupts (code segment: 0x08)
diff --git a/kernel/syscalls.c b/kernel/syscalls.c
index 63c3ce5..6d46f1a 100644
--- a/kernel/syscalls.c
+++ b/kernel/syscalls.c
@@ -8,6 +8,7 @@
#include "kernel/config.h"
#include <sys/stat.h>
#include <stdbool.h>
+#include <stddef.h>
int syscall_unhandled(int nr)