static void crtc_cursor(int x, int y);
static void crtc_getcursor(int *x, int *y);
static void crtc_setstart(int y);
+static int crtc_getstart(void);
static inline unsigned char crtc_read(int reg);
static inline void crtc_write(int reg, unsigned char val);
static int curvis;
static int scr_on = 1;
+
int con_init(void)
{
#ifdef CON_SERIAL
cy0 &= 0x1f;
cy1 = crtc_read(CRTC_REG_CUREND) & 0x1f;
+ start_line = crtc_getstart();
crtc_getcursor(&cursor_x, &cursor_y);
con_show_cursor(1);
- crtc_setstart(0);
scr_on = 1;
#endif
crtc_write(CRTC_REG_START_H, addr >> 8);
}
+static int crtc_getstart(void)
+{
+ unsigned int addr;
+
+ addr = crtc_read(CRTC_REG_START_L);
+ addr |= (unsigned int)crtc_read(CRTC_REG_START_H) << 8;
+
+ return addr / NCOLS;
+}
+
static inline unsigned char crtc_read(int reg)
{
outp(CRTC_ADDR, reg);