Changeset 5d9d9a9 in mainline


Ignore:
Timestamp:
2009-03-02T13:58:09Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a212307
Parents:
2e079b70
Message:

make sure the EGA framebuffer is initialized with proper attributes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/src/drivers/ega/ega.c

    r2e079b70 r5d9d9a9  
    6161static ioport8_t *ega_base;
    6262
     63#define EMPTY_CHAR  0x0720
     64
    6365chardev_t ega_console;
    6466
     
    7072        if (ega_cursor < EGA_SCREEN)
    7173                return;
    72 
     74       
    7375        memmove((void *) videoram, (void *) (videoram + EGA_COLS * 2),
    7476            (EGA_SCREEN - EGA_COLS) * 2);
    7577        memmove((void *) backbuf, (void *) (backbuf + EGA_COLS * 2),
    7678            (EGA_SCREEN - EGA_COLS) * 2);
    77         memsetw(videoram + (EGA_SCREEN - EGA_COLS) * 2, EGA_COLS, 0x0720);
    78         memsetw(backbuf + (EGA_SCREEN - EGA_COLS) * 2, EGA_COLS, 0x0720);
     79        memsetw(videoram + (EGA_SCREEN - EGA_COLS) * 2, EGA_COLS, EMPTY_CHAR);
     80        memsetw(backbuf + (EGA_SCREEN - EGA_COLS) * 2, EGA_COLS, EMPTY_CHAR);
    7981        ega_cursor = ega_cursor - EGA_COLS;
    8082}
     
    104106       
    105107        ega_cursor = (hi << 8) | lo;
     108       
     109        if (ega_cursor >= EGA_SCREEN)
     110                ega_cursor = 0;
     111       
    106112        if ((ega_cursor % EGA_COLS) != 0)
    107113                ega_cursor = (ega_cursor + EGA_COLS) - ega_cursor % EGA_COLS;
     114       
     115        memsetw(videoram + ega_cursor * 2, EGA_SCREEN - ega_cursor, EMPTY_CHAR);
     116        memsetw(backbuf + ega_cursor * 2, EGA_SCREEN - ega_cursor, EMPTY_CHAR);
    108117       
    109118        ega_check_cursor();
     
    120129}
    121130
    122 static void ega_putchar(chardev_t *d __attribute__((unused)), const char ch, bool silent)
     131static void ega_putchar(chardev_t *dev __attribute__((unused)), const char ch, bool silent)
    123132{
    124133        ipl_t ipl;
Note: See TracChangeset for help on using the changeset viewer.