Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 3751 → Rev 3750

/trunk/kernel/arch/ia32/src/drivers/ega.c
38,7 → 38,6
#include <putchar.h>
#include <mm/page.h>
#include <mm/as.h>
#include <mm/slab.h>
#include <arch/mm/page.h>
#include <synch/spinlock.h>
#include <arch/types.h>
59,7 → 58,6
SPINLOCK_INITIALIZE(egalock);
static uint32_t ega_cursor;
static uint8_t *videoram;
static uint8_t *backbuf;
 
static void ega_putchar(chardev_t *d, const char ch);
 
73,10 → 71,6
void ega_init(void)
{
uint8_t hi, lo;
 
backbuf = (uint8_t *) malloc(SCREEN * 2, 0);
if (!backbuf)
panic("Unable to allocate backbuffer.\n");
videoram = (uint8_t *) hw_map(VIDEORAM, SCREEN * 2);
outb(0x3d4, 0xe);
104,7 → 98,6
static void ega_display_char(char ch)
{
videoram[ega_cursor * 2] = ch;
backbuf[ega_cursor * 2] = ch;
}
 
/*
115,10 → 108,8
if (ega_cursor < SCREEN)
return;
 
memmove((void *) videoram, (void *) (videoram + ROW * 2), (SCREEN - ROW) * 2);
memmove((void *) backbuf, (void *) (backbuf + ROW * 2), (SCREEN - ROW) * 2);
memcpy((void *) videoram, (void *) (videoram + ROW * 2), (SCREEN - ROW) * 2);
memsetw(videoram + (SCREEN - ROW) * 2, ROW, 0x0720);
memsetw(backbuf + (SCREEN - ROW) * 2, ROW, 0x0720);
ega_cursor = ega_cursor - ROW;
}
 
160,11 → 151,5
outb(0x3d5, (uint8_t) (ega_cursor & 0xff));
}
 
void ega_redraw(void)
{
memcpy(videoram, backbuf, SCREEN * 2);
ega_move_cursor();
}
 
/** @}
*/