Rev 2531 | Rev 2533 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2531 | Rev 2532 | ||
---|---|---|---|
Line 39... | Line 39... | ||
39 | #include <ipc/ipc.h> |
39 | #include <ipc/ipc.h> |
40 | #include <ipc/services.h> |
40 | #include <ipc/services.h> |
41 | #include <async.h> |
41 | #include <async.h> |
42 | #include <errno.h> |
42 | #include <errno.h> |
43 | #include <unistd.h> |
43 | #include <unistd.h> |
- | 44 | #include <stdio.h>> |
|
44 | #include "../../vfs/vfs.h" |
45 | #include "../../vfs/vfs.h" |
45 | 46 | ||
- | 47 | #define dprintf(...) printf(__VA_ARGS__) |
|
- | 48 | ||
46 | vfs_info_t fat_vfs_info = { |
49 | vfs_info_t fat_vfs_info = { |
47 | .name = "fat", |
50 | .name = "fat", |
48 | .ops = { |
51 | .ops = { |
49 | [IPC_METHOD_TO_VFS_OP(VFS_REGISTER)] = VFS_OP_DEFINED, |
52 | [IPC_METHOD_TO_VFS_OP(VFS_REGISTER)] = VFS_OP_DEFINED, |
50 | [IPC_METHOD_TO_VFS_OP(VFS_MOUNT)] = VFS_OP_DEFINED, |
53 | [IPC_METHOD_TO_VFS_OP(VFS_MOUNT)] = VFS_OP_DEFINED, |
Line 62... | Line 65... | ||
62 | /* |
65 | /* |
63 | * This fibril processes request from the VFS server. |
66 | * This fibril processes request from the VFS server. |
64 | */ |
67 | */ |
65 | void fat_connection(ipc_callid_t iid, ipc_call_t *icall) |
68 | void fat_connection(ipc_callid_t iid, ipc_call_t *icall) |
66 | { |
69 | { |
- | 70 | dprintf("Callback connection established.\n"); |
|
67 | while (1) { |
71 | while (1) { |
68 | ipc_callid_t callid; |
72 | ipc_callid_t callid; |
69 | ipc_call_t call; |
73 | ipc_call_t call; |
70 | 74 | ||
71 | callid = async_get_call(&call); |
75 | callid = async_get_call(&call); |
Line 73... | Line 77... | ||
73 | } |
77 | } |
74 | } |
78 | } |
75 | 79 | ||
76 | int main(int argc, char **argv) |
80 | int main(int argc, char **argv) |
77 | { |
81 | { |
78 | ipcarg_t vfs_phone; |
82 | int vfs_phone; |
- | 83 | ||
- | 84 | printf("FAT: HelenOS FAT file system server.\n"); |
|
79 | 85 | ||
80 | vfs_phone = ipc_connect_me_to(PHONE_NS, SERVICE_VFS, 0); |
86 | vfs_phone = ipc_connect_me_to(PHONE_NS, SERVICE_VFS, 0); |
81 | while (vfs_phone != EOK) { |
87 | while (vfs_phone < EOK) { |
82 | usleep(10000); |
88 | usleep(10000); |
83 | vfs_phone = ipc_connect_me_to(PHONE_NS, SERVICE_VFS, 0); |
89 | vfs_phone = ipc_connect_me_to(PHONE_NS, SERVICE_VFS, 0); |
84 | } |
90 | } |
85 | 91 | ||
86 | /* |
92 | /* |
Line 105... | Line 111... | ||
105 | */ |
111 | */ |
106 | ipcarg_t phonehash; |
112 | ipcarg_t phonehash; |
107 | ipc_connect_to_me(vfs_phone, 0, 0, &phonehash); |
113 | ipc_connect_to_me(vfs_phone, 0, 0, &phonehash); |
108 | 114 | ||
109 | async_new_connection(phonehash, 0, NULL, fat_connection); |
115 | async_new_connection(phonehash, 0, NULL, fat_connection); |
- | 116 | ||
- | 117 | /* |
|
- | 118 | * Pick up the answer for the request to the VFS_REQUEST call. |
|
- | 119 | */ |
|
- | 120 | async_wait_for(req, NULL); |
|
- | 121 | dprintf("FAT filesystem registered.\n"); |
|
- | 122 | async_manager(); |
|
110 | return 0; |
123 | return 0; |
111 | } |
124 | } |
112 | 125 | ||
113 | /** |
126 | /** |
114 | * @} |
127 | * @} |