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 think i gave you the solution(or at least some hints), but i don't see any reply from you.
I'm sorry, but I haven't seen your post .
Anyway: I'm running in PMODE on the x86. And this code is the first code of the kernel to run. So now I'm going to follow your last point and trie if it will work
1)Under what environoment are you running the code?(protected mode, real mode)
2)You say that you tested the code-under what conditions(protected mode, real mode, ... language i guess is C)
3)What optimizations do you have turned on?(Try to turn them all off:) )
Anton.
I've turned off al optimizations but it still doesn't work
matthias wrote:...
I've turned off al optimizations but it still doesn't work
It work for me when i had a similar problem.
OK, the i have these new questions(sugestions):
Are you shure that your code is correct? Try to test it under DOS:) for example.
Try filling the whole screen with some symbol, or try to write infinetly:
char cc=0;
while(1){
cc++;
console.putc(cc);
}
Maybe for some (unknown ) reason, when your code boots, you have a different page active.(try changing the base address 0xb8000 to address other pages)
Did you setup correctly the segment descriptors? (stupid question: maybe you set it up as read only? )
matthias wrote:No everything is OK, the code is good, but somehow my PC doesn't want to run C++ code in a normal way
?
Does it work in boch?(or virtual PC?)
Try to write a charecter to screen directly(without your classes):
while(1){
*((char*)0xb8000)=i;
i++;
}
if this does not work, then you have a strange PC. If it does work then ... i don't know:)(at least at this moment)
Anton.
I've never used BOCHS before. And now I hope your tip will works because otherwise I have a weird PC But I'll buy another one in about two days :p so there's still hope for me
But if somebody has an idea why this problem occur I would be pleased to hear them .
Anton wrote:
Try to write a charecter to screen directly(without your classes):
while(1){
*((char*)0xb8000)=i;
i++;
}
if this does not work, then you have a strange PC. If it does work then ... i don't know:)(at least at this moment)
Anton.
I think the problem isn't in my code, cause I tested it with C, but the problem is in C++. This isn't the only class that doesn't work. I tried to write an allocator-class, but when I try to run the code, a wrong memory address is returned from my allocator. Thus the same problem as with my console class.
Thermite wrote:Have you tried using a different compiler?
I'm using djgpp in windows XP SP1, so this should be ok, but maybe it will work with minGW instead of djgpp.
And I'm also going to try to compile it in suse linux 9.2 maybe this will work then. If not, I don't know how to go on with developing my kernel with C++, so maybe I have to trie it in C. (I've done this before).
btw: my development platform is Windows XP with SP1.
OK. everyone I solved the problem. When I looked in my .map file I saw something in the file that didn't belong there, It had to do something with my outb_p() in my setpos() function, so I replaced it with a real function instead of a macro, and now it works