first of all "hi" to all forum members and all veteran OS developers - I am just beginning to fiddle with OS development and you owe my deepest respect already;)
As I said, I just only started and have developed my first "Hello World" kernel... and already run into first problems: I try to print "Hello Simple Kernel World!", but get more something like "Hello Simple§/(%&/§(&/&". I tried different approaches, but it seems like the memory I assigned for the text gets overwritten somehow(?) It always happens exactly after 12 chars, no matter where I "print", or how much strings I define.... does anybody know what this could be?
As additional information: I use the "Super Grub Floppy Disk" for booting my Kernel and develop using Visual C with assembler in accordance with http://ksrenevasan.blogspot.com/2005/10 ... using.html
As I said, I have tested different ways of printing, such as
Code: Select all
char *message1 = "Hello Simple Kernel World!";
__asm
{
mov ebx, 0
mov edx, message1
mov ah, 0x07
mov cl, 20
letter:
mov al, [edx]
mov [0xb8000+ebx], ax
inc ebx
inc ebx
inc edx
dec cl
jnz letter
};
Code: Select all
void print(char* message, int line)
{
unsigned char *vidmem = (unsigned char *) 0xb8000;
unsigned int i=0;
i=(line*80*2);
while(*message!=0)
{
vidmem[i]=*message;
*message++;
i++;
vidmem[i]=0x07;
i++;
};
}