Changeset 99

Show
Ignore:
Timestamp:
03/23/08 16:08:32 (10 months ago)
Author:
mwhitworth
Message:

Add sockets to task structure.

Location:
Whitix/trunk/kernel
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • Whitix/trunk/kernel/load.c

    r25 r99  
    1919#include <fs/vfs.h> 
    2020#include <i386/i386.h> 
     21#include <net/socket.h> 
    2122#include <string.h> 
    2223#include <vmm.h> 
     
    262263 ***********************************************************************/ 
    263264 
     265/* TODO: Move to generic load file. */ 
     266 
    264267static int ExecSetupFs(struct Process* process,char* pathName,int* fds) 
    265268{ 
     
    270273 
    271274        process->files=(struct File*)malloc(sizeof(struct File)*MAX_FILES); 
     275        process->sockets=(struct Socket**)malloc(sizeof(struct Socket*)*MAX_FILES); 
    272276        process->root=current->root; 
    273277        current->root->refs++; 
  • Whitix/trunk/kernel/main.c

    r61 r99  
    2828#include <typedefs.h> 
    2929#include <fs/vfs.h> 
     30#include <net/network.h> 
    3031#include <fs/devfs.h> 
    3132#include <init.h> 
     
    167168        VfsInit(); 
    168169        TimeInit(); 
     170        NetworkInit(); 
    169171 
    170172        start=ThrCreateProcess("KernelLoading"); 
  • Whitix/trunk/kernel/sched.c

    r51 r99  
    2929#include <vmm.h> 
    3030#include <user_acc.h> 
     31#include <net/socket.h> 
    3132 
    3233/* List heads */ 
     
    253254        ret->refs=1; 
    254255        ret->priority=PRIORITY_DEFAULT; 
     256        ret->state=THR_PAUSED; 
    255257        ThrArchCreateThread(ret,entry,user,stackP); 
    256258 
     
    454456                        DoCloseFile(&current->files[i]); 
    455457 
     458        if (current->sockets) 
     459                for (i=0; i<MAX_FILES; i++) 
     460                        SocketClose(current->sockets[i]); 
     461 
    456462        /* Does not apply to the KernelLoading process */ 
    457463        if (current->exec) 
     
    462468 
    463469        free(current->files); 
     470        free(current->sockets); 
    464471        free(current->sCwd); 
    465472} 
     
    480487{ 
    481488        struct Thread* curr,*curr2; 
    482          
    483 //      printf("ThrProcessExit(%#X,%d)\n",current,returnCode); 
    484489 
    485490        SpinLockIrq(&procListLock); 
     
    690695{ 
    691696        struct Thread* thread=ThrCreateThread(current,address,true,stackP); 
     697 
    692698        if (!thread) 
    693699                return -ENOMEM;