Changeset 15f3c3f in mainline for uspace/app/init/init.c
- Timestamp:
- 2011-06-22T22:00:52Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 86ffa27f
- Parents:
- ef09a7a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/init/init.c
ref09a7a r15f3c3f 46 46 #include <macros.h> 47 47 #include <str.h> 48 #include < devmap.h>48 #include <loc.h> 49 49 #include <str_error.h> 50 50 #include "init.h" … … 53 53 #define ROOT_MOUNT_POINT "/" 54 54 55 #define DEVFS_FS_TYPE "devfs"56 #define DEVFS_MOUNT_POINT "/dev"55 #define LOCFS_FS_TYPE "locfs" 56 #define LOCFS_MOUNT_POINT "/loc" 57 57 58 58 #define TMPFS_FS_TYPE "tmpfs" … … 113 113 } 114 114 115 static bool mount_ devfs(void)116 { 117 int rc = mount( DEVFS_FS_TYPE, DEVFS_MOUNT_POINT, "", "",115 static bool mount_locfs(void) 116 { 117 int rc = mount(LOCFS_FS_TYPE, LOCFS_MOUNT_POINT, "", "", 118 118 IPC_FLAG_BLOCKING); 119 return mount_report(" Device filesystem", DEVFS_MOUNT_POINT, DEVFS_FS_TYPE,120 NULL, rc);119 return mount_report("Location service filesystem", LOCFS_MOUNT_POINT, 120 LOCFS_FS_TYPE, NULL, rc); 121 121 } 122 122 … … 174 174 } 175 175 176 static void console(const char * dev)177 { 178 printf("%s: Spawning %s %s\n", NAME, SRV_CONSOLE, dev);179 180 /* Wait for the input device to be ready */181 devmap_handle_t handle;182 int rc = devmap_device_get_handle(dev, &handle, IPC_FLAG_BLOCKING);183 if (rc != EOK) { 184 printf("%s: Error waiting on %s (%s)\n", NAME, dev,185 str_error(rc)); 186 return; 187 } 188 189 rc = task_spawnl(NULL, SRV_CONSOLE, SRV_CONSOLE, dev, NULL);176 static void console(const char *svc) 177 { 178 printf("%s: Spawning %s %s\n", NAME, SRV_CONSOLE, svc); 179 180 /* Wait for the input service to be ready */ 181 service_id_t service_id; 182 int rc = loc_service_get_id(svc, &service_id, IPC_FLAG_BLOCKING); 183 if (rc != EOK) { 184 printf("%s: Error waiting on %s (%s)\n", NAME, svc, 185 str_error(rc)); 186 return; 187 } 188 189 rc = task_spawnl(NULL, SRV_CONSOLE, SRV_CONSOLE, svc, NULL); 190 190 if (rc != EOK) { 191 191 printf("%s: Error spawning %s %s (%s)\n", NAME, SRV_CONSOLE, 192 dev, str_error(rc));193 } 194 } 195 196 static void getterm(const char * dev, const char *app, bool wmsg)197 { 198 char term[ DEVMAP_NAME_MAXLEN];192 svc, str_error(rc)); 193 } 194 } 195 196 static void getterm(const char *svc, const char *app, bool wmsg) 197 { 198 char term[LOC_NAME_MAXLEN]; 199 199 int rc; 200 200 201 snprintf(term, DEVMAP_NAME_MAXLEN, "%s/%s", DEVFS_MOUNT_POINT, dev);201 snprintf(term, LOC_NAME_MAXLEN, "%s/%s", LOCFS_MOUNT_POINT, svc); 202 202 203 203 printf("%s: Spawning %s %s %s\n", NAME, APP_GETTERM, term, app); 204 204 205 /* Wait for the terminal device to be ready */206 devmap_handle_t handle;207 rc = devmap_device_get_handle(dev, &handle, IPC_FLAG_BLOCKING);205 /* Wait for the terminal service to be ready */ 206 service_id_t service_id; 207 rc = loc_service_get_id(svc, &service_id, IPC_FLAG_BLOCKING); 208 208 if (rc != EOK) { 209 209 printf("%s: Error waiting on %s (%s)\n", NAME, term, … … 257 257 } 258 258 259 spawn("/srv/ devfs");259 spawn("/srv/locfs"); 260 260 spawn("/srv/taskmon"); 261 261 262 if (!mount_ devfs()) {262 if (!mount_locfs()) { 263 263 printf("%s: Exiting\n", NAME); 264 264 return -2;
Note:
See TracChangeset
for help on using the changeset viewer.