Today I've finished my ELF loader and a syscall interface so I decided to write a Hello World program in C++ for my OS, I haven't go a C Runtime -yet, but I already made crt0 which just calls main and exits. But every time control reaches
Code: Select all
call _main
So I though a problem was in "call," so I replaced it with "jmp" instead, at which point it did enter main but any operation which "uses" memory (ex. Get an address of a const char*) fails with a page fault on the same CR2 address - 0xFFFFFFFC.
So I would like to hear, at least something, from the great wisdom of OsDev about this unusual problem