Changes in uspace/app/init/init.c [53d6ac3d:ffa2c8ef] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/init/init.c
r53d6ac3d rffa2c8ef 46 46 #include <macros.h> 47 47 #include <str.h> 48 #include < loc.h>48 #include <devmap.h> 49 49 #include <str_error.h> 50 50 #include "init.h" … … 53 53 #define ROOT_MOUNT_POINT "/" 54 54 55 #define LOCFS_FS_TYPE "locfs"56 #define LOCFS_MOUNT_POINT "/loc"55 #define DEVFS_FS_TYPE "devfs" 56 #define DEVFS_MOUNT_POINT "/dev" 57 57 58 58 #define TMPFS_FS_TYPE "tmpfs" … … 66 66 #define APP_GETTERM "/app/getterm" 67 67 68 /** Print banner */69 68 static void info_print(void) 70 69 { … … 72 71 } 73 72 74 /** Report mount operation success */75 73 static bool mount_report(const char *desc, const char *mntpt, 76 74 const char *fstype, const char *dev, int rc) … … 102 100 } 103 101 104 /** Mount root filesystem105 *106 * The operation blocks until the root filesystem107 * server is ready for mounting.108 *109 * @param[in] fstype Root filesystem type.110 *111 * @return True on success.112 * @return False on failure.113 *114 */115 102 static bool mount_root(const char *fstype) 116 103 { … … 126 113 } 127 114 128 /** Mount locfs filesystem 129 * 130 * The operation blocks until the locfs filesystem 131 * server is ready for mounting. 132 * 133 * @return True on success. 134 * @return False on failure. 135 * 136 */ 137 static bool mount_locfs(void) 138 { 139 int rc = mount(LOCFS_FS_TYPE, LOCFS_MOUNT_POINT, "", "", 115 static bool mount_devfs(void) 116 { 117 int rc = mount(DEVFS_FS_TYPE, DEVFS_MOUNT_POINT, "", "", 140 118 IPC_FLAG_BLOCKING); 141 return mount_report(" Location service filesystem", LOCFS_MOUNT_POINT,142 LOCFS_FS_TYPE,NULL, rc);119 return mount_report("Device filesystem", DEVFS_MOUNT_POINT, DEVFS_FS_TYPE, 120 NULL, rc); 143 121 } 144 122 … … 179 157 rc = task_wait(id, &texit, &retval); 180 158 if (rc != EOK) { 181 printf("%s: Error waiting for %s (%s )\n", NAME, fname,159 printf("%s: Error waiting for %s (%s(\n", NAME, fname, 182 160 str_error(rc)); 183 161 return; … … 196 174 } 197 175 198 static void console(const char *svc) 199 { 200 printf("%s: Spawning %s %s\n", NAME, SRV_CONSOLE, svc); 201 202 /* Wait for the input service to be ready */ 203 service_id_t service_id; 204 int rc = loc_service_get_id(svc, &service_id, IPC_FLAG_BLOCKING); 205 if (rc != EOK) { 206 printf("%s: Error waiting on %s (%s)\n", NAME, svc, 207 str_error(rc)); 208 return; 209 } 210 211 rc = task_spawnl(NULL, SRV_CONSOLE, SRV_CONSOLE, svc, NULL); 176 static void console(const char *dev) 177 { 178 char hid_in[DEVMAP_NAME_MAXLEN]; 179 int rc; 180 181 snprintf(hid_in, DEVMAP_NAME_MAXLEN, "%s/%s", DEVFS_MOUNT_POINT, dev); 182 183 printf("%s: Spawning %s %s\n", NAME, SRV_CONSOLE, hid_in); 184 185 /* Wait for the input device to be ready */ 186 devmap_handle_t handle; 187 rc = devmap_device_get_handle(dev, &handle, IPC_FLAG_BLOCKING); 188 if (rc != EOK) { 189 printf("%s: Error waiting on %s (%s)\n", NAME, hid_in, 190 str_error(rc)); 191 return; 192 } 193 194 rc = task_spawnl(NULL, SRV_CONSOLE, SRV_CONSOLE, hid_in, NULL); 212 195 if (rc != EOK) { 213 196 printf("%s: Error spawning %s %s (%s)\n", NAME, SRV_CONSOLE, 214 svc, str_error(rc));215 } 216 } 217 218 static void getterm(const char * svc, const char *app, bool wmsg)219 { 220 char term[ LOC_NAME_MAXLEN];197 hid_in, str_error(rc)); 198 } 199 } 200 201 static void getterm(const char *dev, const char *app, bool wmsg) 202 { 203 char term[DEVMAP_NAME_MAXLEN]; 221 204 int rc; 222 205 223 snprintf(term, LOC_NAME_MAXLEN, "%s/%s", LOCFS_MOUNT_POINT, svc);206 snprintf(term, DEVMAP_NAME_MAXLEN, "%s/%s", DEVFS_MOUNT_POINT, dev); 224 207 225 208 printf("%s: Spawning %s %s %s\n", NAME, APP_GETTERM, term, app); 226 209 227 /* Wait for the terminal service to be ready */228 service_id_t service_id;229 rc = loc_service_get_id(svc, &service_id, IPC_FLAG_BLOCKING);210 /* Wait for the terminal device to be ready */ 211 devmap_handle_t handle; 212 rc = devmap_device_get_handle(dev, &handle, IPC_FLAG_BLOCKING); 230 213 if (rc != EOK) { 231 214 printf("%s: Error waiting on %s (%s)\n", NAME, term, … … 279 262 } 280 263 281 spawn("/srv/ locfs");264 spawn("/srv/devfs"); 282 265 spawn("/srv/taskmon"); 283 266 284 if (!mount_ locfs()) {267 if (!mount_devfs()) { 285 268 printf("%s: Exiting\n", NAME); 286 269 return -2; … … 289 272 mount_tmpfs(); 290 273 291 spawn("/srv/devman");292 274 spawn("/srv/apic"); 293 275 spawn("/srv/i8259"); 276 spawn("/srv/fhc"); 294 277 spawn("/srv/obio"); 295 278 srv_start("/srv/cuda_adb"); 296 279 srv_start("/srv/i8042"); 297 280 srv_start("/srv/s3c24ser"); 281 srv_start("/srv/adb_ms"); 282 srv_start("/srv/char_ms"); 298 283 srv_start("/srv/s3c24ts"); 299 284 300 285 spawn("/srv/fb"); 301 spawn("/srv/ input");302 console("hid /input");286 spawn("/srv/kbd"); 287 console("hid_in/kbd"); 303 288 304 289 spawn("/srv/clip"); … … 316 301 317 302 #ifdef CONFIG_MOUNT_DATA 318 /* Make sure fat is running. */319 if (str_cmp(STRING(RDFMT), "fat") != 0) {320 srv_start("/srv/fat");321 }322 303 mount_data(); 323 304 #else
Note:
See TracChangeset
for help on using the changeset viewer.