A couple of problems:
First, your string is in the middle of your code, so after executing mov dx, text
the CPU will try to interpret the string 'Hello$'
as code, which looks something like this:
dec ax
gs insb
outsw
and al, 0cdh
adc bl, ch
inc byte [bx+si]
As you can see, the original int 10h
and jmp $
instructions are lost. To fix this, just move the text
variable below your jmp $
statement.
Second, you seem to be confusing DOS functions and BIOS functions. Your second chunk of code is set up to use DOS to print a string (which, by the way, uses int 21h
, not int 10h
). Because you're writing an OS, however, you don't have any DOS functions available; you only have BIOS. Instead, you'll need to manually loop over the characters in the string and print each one until it reaches the end. An example might be something like this:
mov si, text
mov bx, 0007h ; set page to 0 and color to light gray text on black background
mov ah, 0eh ; select single character print service
printLoop:
lodsb ; grab next character from [si] and increment si
cmp al, '$' ; check for end of string
je printDone ; exit if done
; all parameters are set up - print the character now
int 10h
jmp printLoop ; run the loop again for the next character
printDone:
...