Processes now keep track of where their code section ends.

This is very hacky, but allows us to allocate address space.
This commit is contained in:
Jonas 'Sortie' Termansen 2011-08-07 22:40:34 +02:00
parent db34033d40
commit e78443d92a
3 changed files with 7 additions and 1 deletions

View File

@ -253,7 +253,7 @@ namespace Sortix
if ( initrd != NULL )
{
addr_t loadat = 0x400000UL;
addr_t loadat = process->_endcodesection;
for ( size_t i = 0; i < initrdsize; i += 4096 )
{
@ -264,6 +264,8 @@ namespace Sortix
Memory::Copy((void*) loadat, initrd, initrdsize);
initstart = (Thread::Entry) loadat;
process->_endcodesection += initrdsize;
}
if ( Scheduler::CreateThread(process, initstart) == NULL )

View File

@ -41,6 +41,7 @@ namespace Sortix
Process::Process(addr_t addrspace)
{
_addrspace = addrspace;
_endcodesection = 0x400000UL;
}
Process::~Process()

View File

@ -42,6 +42,9 @@ namespace Sortix
addr_t _addrspace;
DescriptorTable descriptors;
public:
addr_t _endcodesection; // HACK
public:
addr_t GetAddressSpace() { return _addrspace; }