I began my own OS a couple of weeks ago. I spent 1 full week learning assembly language and writing my bootloader.
That wasn't that hard for me though, since I know C quite well.
However, i encounter difficulties when I try to use C code. How exactly can I jump from an assembly routine (my stage2) to a C function, which would be my kmain() ?
I've been following plenty of tutorials lately, but I am stuck at the same step each time.
For instance, I followed the "barebones tutorial" that everyone here knows, on the wiki. I easily can print a character at the top of screen, which is great.
However, as soon as i try to do something like that :
Code: Select all
char *str = "Hello world!";
videomem[0] = str[0];
Code: Select all
videomem[0] = 'H';
I noticed the same thing with the tutorial available here : http://www.osdever.net/bkerndev/Docs/basickernel.htm
I imagine that some of you know this one too. The result was exactly the same : everything works fine until I try to use strings
Can anyone tell me what I should fix to have real strings to work in my C kernel ?
Then how can I jump from an assembly routine to an actual C function ? I guess the output format of my compiled kernel will be ELF.
Thanks,
A random noob