summaryrefslogtreecommitdiff
path: root/Source/Kernel/TaskManager/Process.class.h
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-10-17 12:54:48 +0200
committerAlexis211 <alexis211@gmail.com>2009-10-17 12:54:48 +0200
commit82756b86977dc65468f6298787d8dca5634ac788 (patch)
tree6d8628647be9eb4a61e6dd0bf8b4ef84685be5ff /Source/Kernel/TaskManager/Process.class.h
parent4d5348a49f54d95c0271c8f9c4ef01c005d6b74b (diff)
downloadMelon-82756b86977dc65468f6298787d8dca5634ac788.tar.gz
Melon-82756b86977dc65468f6298787d8dca5634ac788.zip
Each Process now has a user heap.
It will be used for transferring data from kernel to userland.
Diffstat (limited to 'Source/Kernel/TaskManager/Process.class.h')
-rw-r--r--Source/Kernel/TaskManager/Process.class.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/Source/Kernel/TaskManager/Process.class.h b/Source/Kernel/TaskManager/Process.class.h
index b975db1..ac9614e 100644
--- a/Source/Kernel/TaskManager/Process.class.h
+++ b/Source/Kernel/TaskManager/Process.class.h
@@ -5,6 +5,7 @@
#include <Library/Vector.class.h>
#include <Library/SimpleList.class.h>
#include <MemoryManager/PageDirectory.class.h>
+#include <MemoryManager/Heap.class.h>
#include <VTManager/VirtualTerminal.proto.h>
#define P_ZOMBIE 0
@@ -15,7 +16,10 @@
#define E_ABORTED 0x0FFFFF01
#define E_UNHANDLED_EXCEPTION 0x0FFFFF02
-#define STACKSIZE 4096 //Can change
+#define STACKSIZE 4096 //Could change
+
+#define USERHEAPINITSIZE 0x00010000 //Heap initially is 64k, but can grow
+#define USERHEAPSTART 0xB7000000 //Heap is at 0xB7000000, 128Mo before kernel space.
class Thread;
class File;
@@ -32,9 +36,10 @@ class Process {
u8int m_state; //Is one of P_* defined above
PageDirectory* m_pagedir;
u32int m_uid; //User ID
- u32int m_stacksstart;
VirtualTerminal *m_vt;
+ Heap *m_userHeap;
+
Vector<Thread*> m_threads;
SimpleList<File*> *m_fileDescriptors;
@@ -43,8 +48,9 @@ class Process {
Process(String cmdline, u32int uid);
~Process();
- u32int stackAlloc(); //Allocates pages for STACKSIZE bytes at end of app memory (just before 0xC0000000)
- void exit(); //Exits properly process by killing all threads
+ Heap& heap() { return *m_userHeap; }
+
+ void exit(); //Exits properly process by killing all threads and deleting file descriptors
void registerThread(Thread* t); //Called when a thread starts
void threadFinishes(Thread* thread, u32int retval); //Called when a thread finishes