Moved stuff around and added a makefile also got a custom bootloader

based on the JazzOS bootloader (modified a bit)
This commit is contained in:
2025-10-20 10:52:03 +01:00
parent 07932e2ce0
commit d38a233b62
33 changed files with 1248 additions and 890 deletions

View File

@@ -0,0 +1,77 @@
; AX = key pressed
os_read_input:
mov ah, 11h ; BIOS call to check for key
int 16h ; Interrupt
jnz .key_pressed ; Jump if input isn't 0
hlt
jmp os_read_input
.key_pressed:
mov ah, 10h
int 16h
ret
; -------------------------------------------
os_display_input:
pusha
mov cx, [prompt_length]
.loop:
call .check_key_pressed
jmp .loop
.check_key_pressed:
call os_read_input
cmp al, 08h
je .backspace
cmp al, 0Dh
je .enter_key
cmp al, 1Bh
je .esc_key
cmp cx, 0
jb .check_key_pressed
call .print_current_input
dec cx
jmp .check_key_pressed
.esc_key:
call os_reboot
.enter_key:
mov al, 0
stosb
popa
call os_read_cli
.backspace:
call .move_cursor_back ; then .move_cursor_back
call .loop ; Else .loop
.move_cursor_back:
mov ah, 0Eh
mov al, 08h
int 10h
mov al, 20h
int 10h
mov al, 08h
int 10h
dec di
jmp os_display_input
.print_current_input:
stosb
mov ah, 0Eh
int 10h
ret