Subversion Repositories HelenOS-historic

Rev

Rev 893 | Rev 1570 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 893 Rev 1507
Line 27... Line 27...
27
 */
27
 */
28
 
28
 
29
#include <arch/ski/ski.h>
29
#include <arch/ski/ski.h>
30
#include <console/console.h>
30
#include <console/console.h>
31
#include <console/chardev.h>
31
#include <console/chardev.h>
-
 
32
#include <arch/interrupt.h>
-
 
33
#include <sysinfo/sysinfo.h>
32
 
34
 
33
static chardev_t ski_console;
35
chardev_t ski_console;
-
 
36
chardev_t ski_uconsole;
34
static bool kb_disable;
37
static bool kb_disable;
-
 
38
int kbd_uspace=0;
35
 
39
 
36
static void ski_putchar(chardev_t *d, const char ch);
40
static void ski_putchar(chardev_t *d, const char ch);
37
static __s32 ski_getchar(void);
41
static __s32 ski_getchar(void);
38
 
42
 
39
/** Display character on debug console
43
/** Display character on debug console
Line 109... Line 113...
109
        return;
113
        return;
110
 
114
 
111
    ch = ski_getchar();
115
    ch = ski_getchar();
112
    if(ch == '\r')
116
    if(ch == '\r')
113
        ch = '\n';
117
        ch = '\n';
114
    if (ch)
118
    if (ch){
-
 
119
        if(kbd_uspace){
-
 
120
            chardev_push_character(&ski_uconsole, ch);
-
 
121
            virtual_interrupt(IRQ_KBD,NULL);
-
 
122
        }
-
 
123
        else {
115
        chardev_push_character(&ski_console, ch);
124
            chardev_push_character(&ski_console, ch);
-
 
125
 
-
 
126
        }  
-
 
127
       
-
 
128
    }  
116
}
129
}
117
 
130
 
118
/* Called from getc(). */
131
/* Called from getc(). */
119
static void ski_kb_enable(chardev_t *d)
132
static void ski_kb_enable(chardev_t *d)
120
{
133
{
Line 150... Line 163...
150
        : "i" (SKI_INIT_CONSOLE)
163
        : "i" (SKI_INIT_CONSOLE)
151
        : "r15", "r8"
164
        : "r15", "r8"
152
    );
165
    );
153
 
166
 
154
    chardev_initialize("ski_console", &ski_console, &ski_ops);
167
    chardev_initialize("ski_console", &ski_console, &ski_ops);
-
 
168
    chardev_initialize("ski_uconsole", &ski_uconsole, &ski_ops);
155
    stdin = &ski_console;
169
    stdin = &ski_console;
156
    stdout = &ski_console;
170
    stdout = &ski_console;
-
 
171
 
-
 
172
}
-
 
173
/** Setup console sysinfo (i.e. Keyboard IRQ)
-
 
174
 *
-
 
175
 * Because sysinfo neads memory allocation/dealocation
-
 
176
 * this functions should be called separetely from init.
-
 
177
 *
-
 
178
 */
-
 
179
void ski_set_console_sysinfo(void)
-
 
180
{
-
 
181
    sysinfo_set_item_val("kbd",NULL,true);
-
 
182
    sysinfo_set_item_val("kbd.irq",NULL,IRQ_KBD);
157
}
183
}