Changeset c0cdcaf in mainline for uspace/srv/fs/fat/fat.c


Ignore:
Timestamp:
2007-09-17T17:31:33Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c3b25510
Parents:
b006bfb8
Message:

Turn the empty fs service into the beginning of FAT support.
Start implementing the VFS protocol for fat.c.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/fat/fat.c

    rb006bfb8 rc0cdcaf  
    11/*
    22 * Copyright (c) 2006 Martin Decky
     3 * Copyright (c) 2007 Jakub Jermar
    34 * All rights reserved.
    45 *
     
    3233
    3334/**
    34  * @file        fs.c
    35  * @brief       File system driver for HelenOS.
     35 * @file        fat.c
     36 * @brief       FAT file system driver for HelenOS.
    3637 */
    3738
     39#include <ipc/ipc.h>
     40#include <ipc/services.h>
     41#include <errno.h>
     42#include <unistd.h>
     43#include "../../vfs/vfs.h"
     44
     45vfs_info_t fat_vfs_info = {
     46        .name = "fat",
     47        .ops = {
     48                [IPC_METHOD_TO_VFS_OP(VFS_REGISTER)] = VFS_OP_DEFINED,
     49                [IPC_METHOD_TO_VFS_OP(VFS_MOUNT)] = VFS_OP_DEFINED,
     50                [IPC_METHOD_TO_VFS_OP(VFS_UNMOUNT)] = VFS_OP_DEFINED,
     51                [IPC_METHOD_TO_VFS_OP(VFS_LOOKUP)] = VFS_OP_DEFINED,
     52                [IPC_METHOD_TO_VFS_OP(VFS_OPEN)] = VFS_OP_DEFINED,
     53                [IPC_METHOD_TO_VFS_OP(VFS_CREATE)] = VFS_OP_DEFINED,
     54                [IPC_METHOD_TO_VFS_OP(VFS_CLOSE)] = VFS_OP_DEFINED,
     55                [IPC_METHOD_TO_VFS_OP(VFS_READ)] = VFS_OP_DEFINED,
     56                [IPC_METHOD_TO_VFS_OP(VFS_WRITE)] = VFS_OP_NULL,
     57                [IPC_METHOD_TO_VFS_OP(VFS_SEEK)] = VFS_OP_DEFAULT
     58        }
     59};
    3860
    3961int main(int argc, char **argv)
    4062{
     63        ipcarg_t vfs_phone;
     64
     65        vfs_phone = ipc_connect_me_to(PHONE_NS, SERVICE_VFS, 0);
     66        while (vfs_phone != EOK) {
     67                usleep(10000);
     68                vfs_phone = ipc_connect_me_to(PHONE_NS, SERVICE_VFS, 0);
     69        }
     70       
     71        /* TODO: start making calls according to the VFS protocol */
     72
    4173        return 0;
    4274}
Note: See TracChangeset for help on using the changeset viewer.