Page 2 of 2

Re: C++ bug :(

Posted: Thu Dec 02, 2004 12:00 am
by matthias
Anton wrote:
matthias wrote:
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 :)

Re: C++ bug :(

Posted: Thu Dec 02, 2004 12:00 am
by matthias
btw it is written in C++

Re: C++ bug :(

Posted: Sat Dec 04, 2004 12:00 am
by matthias
Anton wrote:
matthias wrote:anyone?
Could you please answer the following questions :

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 :(

Re: C++ bug :(

Posted: Sun Dec 05, 2004 12:00 am
by Anton
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? :) )

Anton.

Re: C++ bug :(

Posted: Mon Dec 06, 2004 12:00 am
by matthias
No everything is OK, the code is good, but somehow my PC doesn't want to run C++ code in a normal way :(

Re: C++ bug :(

Posted: Mon Dec 06, 2004 12:00 am
by Anton
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.

Re: C++ bug :(

Posted: Mon Dec 06, 2004 12:00 am
by matthias
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 :).

Re: C++ bug :(

Posted: Mon Dec 06, 2004 12:00 am
by matthias
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.
This works but not in classes :(

(i hate C++)

Re: C++ bug :(

Posted: Tue Dec 07, 2004 12:00 am
by matthias
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.

Me isn't happy :(

Re: C++ bug :(

Posted: Tue Dec 07, 2004 12:00 am
by Thermite
Have you tried using a different compiler?

Re: C++ bug :(

Posted: Wed Dec 08, 2004 12:00 am
by matthias
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.

Re: C++ bug :(

Posted: Mon Dec 27, 2004 12:00 am
by matthias
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 :D

Re: C++ bug :(

Posted: Tue Dec 28, 2004 12:00 am
by Anton
matthias wrote:OK. everyone I solved the problem.
My congratulations. :)

Re: C++ bug :(

Posted: Tue Dec 28, 2004 12:00 am
by matthias
thnx