2169 |
|
|
2170 |
|
|
2171 |
/* |
/* |
2172 |
* void console_nocursor (void) |
* int console_setcursor (int on) |
2173 |
* BIOS call "INT 10H Function 01h" to set cursor type |
* BIOS call "INT 10H Function 01h" to set cursor type |
2174 |
* Call with %ah = 0x01 |
* Call with %ah = 0x01 |
2175 |
* %ch = cursor starting scanline |
* %ch = cursor starting scanline |
2176 |
* %cl = cursor ending scanline |
* %cl = cursor ending scanline |
2177 |
*/ |
*/ |
2178 |
|
|
2179 |
ENTRY(console_nocursor) |
console_cursor_state: |
2180 |
|
.byte 1 |
2181 |
|
console_cursor_shape: |
2182 |
|
.word 0 |
2183 |
|
|
2184 |
|
ENTRY(console_setcursor) |
2185 |
push %ebp |
push %ebp |
2186 |
|
push %ebx |
2187 |
|
|
2188 |
|
/* check if the standard cursor shape has already been saved */ |
2189 |
|
movw console_cursor_shape, %ax |
2190 |
|
testw %ax, %ax |
2191 |
|
jne 1f |
2192 |
|
|
2193 |
|
call EXT_C(prot_to_real) |
2194 |
|
.code16 |
2195 |
|
|
2196 |
|
movb $0x03, %ah |
2197 |
|
xorb %bh, %bh |
2198 |
|
int $0x10 |
2199 |
|
|
2200 |
|
DATA32 call EXT_C(real_to_prot) |
2201 |
|
.code32 |
2202 |
|
|
2203 |
|
movw %cx, console_cursor_shape |
2204 |
|
1: |
2205 |
|
/* set %cx to the designated cursor shape */ |
2206 |
|
movw $0x2000, %cx |
2207 |
|
movl 0xc(%esp), %ebx |
2208 |
|
testl %ebx, %ebx |
2209 |
|
jz 2f |
2210 |
|
movw console_cursor_shape, %cx |
2211 |
|
2: |
2212 |
call EXT_C(prot_to_real) |
call EXT_C(prot_to_real) |
2213 |
.code16 |
.code16 |
2214 |
|
|
|
movw $0x2000, %cx |
|
2215 |
movb $0x1, %ah |
movb $0x1, %ah |
2216 |
int $0x10 |
int $0x10 |
2217 |
|
|
2218 |
DATA32 call EXT_C(real_to_prot) |
DATA32 call EXT_C(real_to_prot) |
2219 |
.code32 |
.code32 |
2220 |
|
|
2221 |
|
movzbl console_cursor_state, %eax |
2222 |
|
movb %bl, console_cursor_state |
2223 |
|
|
2224 |
|
pop %ebx |
2225 |
pop %ebp |
pop %ebp |
2226 |
ret |
ret |
2227 |
|
|