Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
section .text
bits 16
org 0x0
_start:
cli
mov ax, 0x0
mov ss, ax
mov sp, 0x0ffff
sti
cld
mov ax, 0x0200 ; the segment my bootloader loads my kernel
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
test: ; this tests to see if the bootloader has actually booted my kernel
mov ah, 0x0e
mov al, 'O'
xor bh, bh
int 0x10
main:
call clean_all ; clears the screen and registers
mov si, .msg
call print
jmp .halt
.msg: db 'Testing, testing ...', 0
.halt:
cli
hlt
jmp .halt
section .data
%include "screen.asm"
%include "clean.asm"
When I run it in qemu it boots up perfectly (it shows the 'O' char) but after that, nothing happends. I guess it is a segmentation problem but the setup is like in the mikeos kernel.
The cli/hlt is his final sequence. That's ok.
I think, he found that didn't properly initialize CS by far jump, that's why he didn't respond to last my post.
Hobbes wrote:Perhaps it's because you disable interrupts before the HLT. I know this prevends Bochs from updating the screen, maybe the same counts for Qemu.
I'm not quite sure about Bochs, but I know for sure that it prevents updating the screen on Qemu.
Yoda, a forum is a way to exchange ideas, not just solve some OP's problem. Bubach obviously was not aware of the effect of CLI/HLT on certain emulators, he is now.