/trunk/uspace/srv/fs/fat/fat.h |
---|
0,0 → 1,53 |
/* |
* Copyright (c) 2007 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup fs |
* @{ |
*/ |
#ifndef FAT_FAT_H_ |
#define FAT_FAT_H_ |
#include <ipc/ipc.h> |
#include <atomic.h> |
#include <sys/types.h> |
#include <bool.h> |
#define dprintf(...) printf(__VA_ARGS__) |
extern uint8_t *plb_ro; |
extern int block_read(int, unsigned long, void *); |
extern void fat_lookup(ipc_callid_t, ipc_call_t *); |
#endif |
/** |
* @} |
*/ |
/trunk/uspace/srv/fs/fat/fat.c |
---|
36,6 → 36,7 |
* @brief FAT file system driver for HelenOS. |
*/ |
#include "fat.h" |
#include <ipc/ipc.h> |
#include <ipc/services.h> |
#include <async.h> |
45,7 → 46,6 |
#include <as.h> |
#include "../../vfs/vfs.h" |
#define dprintf(...) printf(__VA_ARGS__) |
vfs_info_t fat_vfs_info = { |
.name = "fat", |
79,7 → 79,7 |
* |
* There are few issues with this arrangement. First, VFS can run out of |
* available phones. In that case, VFS can close some other phones or use one |
* phone for more serialized requests. Similarly, FAT can refuse to duplicate |
* phone for more serialized requests. Similarily, FAT can refuse to duplicate |
* the connection. VFS should then just make use of already existing phones and |
* route its requests through them. To avoid paying the fibril creation price |
* upon each request, FAT might want to keep the connections open after the |
103,6 → 103,12 |
callid = async_get_call(&call); |
switch (IPC_GET_METHOD(call)) { |
case VFS_REGISTER: |
ipc_answer_0(callid, EOK); |
break; |
case VFS_LOOKUP: |
fat_lookup(callid, &call); |
break; |
default: |
ipc_answer_0(callid, ENOTSUP); |
break; |
110,6 → 116,10 |
} |
} |
int block_read(int dev_handle, unsigned long blkno, void *buf) |
{ |
} |
int main(int argc, char **argv) |
{ |
int vfs_phone; |
/trunk/uspace/srv/fs/fat/fat_ops.c |
---|
0,0 → 1,54 |
/* |
* Copyright (c) 2007 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup fs |
* @{ |
*/ |
/** |
* @file fat_ops.c |
* @brief Implementation of VFS operations for the FAT file system server. |
*/ |
#include "fat.h" |
#include <ipc/ipc.h> |
#include <async.h> |
#include <errno.h> |
void fat_lookup(ipc_callid_t rid, ipc_call_t *request) |
{ |
int first = IPC_GET_ARG1(*request); |
int second = IPC_GET_ARG2(*request); |
int dev_handle = IPC_GET_ARG3(*request); |
} |
/** |
* @} |
*/ |
/trunk/uspace/srv/fs/fat/Makefile |
---|
40,7 → 40,8 |
OUTPUT = fat |
SOURCES = \ |
fat.c |
fat.c \ |
fat_ops.c |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |