[Kos-cvs] kos/modules/console _console.c,1.6,1.7

thomas at kos.enix.org thomas at kos.enix.org
Thu Jan 6 21:15:59 CET 2005


Update of /home/kos/cvs/kos/modules/console
In directory the-doors:/tmp/cvs-serv22665/modules/console

Modified Files:
	_console.c 
Log Message:
2005-01-06  Thomas Petazzoni  <thomas at crazy.kos.nx>

	* modules/tty/_vt100.c: VT100 driver is now responsible to move
	the cursor. Some whitespace cleanup also. Cursor is not working
	perfectly yet, but you can sometimes see it under Qemu ;-)

	* modules/console/_console.c: Correctly initialize the cursor, and
	correctly move it.



Index: _console.c
===================================================================
RCS file: /home/kos/cvs/kos/modules/console/_console.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- _console.c	6 Jan 2005 18:53:33 -0000	1.6
+++ _console.c	6 Jan 2005 20:15:57 -0000	1.7
@@ -59,13 +59,11 @@
       console->virt_addr   = video;
       console->back_buffer = NULL;
 
-      /* Some initialisation hack for the cursor, taken from
-	 kos-oldies. Don't know exactly what it does, but at least
-	 under Bochs, it doesn't work ;( */
+      /* Set the first scan line for the cursor, and the blinking
+	 mode. First scan line is 11, so that we have a visible
+	 cursor. */
       outb(VGA_SET_CURSOR_START, VGA_COMMAND_PORT);
-      outb( 0, VGA_DATA_PORT);
-      outb(VGA_SET_CURSOR_END, VGA_COMMAND_PORT);
-      outb( 0, VGA_DATA_PORT);
+      outb(((0x2 << 5) | 11), VGA_DATA_PORT);
 
       memset((char *) video, 0, PAGE_SIZE);
     }
@@ -149,7 +147,7 @@
 
   console = (console_t *) console_id;
 
-  pos = (x + y * COLUMNS) * 2;
+  pos = (x + y * COLUMNS);
 
   outb(VGA_SET_CURSOR_HIGH, VGA_COMMAND_PORT);
   outb( (pos >> 8), VGA_DATA_PORT);
@@ -215,8 +213,6 @@
       *(console->virt_addr + (x + y * COLUMNS) * 2 + 1) = console->attr;
     }
 
-  console_set_cursor_pos(console_id, x + len, y);
-
   return 0;
 }
 



More information about the Kos-cvs mailing list