Subversion Repositories HelenOS

Rev

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

Rev 4341 Rev 4343
Line 52... Line 52...
52
/*
52
/*
53
 * The EGA driver.
53
 * The EGA driver.
54
 * Simple and short. Function for displaying characters and "scrolling".
54
 * Simple and short. Function for displaying characters and "scrolling".
55
 */
55
 */
56
 
56
 
57
static parea_t ega_parea;   /**< Physical memory area for EGA video RAM. */
-
 
58
 
-
 
59
SPINLOCK_INITIALIZE(egalock);
57
SPINLOCK_INITIALIZE(egalock);
60
static uint32_t ega_cursor;
58
static uint32_t ega_cursor;
61
static uint8_t *videoram;
59
static uint8_t *videoram;
62
static uint8_t *backbuf;
60
static uint8_t *backbuf;
63
static ioport_t ega_base;
61
static ioport_t ega_base;
Line 81... Line 79...
81
    ega_cursor = ega_cursor - ROW;
79
    ega_cursor = ega_cursor - ROW;
82
}
80
}
83
 
81
 
84
static void ega_move_cursor(void)
82
static void ega_move_cursor(void)
85
{
83
{
86
    outb(ega_base + EGA_INDEX_REG, 0xe);
84
    pio_write_8(ega_base + EGA_INDEX_REG, 0xe);
87
    outb(ega_base + EGA_DATA_REG, (uint8_t) ((ega_cursor >> 8) & 0xff));
85
    pio_write_8(ega_base + EGA_DATA_REG, (uint8_t) ((ega_cursor >> 8) & 0xff));
88
    outb(ega_base + EGA_INDEX_REG, 0xf);
86
    pio_write_8(ega_base + EGA_INDEX_REG, 0xf);
89
    outb(ega_base + EGA_DATA_REG, (uint8_t) (ega_cursor & 0xff));  
87
    pio_write_8(ega_base + EGA_DATA_REG, (uint8_t) (ega_cursor & 0xff));   
90
}
88
}
91
 
89
 
92
static void ega_display_char(char ch, bool silent)
90
static void ega_display_char(char ch, bool silent)
93
{
91
{
94
    backbuf[ega_cursor * 2] = ch;
92
    backbuf[ega_cursor * 2] = ch;
Line 150... Line 148...
150
    ega_move_cursor();
148
    ega_move_cursor();
151
   
149
   
152
    chardev_initialize("ega_out", &ega_console, &ega_ops);
150
    chardev_initialize("ega_out", &ega_console, &ega_ops);
153
    stdout = &ega_console;
151
    stdout = &ega_console;
154
   
152
   
155
    ega_parea.pbase = videoram_phys;
-
 
156
    ega_parea.vbase = (uintptr_t) videoram;
-
 
157
    ega_parea.frames = 1;
-
 
158
    ega_parea.cacheable = false;
-
 
159
    ddi_parea_register(&ega_parea);
-
 
160
   
-
 
161
    sysinfo_set_item_val("fb", NULL, true);
153
    sysinfo_set_item_val("fb", NULL, true);
162
    sysinfo_set_item_val("fb.kind", NULL, 2);
154
    sysinfo_set_item_val("fb.kind", NULL, 2);
163
    sysinfo_set_item_val("fb.width", NULL, ROW);
155
    sysinfo_set_item_val("fb.width", NULL, ROW);
164
    sysinfo_set_item_val("fb.height", NULL, ROWS);
156
    sysinfo_set_item_val("fb.height", NULL, ROWS);
165
    sysinfo_set_item_val("fb.blinking", NULL, true);
157
    sysinfo_set_item_val("fb.blinking", NULL, true);