Just a quick update:
I have finally managed to get multitasking working. It was working before, but not exactly what I wanted - now it runs all in user mode. So to try it out, I created 2 loadable modules for GRUB, so I could see how to load an executable. The modules are elf executables that I created with my newly ported GCC 4.3.3. Everything went well until link time. Then I discovered that I needed a file called crt0.o. It's a bit hard to find information on this file, because its standard, but OS specific. Anyway, again thanks to the guys as OSDEV I ported newlib (stdclib) and created the crt0.o file as well. So then I was suprised to find out that I needed 2 more files - crtbegin.o and crtend.o. These are even harder to find information about, and to this day I am not clear on their responsibilities, and how it is different from crt0.o. I think it has to do with C++, but my load modules are written in pure C, so I don't really know why I need them. Well, I found out that GCC is supposed to provide implementations of these files, and since I'm using ELF format I figured if I copied their configuration files everything would be ok. For some reason when I built GCC 4.3.3 as a cross compiler for KOS, these files were not created. I didn't even know where I should start looking for them, so I did a search to find the native-compiled versions. Interestingly enough, I did find cross-compiled versions, but in my GCC 4.2.1 directory. I guess back when I was testing different versions of GCC to find out why I couldn't port them to Cygwin without major headaches, I build 4.2.1 as a cross-compiler as well, and created these files. So now it seems that 4.3.3 has a bug that won't let me create crtbegin.o and crtend.o when building as a cross compiler. I will have to try 4.4 one of these days to see if it is still the case.
No comments:
Post a Comment