mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-19 01:25:05 -04:00
Reduce micro_kernel size
This commit is contained in:
parent
17ca9458af
commit
47841ce969
@ -169,16 +169,12 @@ lm_start:
|
|||||||
|
|
||||||
jmp $
|
jmp $
|
||||||
|
|
||||||
; Enter the shell
|
|
||||||
;call shell_start
|
|
||||||
|
|
||||||
; Includes
|
; Includes
|
||||||
|
|
||||||
%include "utils/macros.asm"
|
%include "utils/macros.asm"
|
||||||
%include "utils/console.asm"
|
%include "utils/console.asm"
|
||||||
|
|
||||||
%include "interrupts.asm"
|
%include "interrupts.asm"
|
||||||
%include "shell.asm"
|
|
||||||
|
|
||||||
; Global Descriptors Table
|
; Global Descriptors Table
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
%include "utils/utils.asm"
|
|
||||||
%include "utils/keyboard.asm"
|
%include "utils/keyboard.asm"
|
||||||
|
|
||||||
%include "commands.asm"
|
%include "commands.asm"
|
||||||
|
@ -51,47 +51,6 @@ set_current_position:
|
|||||||
|
|
||||||
ret
|
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
|
; Print the given string at the current position and update
|
||||||
; the current position for later print
|
; the current position for later print
|
||||||
; r8 = string to print
|
; r8 = string to print
|
||||||
@ -145,77 +104,3 @@ print_string:
|
|||||||
pop rax
|
pop rax
|
||||||
|
|
||||||
ret
|
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
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user