Changeset 36b8100a in mainline
- Timestamp:
- 2009-06-03T19:29:18Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 73878c1
- Parents:
- 595edf5
- Location:
- uspace/app/init
- Files:
-
- 2 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/init/Makefile
r595edf5 r36b8100a 27 27 # 28 28 29 include ../../../version30 31 29 ## Setup toolchain 32 30 # … … 37 35 include $(LIBC_PREFIX)/Makefile.toolchain 38 36 39 CFLAGS += -I../../srv/kbd/include40 41 37 LIBS = $(LIBC_PREFIX)/libc.a 42 DEFS += -DRELEASE=$(RELEASE)43 38 44 39 ## Sources … … 47 42 OUTPUT = init 48 43 SOURCES = \ 49 init.c \ 50 version.c 44 init.c 51 45 52 46 OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) -
uspace/app/init/init.c
r595edf5 r36b8100a 45 45 #include <malloc.h> 46 46 #include <macros.h> 47 #include <console.h>48 47 #include <string.h> 48 #include <devmap.h> 49 49 #include "init.h" 50 #include "version.h"51 50 52 static bool mount_fs(const char *fstype) 51 static void info_print(void) 52 { 53 printf(NAME ": HelenOS init\n"); 54 } 55 56 static bool mount_root(const char *fstype) 53 57 { 54 58 int rc = -1; … … 119 123 } 120 124 125 static void getvc(char *dev, char *app) 126 { 127 char *argv[4]; 128 char vc[MAX_DEVICE_NAME]; 129 130 snprintf(vc, MAX_DEVICE_NAME, "/dev/%s", dev); 131 132 printf(NAME ": Spawning getvc on %s\n", vc); 133 134 dev_handle_t handle; 135 devmap_device_get_handle(dev, &handle, IPC_FLAG_BLOCKING); 136 137 if (handle >= 0) { 138 argv[0] = "/app/getvc"; 139 argv[1] = vc; 140 argv[2] = app; 141 argv[3] = NULL; 142 143 if (!task_spawn("/app/getvc", argv)) 144 printf(NAME ": Error spawning getvc on %s\n", vc); 145 } else 146 printf(NAME ": Error waiting on %s\n", vc); 147 } 148 121 149 int main(int argc, char *argv[]) 122 150 { 123 151 info_print(); 124 152 125 if (!mount_ fs(STRING(RDFMT))) {153 if (!mount_root(STRING(RDFMT))) { 126 154 printf(NAME ": Exiting\n"); 127 155 return -1; … … 141 169 spawn("/srv/obio"); 142 170 143 console_wait(); 144 version_print(); 145 146 spawn("/app/klog"); 147 spawn("/app/bdsh"); 171 getvc("vc0", "/app/bdsh"); 172 getvc("vc1", "/app/bdsh"); 173 getvc("vc2", "/app/bdsh"); 174 getvc("vc3", "/app/bdsh"); 175 getvc("vc4", "/app/bdsh"); 176 getvc("vc5", "/app/bdsh"); 177 getvc("vc6", "/app/klog"); 148 178 149 179 return 0; -
uspace/app/init/init.h
r595edf5 r36b8100a 29 29 /** @addtogroup init 30 30 * @{ 31 */ 31 */ 32 32 /** 33 33 * @file … … 37 37 #define __INIT_H__ 38 38 39 #define NAME "init" 39 #define NAME "init" 40 41 #define MAX_DEVICE_NAME 32 40 42 41 43 #endif … … 43 45 /** @} 44 46 */ 45
Note:
See TracChangeset
for help on using the changeset viewer.