Page 1 of 1

[SOLVED] int 10h bad working

Posted: Fri Jul 19, 2019 1:11 pm
by md37
I have this code:

Code: Select all

BITS 16

start:
	mov ax, 07C0h	
	add ax, 288		
	mov ss, ax
	mov sp, 4096

	mov ax, 07C0h	
	mov ds, ax


	mov si, text_string
	call print_string	

	jmp $	


	text_string db 'This is my cool new OS!', 0


print_string:	
	mov ah, 0Eh

.repeat:
	lodsb	
	cmp al, 0
	je .done	
	int 10h
	jmp .repeat

.done:
	ret


	times 510-($-$$) db 0
	dw 0xAA55
I build it with NASM.
It works on qemu, but not on my machine. Only 'This' is displayed.
I add that 0xB8000 also displays a bit of message.

Re: int 10h bad working

Posted: Fri Jul 19, 2019 1:58 pm
by MichaelPetch
If you are booting using USB on real hardware you may be seeing this if your BIOS is booting using floppy disk emulation (FDD) and because you don't have a BIOS Parameter Block (BPB) in your bootloader. Likely your BIOS has blindly overwritten some of your bootloader with drive geometry info which has altered it so it doesn't work correctly. If this is a USB booting issue you may wish to read my Stackoverflow answer on the subject: https://stackoverflow.com/a/47320115/3857942

Re: int 10h bad working

Posted: Fri Jul 19, 2019 2:44 pm
by md37
Problem solved, thank you! It is worth to write about it on Wiki.