Constant Strings not working
Posted: Wed Aug 25, 2010 8:37 am
Hello, I'm writing a 16 bit Dos like Operating System with GUI and Extended memory support. I prefer to begin from the very inital so I decided to write 16 bit O.S and then shift to writing 32 bit O.S. Other things apart, here's what i've strucked in.
I've writing printstring function similar to printf function which prints string to the video screen:
void printstring(const char input_string[50]
The problem is when i pass constants to my printstring function like this printstring("hello people"), then this function doesn't work but when i first initalize the string and then pass this argument to the printstring function like this,
char message[12]={"Hello People"};
printstring(message);
then everything goes fine.I tried using pointers but encountered same problem. I wonder if there's problem with initalization of segment registers in my bootloader. Please Help!
I've writing printstring function similar to printf function which prints string to the video screen:
void printstring(const char input_string[50]
The problem is when i pass constants to my printstring function like this printstring("hello people"), then this function doesn't work but when i first initalize the string and then pass this argument to the printstring function like this,
char message[12]={"Hello People"};
printstring(message);
then everything goes fine.I tried using pointers but encountered same problem. I wonder if there's problem with initalization of segment registers in my bootloader. Please Help!