Changeset 526 for Whitix/branches/hybrid

Show
Ignore:
Timestamp:
05/24/08 09:50:24 (5 months ago)
Author:
mwhitworth
Message:

Update build process.

Location:
Whitix/branches/hybrid/fs
Files:
1 added
10 modified

Legend:

Unmodified
Added
Removed
  • Whitix/branches/hybrid/fs/Makefile

    r7 r526  
    22include ../make.inc 
    33 
    4 OBJS = devfs.o 
     4MODULES = devfs.sys 
    55 
    6 build: $(OBJS) 
     6build: $(MODULES) 
    77        make -C fat 
    88        make -C vfs 
     
    1010        make -C isofs 
    1111 
     12modules_install: 
     13        cp *.sys ../CdRoot/System/Modules/Core 
     14        make -C isofs modules_install 
     15        make -C vfs modules_install 
     16 
    1217clean: 
    13         rm -f $(OBJS) 
     18        rm -f $(MODULES) 
    1419        make -C fat clean 
    1520        make -C vfs clean 
  • Whitix/branches/hybrid/fs/vfs/Makefile

    r333 r526  
    22include ../../make.inc 
    33 
    4 OBJS = bcache.o dir.o file.o super.o vcache.o vnode.o pipe.o poll.o 
     4MODULES = bcache.sys dir.sys file.sys super.sys vcache.sys vnode.sys poll.sys sdevice.sys 
    55 
    6 build: $(OBJS) 
     6build: $(MODULES) load.sys pipe.sys 
     7        ld -r $(MODULES) -o vfs.sys 
     8 
     9modules_install: 
     10        cp vfs.sys ../../CdRoot/System/Modules/Core 
     11        cp load.sys ../../CdRoot/System/Modules/Core 
    712 
    813clean: 
    9         rm *.o -f 
     14        rm *.o *.sys -f 
  • Whitix/branches/hybrid/fs/vfs/bcache.c

    r412 r526  
    2727#include <typedefs.h> 
    2828#include <task.h> 
     29#include <module.h> 
    2930#include <panic.h> 
    3031 
     
    225226        { 
    226227                /* I/O error */ 
    227                 printf("BlockSendRequest: error (%d) reading %u\n",err,request->sector); 
     228                KePrint("BlockSendRequest: error (%d) reading %u\n",err,request->sector); 
    228229                err=-EIO; 
    229230        }else if (err == -SIOPENDING) 
     
    232233        return err; 
    233234} 
     235 
     236SYMBOL_EXPORT(BlockSendRequestRaw); 
    234237 
    235238/*********************************************************************** 
     
    296299} 
    297300 
     301SYMBOL_EXPORT(BlockRead); 
     302 
    298303int BlockWrite(struct StorageDevice* device,struct Buffer* buffer) 
    299304{ 
     
    306311        return 0; 
    307312} 
     313 
     314SYMBOL_EXPORT(BlockWrite); 
    308315 
    309316static void BlockDeviceFreeAll(struct StorageDevice* sDevice) 
     
    341348        return 0; 
    342349} 
     350 
     351SYMBOL_EXPORT(BlockSetSize); 
    343352 
    344353int DoBlockWrite(struct StorageDevice* sDevice,struct Buffer* buffer); 
     
    384393 
    385394        if (buffer->refs < 0) 
    386                 printf("BlockFree: freeing free buffer\n"); 
    387  
    388         return 0; 
    389 } 
     395                KePrint("BlockFree: freeing free buffer\n"); 
     396 
     397        return 0; 
     398} 
     399 
     400SYMBOL_EXPORT(BlockFree); 
    390401 
    391402int DoBlockWrite(struct StorageDevice* sDevice,struct Buffer* buffer) 
     
    401412 */ 
    402413 
    403 void BufferFlusher() 
     414static void BufferFlusher() 
    404415{ 
    405416        struct StorageDevice* sDevice; 
  • Whitix/branches/hybrid/fs/vfs/dir.c

    r446 r526  
    2222#include <malloc.h> 
    2323#include <user_acc.h> 
     24#include <module.h> 
    2425 
    2526/*********************************************************************** 
     
    329330} 
    330331 
     332SYMBOL_EXPORT(FillDir); 
     333 
    331334int SysGetDirEntries(int fd,void* entries,DWORD count) 
    332335{ 
     
    354357        if (!(vNode->mode & VFS_ATTR_DIR)) 
    355358        { 
    356                 printf("SysGetDirEntries : not a directory\n"); 
     359                KePrint("SysGetDirEntries : not a directory\n"); 
    357360                return -ENOTDIR; 
    358361        } 
     
    365368        else 
    366369        { 
    367                 printf("GetDirEntries is not yet implemented for fs\n"); 
     370                KePrint("GetDirEntries is not yet implemented for fs\n"); 
    368371                return -ENOTIMPL; 
    369372        } 
  • Whitix/branches/hybrid/fs/vfs/file.c

    r500 r526  
    9696                if (res == -1) 
    9797                { 
    98                         printf("FileGenericRead: block map failed, file->position = %d, file->size = %d, file->id = %#X\n", 
     98                        KePrint("FileGenericRead: block map failed, file->position = %d, file->size = %d, file->id = %#X\n", 
    9999                                file->position,file->vNode->size,file->vNode->id); 
    100100                        IrqRestoreFlags(flags); 
     
    106106                if (!buff) 
    107107                { 
    108                         printf("Failed to read in FileGenericRead!\n"); 
     108                        KePrint("Failed to read in FileGenericRead!\n"); 
    109109                        IrqRestoreFlags(flags); 
    110110                        return -EIO; 
     
    122122        return copyOffset; 
    123123} 
     124 
     125SYMBOL_EXPORT(FileGenericRead); 
    124126 
    125127/*********************************************************************** 
     
    193195} 
    194196 
     197SYMBOL_EXPORT(DoOpenFile); 
     198 
    195199int DoReadFile(struct File* file,BYTE* buffer,DWORD size) 
    196200{ 
     
    213217        return -ENOTIMPL; 
    214218} 
     219 
     220SYMBOL_EXPORT(DoReadFile); 
    215221 
    216222int DoWriteFile(struct File* file,BYTE* buffer,DWORD size) 
     
    244250        return -ENOTIMPL; 
    245251} 
     252 
     253SYMBOL_EXPORT(DoWriteFile); 
    246254 
    247255int DoSeekFile(struct File* file,int distance,int whence) 
     
    272280} 
    273281 
     282SYMBOL_EXPORT(DoSeekFile); 
     283 
    274284/*********************************************************************** 
    275285 * 
     
    303313} 
    304314 
     315SYMBOL_EXPORT(DoCloseFile); 
     316 
    305317int FileNameMaxLength(char* path) 
    306318{ 
     
    308320        int len; 
    309321 
    310         area=VmLookupAddress(current,(DWORD)path); 
     322        area=VmLookupAddress(current, (DWORD)path); 
    311323        if (!area) 
    312324                return -EFAULT; 
     
    375387        return ret; 
    376388} 
     389 
     390SYMBOL_EXPORT(GetName); 
    377391 
    378392int VfsGetFreeFd(struct Process* process) 
  • Whitix/branches/hybrid/fs/vfs/pipe.c

    r502 r526  
    2424int PipeRead(struct File* file,BYTE* buffer,DWORD size) 
    2525{ 
    26         printf("PipeRead\n"); 
     26        KePrint("PipeRead\n"); 
    2727        return 0; 
    2828} 
     
    3030int PipeWrite(struct File* file,BYTE* buffer,DWORD size) 
    3131{ 
    32         printf("PipeWrite\n"); 
     32        KePrint("PipeWrite\n"); 
    3333        return 0; 
    3434} 
     
    4242int PipeClose(struct File* file) 
    4343{ 
    44         printf("PipeClose\n"); 
     44        KePrint("PipeClose\n"); 
    4545        return 0; 
    4646} 
  • Whitix/branches/hybrid/fs/vfs/poll.c

    r412 r526  
    7474                if (!FileGet(pollArray[i].fd)) 
    7575                { 
    76                         printf("Bad Fd? , %#X\n", current->files[pollArray[i].fd].vNode); while (1); 
     76                        KePrint("Bad Fd? , %#X\n", current->files[pollArray[i].fd].vNode); while (1); 
    7777                        return -EBADF; 
    7878                } 
  • Whitix/branches/hybrid/fs/vfs/super.c

    r412 r526  
    2020#include <fs/vfs.h> 
    2121#include <malloc.h> 
     22#include <module.h> 
    2223#include <error.h> 
    2324#include <sdevice.h> 
    2425#include <task.h> 
    2526#include <fs/devfs.h> 
     27#include <fs/exports.h> 
    2628#include <slab.h> 
    2729#include <panic.h> 
     30#include <sys.h> 
    2831 
    2932/* The root filesystem is mounted manually (i.e. not calling VfsMount) and the current->root=vnode. */ 
     
    155158                VNodeRelease(mountNode); 
    156159                VNodeRelease(deviceNode); 
    157                 printf("VfsMount: Failed to mount %s\n",mountPoint); 
     160                KePrint("VfsMount: Failed to mount %s\n",mountPoint); 
    158161                return -ENOENT; 
    159162        } 
     
    170173} 
    171174 
     175SYMBOL_EXPORT(VfsMount); 
     176 
    172177/*********************************************************************** 
    173178 * 
     
    315320} 
    316321 
     322SYMBOL_EXPORT(VfsRegisterFileSystem); 
     323 
    317324int VfsDeregisterFileSystem(struct FileSystem* fs) 
    318325{ 
     
    320327        return 0; 
    321328} 
     329 
     330SYMBOL_EXPORT(VfsDeregisterFileSystem); 
    322331 
    323332/*********************************************************************** 
     
    338347        struct FileSystem* curr; 
    339348 
    340         printf("VFS: Mounting the root filesystem\n"); 
     349        KePrint("VFS: Mounting the root filesystem\n"); 
    341350 
    342351        if (!storageDev) 
     
    345354        /* No clue what filesystem the storage device is, so try all filesystems */ 
    346355        ListForEachEntry(curr,&fsList,list) 
     356        { 
    347357                if ((superBlock=curr->readSuper(storageDev,0,NULL))) 
    348358                        break; 
     359        } 
    349360 
    350361        if (!superBlock) 
     
    362373        strcpy(current->sCwd,"/"); 
    363374 
    364         printf("VFS: Sucessfully mounted the root filesystem (%s)\n",curr->name); 
    365  
    366         return 0; 
    367 } 
     375        KePrint("VFS: Sucessfully mounted the root filesystem (%s)\n",curr->name); 
     376 
     377        return 0; 
     378} 
     379 
     380SYMBOL_EXPORT(VfsMountRoot); 
    368381 
    369382/*********************************************************************** 
     
    381394{ 
    382395        struct VfsSuperBlock* retVal=(struct VfsSuperBlock*)MemCacheAlloc(sbCache); 
     396 
    383397        if (!retVal) 
    384398                return NULL; 
     
    395409} 
    396410 
     411SYMBOL_EXPORT(VfsAllocSuper); 
     412 
    397413void VfsFreeSuper(struct VfsSuperBlock* superBlock) 
    398414{ 
     
    406422        MemCacheFree(sbCache,superBlock); 
    407423} 
     424 
     425SYMBOL_EXPORT(VfsFreeSuper); 
     426 
     427#define SYSCALL_FS_BASE         0x0 
     428 
     429struct SysCall fsSystemCalls[]= 
     430{ 
     431        { SysOpen,                              12 }, 
     432        { SysCreateDir,                 8 }, 
     433        { SysClose,                     4 }, 
     434        { SysRemove,                    4 }, 
     435        { SysRemoveDir,                 4 }, 
     436        { SysFileAccess,                8 }, 
     437        { SysFileDup,                   4 }, 
     438        { SysFileSync,                  4 }, 
     439        { SysFileSystemSync,    0 }, 
     440        { SysTruncate,                  8 }, 
     441        { SysMove,                              8 }, 
     442        { SysWrite,                     12 }, 
     443        { SysRead,                              12 }, 
     444        { SysSeek,                              12 }, 
     445        { SysChangeDir,                 4  }, 
     446        { SysChangeRoot,                4  }, 
     447        { SysMount,                             16 }, 
     448        { SysUnmount,                   4  }, 
     449        { SysGetDirEntries,             12 }, 
     450        { SysGetCurrDir,                8  }, 
     451        { SysStat,                              8  }, 
     452        { 0, 0 }, 
     453}; 
    408454 
    409455int VfsInit() 
     
    417463                return -ENOMEM; 
    418464 
    419         return 0; 
    420 } 
    421  
     465        /* Register system calls for the whole virtual filesystem layer. */ 
     466        SysRegisterRange(SYSCALL_FS_BASE, fsSystemCalls); 
     467 
     468        return 0; 
     469} 
     470 
     471ModuleInit(VfsInit); 
     472 
  • Whitix/branches/hybrid/fs/vfs/vcache.c

    r501 r526  
    258258        if (!vNode->refs) 
    259259        { 
    260                 printf("VNodeRelease: Trying to free free vNode (%#X on %s)\n",vNode->id,vNode->superBlock->sDevice->name); 
     260                KePrint("VNodeRelease: Trying to free free vNode (%#X on %s)\n",vNode->id,vNode->superBlock->sDevice->name); 
    261261                return; 
    262262        } 
     
    291291        MemCacheFree(vNodeCache,vNode); 
    292292} 
     293 
     294SYMBOL_EXPORT(VNodeRelease); 
    293295 
    294296/* Should be a spinlock for SMP */ 
  • Whitix/branches/hybrid/fs/vfs/vnode.c

    r412 r526  
    1919#include <fs/vfs.h> 
    2020#include <error.h> 
     21#include <module.h> 
    2122#include <task.h> 
    2223#include <typedefs.h> 
     
    259260} 
    260261 
     262SYMBOL_EXPORT(NameToVNode); 
     263 
    261264/* TODO: Get BlockRead code to read into same physical page of memory. */ 
    262265 
     
    291294                        if (!buff) 
    292295                        { 
    293                                 printf("FileGenericReadPage: failed to read\n"); 
     296                                KePrint("FileGenericReadPage: failed to read\n"); 
    294297                                return -EIO; 
    295298                        } 
     
    304307        return 0; 
    305308} 
     309 
     310SYMBOL_EXPORT(FileGenericReadPage); 
     311