Show
Ignore:
Timestamp:
05/20/10 16:05:25 (2 years ago)
Author:
mwhitworth
Message:

Add to TCP/IP stack.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Whitix/branches/netchannel/arch/i386/kernel/process.c

    r2084 r2085  
    3333void i386ExitThread(); 
    3434void endi386ExitThread(); 
     35void i386RetFromEvent(); 
     36void endi386RetFromEvent(); 
     37 
    3538DWORD exitCode=0xF8000000; 
     39DWORD retFromEvent; 
    3640 
    3741struct TSS* tss=(struct TSS*)(TSS_ADDR); 
     
    5660int ThrArchInit() 
    5761{ 
     62        int exitCodeSz = (DWORD)endi386ExitThread-(DWORD)i386ExitThread; 
     63        int retEventSz = (DWORD)endi386RetFromEvent - (DWORD)i386RetFromEvent; 
     64 
    5865        /* Setup up the TSS, only needed for ss0 and esp0 */ 
    5966        tss->bitmap=0x8000; /* Bitmap offset. Past limit, so every IO instruction in userspace will produce a GPF. */ 
     
    6471        /* Copy the exit code over to a user accessable page of memory. Add procesor-specific syscall method code into the page soon. */ 
    6572        VirtMemMapPage(0xF8000000, PageAlloc()->physAddr, PAGE_PRESENT | PAGE_RW | PAGE_USER); 
    66         memcpy((void*)exitCode, i386ExitThread, (DWORD)endi386ExitThread-(DWORD)i386ExitThread); 
     73        memcpy((void*)exitCode, i386ExitThread, exitCodeSz); 
     74        memcpy((void*)(exitCode + exitCodeSz), i386RetFromEvent, retEventSz); 
     75 
     76        retFromEvent = (DWORD)(exitCode + exitCodeSz); 
    6777 
    6878        return 0; 
     
    8595 
    8696        ret->esp3=*stackP; /* User stack */ 
     97        ret->eventStack = MMapDo(ret->parent, NULL, 0, 0x1000, PAGE_RW | PAGE_PRESENT | PAGE_USER, 0, MMAP_PRIVATE, NULL)+0x1000; 
    8798 
    8899        IrqSaveFlags(flags);