mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
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:
parent
db34033d40
commit
e78443d92a
3 changed files with 7 additions and 1 deletions
|
@ -253,7 +253,7 @@ namespace Sortix
|
||||||
|
|
||||||
if ( initrd != NULL )
|
if ( initrd != NULL )
|
||||||
{
|
{
|
||||||
addr_t loadat = 0x400000UL;
|
addr_t loadat = process->_endcodesection;
|
||||||
|
|
||||||
for ( size_t i = 0; i < initrdsize; i += 4096 )
|
for ( size_t i = 0; i < initrdsize; i += 4096 )
|
||||||
{
|
{
|
||||||
|
@ -264,6 +264,8 @@ namespace Sortix
|
||||||
|
|
||||||
Memory::Copy((void*) loadat, initrd, initrdsize);
|
Memory::Copy((void*) loadat, initrd, initrdsize);
|
||||||
initstart = (Thread::Entry) loadat;
|
initstart = (Thread::Entry) loadat;
|
||||||
|
|
||||||
|
process->_endcodesection += initrdsize;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( Scheduler::CreateThread(process, initstart) == NULL )
|
if ( Scheduler::CreateThread(process, initstart) == NULL )
|
||||||
|
|
|
@ -41,6 +41,7 @@ namespace Sortix
|
||||||
Process::Process(addr_t addrspace)
|
Process::Process(addr_t addrspace)
|
||||||
{
|
{
|
||||||
_addrspace = addrspace;
|
_addrspace = addrspace;
|
||||||
|
_endcodesection = 0x400000UL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Process::~Process()
|
Process::~Process()
|
||||||
|
|
|
@ -42,6 +42,9 @@ namespace Sortix
|
||||||
addr_t _addrspace;
|
addr_t _addrspace;
|
||||||
DescriptorTable descriptors;
|
DescriptorTable descriptors;
|
||||||
|
|
||||||
|
public:
|
||||||
|
addr_t _endcodesection; // HACK
|
||||||
|
|
||||||
public:
|
public:
|
||||||
addr_t GetAddressSpace() { return _addrspace; }
|
addr_t GetAddressSpace() { return _addrspace; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue