The last few days have I written a few functions so I'm able to run flat binary programs. They are loaded into 0x1E00000 (30 MB) and it works fine. So now have I started writeing a set of include files with the normal functions like printf, scanf etc. (Isn't it called a SDK?) The functions call the kernel via an interrupt at 0x80. But i've problems with my puts() function. It looks like this.
Code: Select all
void puts(unsigned char *string)
{
asm("movl %0, %%ebx"::"r"(string)); // Move string into ebx
asm("movl $0x03, %eax"); // move function number into eax
asm("int $0x80"); // call the kernel
}
Code: Select all
void ServiceInt_puts() // Service Interrupt 03
{
unsigned char *string;
asm("movl %%ebx, %0":"=r"(string)); // move ebx into string
puts(string);
}
I have putint, getchar, gets, cls, ect. functions which works fine. My assembly sucks so maybe there is a bug in there?
I'll appreciate any help