Cursor disabling moced from assembly to C
This commit is contained in:
parent
94657a7b47
commit
f45698bb00
2 changed files with 2 additions and 23 deletions
5
kernel.c
5
kernel.c
|
@ -34,9 +34,8 @@ char* itoa(int value, int base) {
|
||||||
void kmain (unsigned int mbootmagick, multiboot_info_t* mbootinfo) {
|
void kmain (unsigned int mbootmagick, multiboot_info_t* mbootinfo) {
|
||||||
|
|
||||||
// Cursor disabling
|
// Cursor disabling
|
||||||
// TODO: outb function
|
outb(0x3D4, 0x0A);
|
||||||
//outb(0x3D4, 0x0A);
|
outb(0x3D5, 0x20);
|
||||||
//outb(0x3D5, 0x20);
|
|
||||||
|
|
||||||
//cls();
|
//cls();
|
||||||
vga_init(VGA_COLOR_BLACK, VGA_COLOR_GRAY);
|
vga_init(VGA_COLOR_BLACK, VGA_COLOR_GRAY);
|
||||||
|
|
20
start32.asm
20
start32.asm
|
@ -32,30 +32,10 @@ section '.text' executable
|
||||||
public _start
|
public _start
|
||||||
extrn kmain
|
extrn kmain
|
||||||
|
|
||||||
disable_cursor:
|
|
||||||
pushf
|
|
||||||
push eax
|
|
||||||
push edx
|
|
||||||
|
|
||||||
mov dx, 0x3D4
|
|
||||||
mov al, 0xA ; low cursor shape register
|
|
||||||
out dx, al
|
|
||||||
|
|
||||||
inc dx
|
|
||||||
mov al, 0x20 ; bits 6-7 unused, bit 5 disables the cursor, bits 0-4 control the cursor shape
|
|
||||||
out dx, al
|
|
||||||
|
|
||||||
pop edx
|
|
||||||
pop eax
|
|
||||||
popf
|
|
||||||
ret
|
|
||||||
|
|
||||||
_start:
|
_start:
|
||||||
; Setup stack
|
; Setup stack
|
||||||
mov esp, stack_top
|
mov esp, stack_top
|
||||||
|
|
||||||
call disable_cursor
|
|
||||||
|
|
||||||
; Call the main kernel function.
|
; Call the main kernel function.
|
||||||
push ebx
|
push ebx
|
||||||
push eax
|
push eax
|
||||||
|
|
Loading…
Reference in a new issue