[vga] Enable/disable cursor movement, for clock mostly

This commit is contained in:
Kevin Lange 2011-03-25 01:13:44 -04:00
parent be3c4d2d04
commit 53024c3b49
3 changed files with 13 additions and 3 deletions

View File

@ -5,8 +5,8 @@
*/ */
unsigned short * textmemptr; unsigned short * textmemptr;
int attrib = 0x0F; int attrib = 0x0F;
int csr_x = 0, csr_y = 0, use_serial = 1; int csr_x = 0, csr_y = 0, use_serial = 1, use_csr = 1;
int old_x = 0, old_y = 0, old_s = 1; int old_x = 0, old_y = 0, old_s = 1, old_csr = 1;
/* /*
* scroll * scroll
@ -37,11 +37,17 @@ set_serial(int on) {
use_serial = on; use_serial = on;
} }
void
set_csr(int on) {
use_csr = on;
}
void void
store_csr() { store_csr() {
old_x = csr_x; old_x = csr_x;
old_y = csr_y; old_y = csr_y;
old_s = use_serial; old_s = use_serial;
old_csr = use_csr;
} }
void void
@ -49,6 +55,7 @@ restore_csr() {
csr_x = old_x; csr_x = old_x;
csr_y = old_y; csr_y = old_y;
use_serial = old_s; use_serial = old_s;
use_csr = old_csr;
} }
/* /*
@ -57,6 +64,7 @@ restore_csr() {
*/ */
void void
move_csr() { move_csr() {
if (!use_csr) return;
unsigned temp; unsigned temp;
temp = csr_y * 80 + csr_x; temp = csr_y * 80 + csr_x;

View File

@ -45,6 +45,7 @@ extern void place_csr(uint32_t x, uint32_t y);
extern void store_csr(); extern void store_csr();
extern void restore_csr(); extern void restore_csr();
extern void set_serial(int); extern void set_serial(int);
extern void set_csr(int);
/* GDT */ /* GDT */
extern void gdt_install(); extern void gdt_install();

View File

@ -149,8 +149,9 @@ int main(struct multiboot *mboot_ptr, uint32_t mboot_mag, uintptr_t esp)
__asm__ __volatile__ ("cli"); __asm__ __volatile__ ("cli");
store_csr(); store_csr();
place_csr(70,0);
set_serial(0); set_serial(0);
set_csr(0);
place_csr(70,0);
kprintf("[%d:%d:%d]", hours, minutes, seconds); kprintf("[%d:%d:%d]", hours, minutes, seconds);
restore_csr(); restore_csr();
__asm__ __volatile__ ("sti"); __asm__ __volatile__ ("sti");