Rev 3022 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3022 | Rev 4055 | ||
---|---|---|---|
Line 31... | Line 31... | ||
31 | #include <sysinfo.h> |
31 | #include <sysinfo.h> |
32 | #include <async.h> |
32 | #include <async.h> |
33 | #include <as.h> |
33 | #include <as.h> |
34 | #include <align.h> |
34 | #include <align.h> |
35 | #include <errno.h> |
35 | #include <errno.h> |
- | 36 | #include <stdio.h> |
|
36 | 37 | ||
37 | #include "fb.h" |
38 | #include "fb.h" |
38 | #include "sysio.h" |
- | |
39 | #include "ega.h" |
39 | #include "ega.h" |
- | 40 | #include "msim.h" |
|
- | 41 | #include "ski.h" |
|
- | 42 | #include "sgcn.h" |
|
40 | #include "main.h" |
43 | #include "main.h" |
41 | 44 | ||
- | 45 | #define NAME "fb" |
|
- | 46 | ||
42 | void receive_comm_area(ipc_callid_t callid, ipc_call_t *call, void **area) |
47 | void receive_comm_area(ipc_callid_t callid, ipc_call_t *call, void **area) |
43 | { |
48 | { |
44 | void *dest; |
49 | void *dest; |
45 | 50 | ||
46 | dest = as_get_mappable_page(IPC_GET_ARG2(*call)); |
51 | dest = as_get_mappable_page(IPC_GET_ARG2(*call)); |
Line 51... | Line 56... | ||
51 | } |
56 | } |
52 | } |
57 | } |
53 | 58 | ||
54 | int main(int argc, char *argv[]) |
59 | int main(int argc, char *argv[]) |
55 | { |
60 | { |
- | 61 | printf(NAME ": HelenOS Framebuffer service\n"); |
|
- | 62 | ||
56 | ipcarg_t phonead; |
63 | ipcarg_t phonead; |
57 | int initialized = 0; |
64 | bool initialized = false; |
58 | 65 | ||
59 | #ifdef FB_ENABLED |
66 | #ifdef FB_ENABLED |
60 | if (sysinfo_value("fb.kind") == 1) { |
67 | if (sysinfo_value("fb.kind") == 1) { |
61 | if (fb_init() == 0) |
68 | if (fb_init() == 0) |
62 | initialized = 1; |
69 | initialized = true; |
63 | } |
70 | } |
64 | #endif |
71 | #endif |
65 | #ifdef EGA_ENABLED |
72 | #ifdef EGA_ENABLED |
66 | if (!initialized && sysinfo_value("fb.kind") == 2) { |
73 | if ((!initialized) && (sysinfo_value("fb.kind") == 2)) { |
67 | if (ega_init() == 0) |
74 | if (ega_init() == 0) |
68 | initialized = 1; |
75 | initialized = true; |
- | 76 | } |
|
- | 77 | #endif |
|
- | 78 | #ifdef MSIM_ENABLED |
|
- | 79 | if ((!initialized) && (sysinfo_value("fb.kind") == 3)) { |
|
- | 80 | if (msim_init() == 0) |
|
- | 81 | initialized = true; |
|
- | 82 | } |
|
- | 83 | #endif |
|
- | 84 | #ifdef SGCN_ENABLED |
|
- | 85 | if ((!initialized) && (sysinfo_value("fb.kind") == 4)) { |
|
- | 86 | if (sgcn_init() == 0) |
|
- | 87 | initialized = true; |
|
- | 88 | } |
|
- | 89 | #endif |
|
- | 90 | #ifdef SKI_ENABLED |
|
- | 91 | if ((!initialized) && (sysinfo_value("fb") != true)) { |
|
- | 92 | if (ski_init() == 0) |
|
- | 93 | initialized = true; |
|
69 | } |
94 | } |
70 | #endif |
95 | #endif |
71 | 96 | ||
72 | if (!initialized) |
97 | if (!initialized) |
73 | sysio_init(); |
98 | return -1; |
74 | 99 | ||
75 | if (ipc_connect_to_me(PHONE_NS, SERVICE_VIDEO, 0, 0, &phonead) != 0) |
100 | if (ipc_connect_to_me(PHONE_NS, SERVICE_VIDEO, 0, 0, &phonead) != 0) |
76 | return -1; |
101 | return -1; |
77 | 102 | ||
- | 103 | printf(NAME ": Accepting connections\n"); |
|
78 | async_manager(); |
104 | async_manager(); |
- | 105 | ||
79 | /* Never reached */ |
106 | /* Never reached */ |
80 | return 0; |
107 | return 0; |
81 | } |
108 | } |