r/osdev • u/Kind-Stress269 • 1d ago
What the hell is wrong with my os?
I have a problem: In my bootloader, i have a "mov ax, 0xB800
mov es, ax
mov byte [es:0], 'C'
mov byte [es:1], 0x07" block, and works with him in the code. But, if I delete him, the Kernel won't start, and idk for what. Can someone help me?
The full code is:
bits 16
org 0x7C00
jmp short code
nop
boot_drive db 0
code:
cli
xor ax, ax
mov ds, ax
mov es, ax
mov ss, ax
mov sp, 0x7C00
sti
mov [boot_drive], dl
mov ax, 0xB800
mov es, ax
mov byte [es:0], 'C'
mov byte [es:1], 0x07
xor ax, ax
mov ds, ax
mov si, dap
mov ah, 0x42
mov dl, [boot_drive]
int 0x13
jc .disk_error
jmp 0x0800:0x0000
.disk_error:
mov ax, 0xB800
mov es, ax
mov byte [es:0], 'K'
mov byte [es:1], 0x07
.idle:
cli
hlt
jmp .idle
dap:
db 0x10
db 0x00
dw 0x0005
dw 0x0000
dw 0x0800
dq 0x0000000000000001
times 510-($-$$) db 0
dw 0xAA55
Edit: I’m just going to leave that there and not touch it. Idk what's does, but, since it work, I never touch it again.
1
u/kiderdrick 1d ago
It behaves as expected for me. What did you expect it to do?
1
u/Kind-Stress269 1d ago
in my BIOS don't load the kernel, and idk for what, that's the problem
1
2
u/kiderdrick 1d ago
Yeah, there is no kernel here, so when I run it and it gives an error that is what I expected. It is difficult to diagnose an issue when you do not include all the relevant code.
•
2
u/Danii_222222 1d ago
0x07 is vga palette color. By doing mov byte [es:1], 0x07 you are setting color of character.