/* console_cur.c - console functions */ #include #include unsigned char console_flags = 0; unsigned short console_cur_pos = 0; unsigned char console_std_attr = 0x07; unsigned char console_akt_char_attr = 0; unsigned char cur_blink_counter = 0; void console_cursor_on() { if(console_flags & FLAG_BLINK_ON) {console_flags &= ~FLAG_BLINK_ON; console_cur_blink();} } void console_cursor_off() { if(console_flags & FLAG_BLINK_ON) {console_cur_blink(); console_flags |= FLAG_BLINK_ON;} } void console_cur_blink() { if(console_flags & FLAG_BLINK_ON) { console_flags &= ~FLAG_BLINK_ON; asm ( "push %es\n" "push %ebx\n" "mov $32,%ax\n" "mov %ax,%es\n" "xor %ebx,%ebx\n" "mov console_cur_pos,%bx\n" "shl $1,%ebx\n" "inc %ebx\n" "mov console_akt_char_attr,%al\n" "mov %al,%es:(%ebx)\n" "pop %ebx\n" "pop %es" ); } else { console_flags |= FLAG_BLINK_ON; asm ( "push %es\n" "push %ebx\n" "mov $32,%ax\n" "mov %ax,%es\n" "xor %ebx,%ebx\n" "mov console_cur_pos,%bx\n" "shl $1,%ebx\n" "inc %ebx\n" "mov console_std_attr,%al\n" "rol $4,%al\n" "and $0b01110111,%al\n" "mov %es:(%ebx),%ah\n" "mov %ah,console_akt_char_attr\n" "mov %al,%es:(%ebx)\n" "pop %ebx\n" "pop %es" ); } }