From 388aa556c4481a72de4a5122cb1702ae252cab30 Mon Sep 17 00:00:00 2001 From: Daniel Oertwig Date: Tue, 6 Oct 2009 00:11:25 +0200 Subject: [PATCH] Added files with basic definitions of KPC (kernel process communication). --- inc/kpc.h | 21 +++++++++++++++++++++ src/allsources | 6 +++--- src/communication/kpc.c | 11 +++++++++++ src/makefile | 1 + 4 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 inc/kpc.h rewrite src/allsources (68%) create mode 100644 src/communication/kpc.c diff --git a/inc/kpc.h b/inc/kpc.h new file mode 100644 index 0000000..de676bb --- /dev/null +++ b/inc/kpc.h @@ -0,0 +1,21 @@ +// Kernel - Process communication + +#ifndef __KERNEL__KPC___HEADER____ +#define __KERNEL__KPC___HEADER____ + +#include "types.h" +enum kpcMSG_TYPE { +kpcMSG_PAGEFAULT = 1, +kpcMSG_MEMREQUEST, +kpcMSG_MEMFREE, +kpcMSG_IOREQUEST }; + +typedef struct { + enum kpcMSG_TYPE type; + UINT args[5]; +}kpcMessage; + + + +#endif //(__KERNEL__KPC___HEADER____) + diff --git a/src/allsources b/src/allsources dissimilarity index 68% index 80f4667..c880d06 100644 --- a/src/allsources +++ b/src/allsources @@ -1,3 +1,3 @@ -SOURCES = ./boot/multiboot.c ./paging/paging_functions.c ./paging/paging_init.c ./main/main.c ./idt/idt.c ./multitasking/multitasking.c ./int/irq.c ./int/isr.c ./bio/bio.c ./gdt/gdt.c ./phys_mm/pmm_init.c ./phys_mm/pmm_functions.c ./heap/kernelheap.c ./heap/ord_array.c ./text/debug-text.c - -ASMSRC = ./paging/paging_functions_asm.asm ./main/entry_asm.asm ./idt/idt_asm.asm ./int/isr_irq_asm.asm ./gdt/gdt_asm.asm \ No newline at end of file +SOURCES = ./boot/multiboot.c ./paging/paging_functions.c ./paging/paging_init.c ./main/main.c ./communication/kpc.c ./idt/idt.c ./multitasking/multitasking.c ./int/irq.c ./int/isr.c ./bio/bio.c ./gdt/gdt.c ./phys_mm/pmm_init.c ./phys_mm/pmm_functions.c ./heap/kernelheap.c ./heap/ord_array.c ./text/debug-text.c + +ASMSRC = ./paging/paging_functions_asm.asm ./main/entry_asm.asm ./idt/idt_asm.asm ./int/isr_irq_asm.asm ./gdt/gdt_asm.asm \ No newline at end of file diff --git a/src/communication/kpc.c b/src/communication/kpc.c new file mode 100644 index 0000000..adef74c --- /dev/null +++ b/src/communication/kpc.c @@ -0,0 +1,11 @@ +#include "kpc.h" + + +void kpc_SendMessage(kpcMessage *msg) +{ + /* TODO */ + /** msg identifies the Type of Message and delivers message arguments **/ + /** the message gets written into the kpc ring buffer and will be processed by a kernelthread **/ + + /** if the ringbuffer gets to full, the kernelthread(s) have to be called directly (some kind of emergency) **/ +} diff --git a/src/makefile b/src/makefile index a4753b0..59c2aa3 100644 --- a/src/makefile +++ b/src/makefile @@ -29,6 +29,7 @@ builddirs: @mkdir -p ../build/text @mkdir -p ../build/heap @mkdir -p ../build/multitasking + @mkdir -p ../build/communication -- 2.11.4.GIT