3 #include <video_defines.h>
6 static char logents[4][41] = {{0}};
8 #define VRAM_BASE 0xA0000UL
9 #define TEXT_CONSOLE_OFFSET 0x18000UL
11 #define TEXT_CONSOLE_BASE (VRAM_BASE + TEXT_CONSOLE_OFFSET)
15 static unsigned char vga_read(unsigned char idx)
17 outb(CRTC_IDX_REG, idx);
18 return inb(CRTC_DATA_REG);
21 static char * vga_base()
25 | (((unsigned int) vga_read(CRTC_START_ADDR_LSB_IDX)) << 9)
26 | (((unsigned int) vga_read(CRTC_START_ADDR_MSB_IDX)) << 1)
30 void strblit(char *src, int row, int col)
32 char *destp = vga_base() + row * 80 * 2 + col * 2;
33 smram_state_t old_state = smram_save_state();
35 smram_aseg_set_state(SMRAM_ASEG_SMMCODE);
39 *(destp++) = *(src++);
43 smram_restore_state(old_state);
49 char *basep = vga_base();
51 smram_state_t old_state = smram_save_state();
53 smram_aseg_set_state(SMRAM_ASEG_SMMCODE);
55 for (y = 0; y < 4; y++)
56 for (x = 40; x < 80; x++)
58 basep[y*80*2+x*2] = ' ';
59 basep[y*80*2+x*2+1] = 0x1F;
62 smram_restore_state(old_state);
64 for (y = 0; y < 4; y++)
65 strblit(logents[y], y, 40);
70 memmove(logents[0], logents[1], sizeof(logents[0])*3);
71 strcpy(logents[3], s);