[SOLVED] int 10h bad working

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.
Post Reply
md37
Posts: 7
Joined: Fri Jul 19, 2019 1:03 pm

[SOLVED] int 10h bad working

Post 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.
Last edited by md37 on Sat Nov 28, 2020 3:53 am, edited 1 time in total.
MichaelPetch
Member
Member
Posts: 798
Joined: Fri Aug 26, 2016 1:41 pm
Libera.chat IRC: mpetch

Re: int 10h bad working

Post 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
md37
Posts: 7
Joined: Fri Jul 19, 2019 1:03 pm

Re: int 10h bad working

Post by md37 »

Problem solved, thank you! It is worth to write about it on Wiki.
Post Reply