Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
i'v done the bare bones tutorial and now i'm trying go write a small lib for i/o. Actually i'm on the functions for printing on screen.
I've done a function for printing a char on the screen, located 1 after the last char (code for this is attached after my post).
Now i'll try to write a function for printing a whole string instead of only on character, but it prints nothin....
Are you currently using a linker script and if so, do you explicitly place the .data and .rodata sections? If not, that's the first thing you need to look at.
I must say - the prototype for the print function looks...unusual too. Are you really able to compile that code with no warnings - at least about implicit conversion of a const char* to a char*? I'll take your word for it that the printc function is working.
I'll take your word for it that the printc function is working.
Yes, it's working
I wrote the function of printing on char within print(), but this didn't work...
Could you please change that to "void print(char* str)" and try again? Iirc, using [] in parameter lists doesn't always work well.
Ok, i'll try it
//Edit: hmmmm char* str doesn't work too... Would it help, if i post more source code? But there is not much more.... only a main file, bootloader (taken from the bare bones tutorial) and functions like clr_scr() and printc() ....
Hmmm - this really sounds like a .rodata problem. I guess with the barebones you are using GRUB and therefore the section is being loaded properly?
The one other thing I can think of is a stack-based parameter passing problem. Are you happy that you have a reasonable sized stack that is stored away from the rest of your code?
ouh, it was a really stupid mistake...
I've exported CC and AS for easier use in Makefiles. But the bins were /usr/bin/gcc-linux-.... instead of /usr/cross-....
This was caused by copy&paste from a existing Makefile from another project...
I can't say why the other compiler didn't work correctly, but i can say that it did'nt Now this problem is solved