diff --git a/src/sys/i386/i386_exec.c b/src/sys/i386/i386_exec.c index 37c0136..cd95429 100644 --- a/src/sys/i386/i386_exec.c +++ b/src/sys/i386/i386_exec.c @@ -411,10 +411,6 @@ asm("movl %%cr3, %0;" : "=r" (cr3)); - //! Clean the virtual of COW pages left over from the fork - vmm_cleanVirtualSpace( (u_int32_t) _current->td.vm_daddr + (_current->td.vm_dsize << PAGE_SHIFT) ); - //MrOlsen 2017-12-15 - FIX! - This should be done before it was causing a lot of problems why did I free space after loading binary???? - fd = fopen( file, "r" ); /* If the file doesn't exist fail */ @@ -431,6 +427,10 @@ /* Set Threads FD to open FD */ _current->imageFd = fd; + //! Clean the virtual of COW pages left over from the fork + vmm_cleanVirtualSpace( (u_int32_t) _current->td.vm_daddr + (_current->td.vm_dsize << PAGE_SHIFT) ); + //MrOlsen 2017-12-15 - FIX! - This should be done before it was causing a lot of problems why did I free space after loading binary???? + /* Load ELF Header */ if ( (binaryHeader = (elfHeader *) kmalloc( sizeof(elfHeader) )) == 0x0 ) K_PANIC( "MALLOC FAILED" );