Displaying text
Posted: Sun Jun 30, 2002 11:00 pm
Hi, i've got this function that displays text that can effectively be called by anything else in my kernel.
So far this text display function is almost nothing, very simple. Printed below:
standard_display:
mov edi, 0xB8000
.standard_display_loop:
lodsb
stosw
or al, al
jnz .standard_display_loop
retn
This is called with esi pointed to a location of a text string in memory and ah contains the vga colour attribute, 0x0F when im using it in this particular function.
My problem is that i load esi with a variable containing a text string, but a further 2 variables are stored after it get displayed too, even though i never call the display function with their location in esi. I do wish to display them but the code to do so is commented out so it doesn't, but the text strings in the next 2 variables still get displayed. Why?. And how can i fix it.
Bascially this is how i call the display function:
mov ESI, kernel_name
mov AH, 0x0F
call standard_display
...
kernel_name db "kernel name"
kernel_version db "kernel version" ; These two don't get called for
kernel_auther db "kernel auther" ; but they still show on
; the screen after the first variable
Also the first character in the first variables doesn't get shown.
Is there something wrong with how im handling the strings in the display function?
Thanks in advance.
Regards, Brill.
So far this text display function is almost nothing, very simple. Printed below:
standard_display:
mov edi, 0xB8000
.standard_display_loop:
lodsb
stosw
or al, al
jnz .standard_display_loop
retn
This is called with esi pointed to a location of a text string in memory and ah contains the vga colour attribute, 0x0F when im using it in this particular function.
My problem is that i load esi with a variable containing a text string, but a further 2 variables are stored after it get displayed too, even though i never call the display function with their location in esi. I do wish to display them but the code to do so is commented out so it doesn't, but the text strings in the next 2 variables still get displayed. Why?. And how can i fix it.
Bascially this is how i call the display function:
mov ESI, kernel_name
mov AH, 0x0F
call standard_display
...
kernel_name db "kernel name"
kernel_version db "kernel version" ; These two don't get called for
kernel_auther db "kernel auther" ; but they still show on
; the screen after the first variable
Also the first character in the first variables doesn't get shown.
Is there something wrong with how im handling the strings in the display function?
Thanks in advance.
Regards, Brill.