├Γ Symbol Appearing when loading assembly kernel

Viewed 42

When I run my operating system, instead of the string 'Kernel Loaded.', it displays a cryptic symbol, ├Γ. This also happens with other strings, all displaying ├Γ. The bootloader is 1 sector, and the kernel is the same. I used dd to create an .img file, and I used nasm to compile the OS.

this is what displays when running the OS:

Socktt OS bootloader 1.0
Reading Sectors on disk...
Done.
├Γ

Kernel.asm:

mov si, STR_K_LOAD
call k_printf

jmp $

STR_K_LOAD: db 'Kernel Loaded.', 0

k_printf:
pusha
k_printloop:
mov al, [si]
cmp al, 0
jne k_dispchar
popa
ret
k_dispchar:
mov ah, 0x0E
int 0x10
add si, 1
jmp k_printloop

times 510-($-$$) db 0
dw 0xAA55

boot.asm:

[org 0x7c00]

mov ah, 0x00
mov al, 0x03
int 0x10

mov si, STR_BOOTSCREEN
call printf

mov si, STR_READ_DISK
call printf

mov cl, 2
call read_disk

mov si, STR_B_DONE
call printf

jmp 0x7E00

jmp $

STR_BOOTSCREEN: db 'Socktt OS bootloader 1.0', 10, 13, 0
STR_READ_DISK: db 'Reading Sectors on disk...', 10, 13, 0
STR_B_DONE: db 'Done.', 10, 13, 0

STR_BLUE_SCREEN_A: db 'A Problem has been detected and Socktt OS was shut down.', 10, 13, 0
STR_BLUE_SCREEN_B: db 'This error was caused by an issue with your hardware.', 10, 13, 0
STR_BLUE_SCREEN_C: db 'Please shut down your PC and repair the issue with your PC.', 0

printf:
pusha
print_loop:
mov al, [si]
cmp al, 0
jne disp_char
popa
ret
disp_char:
mov ah, 0x0E
int 0x10
add si, 1
jmp print_loop

read_disk:
pusha
mov ah, 0x02
mov al, 1
mov ch, 0
mov dh, 0
mov dl, 0x80
mov bx, 0
mov es, bx
mov bx, 0x7E00

int 0x13

jc blue_screen

popa
ret

blue_screen:
mov ah, 0x00
mov al, 0x03

int 0x10

mov ah, 0x09
mov al, 0x20
mov bh, 0x00
mov bl, 0xEE
mov cx, 0x1000

int 0x10

mov si, STR_BLUE_SCREEN_A
call printf

mov si, STR_BLUE_SCREEN_B
call printf

mov si, STR_BLUE_SCREEN_C
call printf

jmp $

times 510-($-$$) db 0
dw 0xAA55

0 Answers
Related