Subversion Repositories HelenOS

Rev

Rev 3674 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3674 Rev 4337
Line 36... Line 36...
36
#include <stdio.h>
36
#include <stdio.h>
37
 
37
 
38
#include "fb.h"
38
#include "fb.h"
39
#include "ega.h"
39
#include "ega.h"
40
#include "msim.h"
40
#include "msim.h"
-
 
41
#include "ski.h"
41
#include "sgcn.h"
42
#include "sgcn.h"
42
#include "main.h"
43
#include "main.h"
43
 
44
 
44
#define NAME "fb"
45
#define NAME "fb"
45
 
46
 
46
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)
47
{
48
{
48
    void *dest;
49
    void *dest;
49
 
50
   
50
    dest = as_get_mappable_page(IPC_GET_ARG2(*call));
51
    dest = as_get_mappable_page(IPC_GET_ARG2(*call));
51
    if (ipc_answer_1(callid, EOK, (sysarg_t) dest) == 0) {
52
    if (ipc_answer_1(callid, EOK, (sysarg_t) dest) == 0) {
52
        if (*area)
53
        if (*area)
53
            as_area_destroy(*area);
54
            as_area_destroy(*area);
54
        *area = dest;
55
        *area = dest;
Line 59... Line 60...
59
{
60
{
60
    printf(NAME ": HelenOS Framebuffer service\n");
61
    printf(NAME ": HelenOS Framebuffer service\n");
61
   
62
   
62
    ipcarg_t phonead;
63
    ipcarg_t phonead;
63
    bool initialized = false;
64
    bool initialized = false;
64
 
65
   
65
#ifdef FB_ENABLED
66
#ifdef FB_ENABLED
66
    if (sysinfo_value("fb.kind") == 1) {
67
    if (sysinfo_value("fb.kind") == 1) {
67
        if (fb_init() == 0)
68
        if (fb_init() == 0)
68
            initialized = true;
69
            initialized = true;
69
    }
70
    }
70
#endif
71
#endif
71
#ifdef EGA_ENABLED
72
#ifdef EGA_ENABLED
72
    if ((!initialized) && (sysinfo_value("fb.kind") == 2)) {
73
    if ((!initialized) && (sysinfo_value("fb.kind") == 2)) {
73
        if (ega_init() == 0)
74
        if (ega_init() == 0)
74
            initialized = true;
75
            initialized = true;
Line 84... Line 85...
84
    if ((!initialized) && (sysinfo_value("fb.kind") == 4)) {
85
    if ((!initialized) && (sysinfo_value("fb.kind") == 4)) {
85
        if (sgcn_init() == 0)
86
        if (sgcn_init() == 0)
86
            initialized = true;
87
            initialized = true;
87
    }
88
    }
88
#endif
89
#endif
-
 
90
#ifdef SKI_ENABLED
-
 
91
    if ((!initialized) && (sysinfo_value("fb") != true)) {
-
 
92
        if (ski_init() == 0)
-
 
93
            initialized = true;
-
 
94
    }
-
 
95
#endif
89
 
96
 
90
    if (!initialized)
97
    if (!initialized)
91
        return -1;
98
        return -1;
92
 
99
   
93
    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)
94
        return -1;
101
        return -1;
95
   
102
   
96
    printf(NAME ": Accepting connections\n");
103
    printf(NAME ": Accepting connections\n");
97
    async_manager();
104
    async_manager();
-
 
105
   
98
    /* Never reached */
106
    /* Never reached */
99
    return 0;
107
    return 0;
100
}
108
}