From 47841ce9697f7206b0b0d15220b91b50bbd31ddc Mon Sep 17 00:00:00 2001 From: Baptiste Wicht Date: Thu, 31 Oct 2013 16:17:23 +0100 Subject: [PATCH] Reduce micro_kernel size --- micro_kernel/micro_kernel.asm | 4 -- micro_kernel/shell.asm | 1 - micro_kernel/utils/console.asm | 115 --------------------------------- 3 files changed, 120 deletions(-) diff --git a/micro_kernel/micro_kernel.asm b/micro_kernel/micro_kernel.asm index 1e101828..ad603d89 100644 --- a/micro_kernel/micro_kernel.asm +++ b/micro_kernel/micro_kernel.asm @@ -169,16 +169,12 @@ lm_start: jmp $ - ; Enter the shell - ;call shell_start - ; Includes %include "utils/macros.asm" %include "utils/console.asm" %include "interrupts.asm" -%include "shell.asm" ; Global Descriptors Table diff --git a/micro_kernel/shell.asm b/micro_kernel/shell.asm index 11dd1e86..87715749 100644 --- a/micro_kernel/shell.asm +++ b/micro_kernel/shell.asm @@ -1,4 +1,3 @@ -%include "utils/utils.asm" %include "utils/keyboard.asm" %include "commands.asm" diff --git a/micro_kernel/utils/console.asm b/micro_kernel/utils/console.asm index 6034aa6c..f041af4f 100644 --- a/micro_kernel/utils/console.asm +++ b/micro_kernel/utils/console.asm @@ -51,47 +51,6 @@ set_current_position: ret -goto_next_line: - push rax - push rsi - push rdi - - ; Go to the next line - mov rax, [current_line] - inc rax - mov [current_line], rax - - ; Start at the first column - mov qword [current_column], 0 - - cmp rax, 25 - jne .end - - mov rsi, TRAM + 2 * 0x14 * 8 - mov rdi, TRAM + 1 * 0x14 * 8 - - .scroll_up: - - mov al, byte [rsi] - mov byte [rdi], al - - inc rsi - inc rdi - - cmp rdi, TRAM + 25 * 0x14 * 8 - jne .scroll_up - - mov rax, 24 - mov [current_line], rax - - .end: - - pop rdi - pop rsi - pop rax - - ret - ; Print the given string at the current position and update ; the current position for later print ; r8 = string to print @@ -145,77 +104,3 @@ print_string: pop rax ret - -; Print the given integer at the current position -; r8 = integer to print -print_int_normal: - push rdi - push rdx - - call set_current_position - mov dl, STYLE(BLACK_F, WHITE_B) - call print_int - - call int_str_length - - mov rbx, [current_column] - add rbx, rax - mov [current_column], rbx - - pop rdi - pop rdx - - ret - -; Print the given integer to the console -; r8 = integer to print -; rdi = START of write -; dl = code style -print_int: - push rax - push rbx - push rdx - push r10 - push rsi - - mov rax, r8 - mov r10, rdx - - xor rsi, rsi - - .loop: - xor rdx, rdx - mov rbx, 10 - div rbx - add rdx, 48 - - push rdx - inc rsi - - test rax, rax - jne .loop - - .next: - test rsi, rsi - je .exit - dec rsi - - ; write the char - pop rax - stosb - - ; Write style code - mov rdx, r10 - mov al, dl - stosb - - jmp .next - - .exit: - pop rsi - pop r10 - pop rdx - pop rbx - pop rax - - ret