Rev 4537 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4537 | Rev 4668 | ||
---|---|---|---|
Line 50... | Line 50... | ||
50 | #include <fcntl.h> |
50 | #include <fcntl.h> |
51 | #include <sys/types.h> |
51 | #include <sys/types.h> |
52 | #include <ipc/ipc.h> |
52 | #include <ipc/ipc.h> |
53 | #include <ipc/services.h> |
53 | #include <ipc/services.h> |
54 | #include <ipc/loader.h> |
54 | #include <ipc/loader.h> |
- | 55 | #include <ipc/ns.h> |
|
- | 56 | #include <macros.h> |
|
55 | #include <loader/pcb.h> |
57 | #include <loader/pcb.h> |
56 | #include <errno.h> |
58 | #include <errno.h> |
57 | #include <async.h> |
59 | #include <async.h> |
58 | #include <string.h> |
60 | #include <string.h> |
59 | #include <as.h> |
61 | #include <as.h> |
Line 77... | Line 79... | ||
77 | static char *arg_buf = NULL; |
79 | static char *arg_buf = NULL; |
78 | 80 | ||
79 | /** Number of preset files */ |
81 | /** Number of preset files */ |
80 | static int filc = 0; |
82 | static int filc = 0; |
81 | /** Preset files vector */ |
83 | /** Preset files vector */ |
82 | static char **filv = NULL; |
84 | static fdi_node_t **filv = NULL; |
83 | /** Buffer holding all preset files */ |
85 | /** Buffer holding all preset files */ |
84 | static fdi_node_t *fil_buf = NULL; |
86 | static fdi_node_t *fil_buf = NULL; |
85 | 87 | ||
86 | static elf_info_t prog_info; |
88 | static elf_info_t prog_info; |
87 | static elf_info_t interp_info; |
89 | static elf_info_t interp_info; |
Line 435... | Line 437... | ||
435 | /** Program loader main function. |
437 | /** Program loader main function. |
436 | */ |
438 | */ |
437 | int main(int argc, char *argv[]) |
439 | int main(int argc, char *argv[]) |
438 | { |
440 | { |
439 | ipcarg_t phonead; |
441 | ipcarg_t phonead; |
- | 442 | task_id_t id; |
|
- | 443 | int rc; |
|
440 | 444 | ||
441 | connected = false; |
445 | connected = false; |
442 | 446 | ||
- | 447 | /* Introduce this task to the NS (give it our task ID). */ |
|
- | 448 | id = task_get_id(); |
|
- | 449 | rc = async_req_2_0(PHONE_NS, NS_ID_INTRO, LOWER32(id), UPPER32(id)); |
|
- | 450 | if (rc != EOK) |
|
- | 451 | return -1; |
|
- | 452 | ||
443 | /* Set a handler of incomming connections. */ |
453 | /* Set a handler of incomming connections. */ |
444 | async_set_client_connection(ldr_connection); |
454 | async_set_client_connection(ldr_connection); |
445 | 455 | ||
446 | /* Register at naming service. */ |
456 | /* Register at naming service. */ |
447 | if (ipc_connect_to_me(PHONE_NS, SERVICE_LOAD, 0, 0, &phonead) != 0) |
457 | if (ipc_connect_to_me(PHONE_NS, SERVICE_LOAD, 0, 0, &phonead) != 0) |
448 | return -1; |
458 | return -2; |
449 | 459 | ||
450 | async_manager(); |
460 | async_manager(); |
451 | 461 | ||
452 | /* Never reached */ |
462 | /* Never reached */ |
453 | return 0; |
463 | return 0; |
454 | } |
464 | } |