First, the specs:
Bootloader: GRUB.
Compiler: NASM, GCC 4.6.1 & 4.4.3
Linker: LD
Deving OS: Linux Mint 12 64bit / Ubuntu 10.4 on Parallels on MacOS 10.6.8.
VMs: QEMU, Bochs and VirtualBox (in that order of preference and use).
Now, I'll tell you that, obviously, I'm developing an OS for x86. Multiprocesses, With an overall good Memory Manager, and a defficient FS by the moment. For the time being, it doesn't jump between user and kernel space. Is all done in kernel space (too lazy to activate the TSS) and handles poorly the exceptions (poorly as in "it reboots your PC" poorly). But is going quite well.
The problem araised when I added the disk driver to the equation. It just stopped working. It went to reset itself again and again at the moment of loading. I tracked the issue, and I got to the point that the problem was the IDT. It seems that every time I make the instruction int 80, it just reboots. Meaning that it cannot find the correct entry in the IDT. I'm deving this with a friend, that runs the MacOS. That machine is the one having the GCC 4.4.3. When we compile the OS there, it works! LIKE MAGIC (but with bits, instead of magic powder). So we continued developing a little further there. Then we stepped into the REAL problem. We just can't add more literal strings.
That means, we add:
Code: Select all
char string[] = "Hello!"
Code: Select all
printf("This is a printf");
But adding more code doesn't affect it at all.
In general terms, or compilation lines looks like this
Code: Select all
gcc -g -m32 -c ../src/kernel.c -o kernel.o -fno-builtin -fno-stack-protector -nostdlib -nostdinc
* The size of the kernel is too damn high. We are messing with the IDT, and stuff, and we may just be breaking everything.
* Again, if it's not growing down, it's growing up. So It might be destroying the CR3, which is fixed at the 4M direction.
And the most unlikely ones:
* The GCC is working backwards. It just brakes our pure, pristine and flawless code.
And here is the question. Does anyone has the most remote clue about this? We've been banging our heads in the wall for a week now, And now idea the reason.
Beforehand, I'd like to thank you, whoever read this far, and is interested in helping.