Page 1 of 1
Really Wierd Bochs Problem
Posted: Sun Mar 23, 2003 8:24 am
by Mastermind
I?ve got a problem when I am using bochs. I tried installing Win98 on it (using the traditional install method) but it never got past the second part of installation (after the first reboot). The setup configures the system for a while, and then bochs exits with an error message. Please help me; I?ve attached a copy of bochsout.txt.
(I also seem to be having problems running my own OS on bochs...)
Re:Really Wierd Bochs Problem
Posted: Sun Mar 23, 2003 10:15 am
by Pype.Clicker
i'm not sure you are at the best place for solving your problem (BOCHS Faq & support might be more accurate).
But we'll try to do our best nonetheless ... if only you posted your promised .txt file :-p
Re:Really Wierd Bochs Problem
Posted: Sun Mar 23, 2003 11:29 am
by Mastermind
Oops... Sorry!
[attachment deleted by admin]
Re:Really Wierd Bochs Problem
Posted: Mon Mar 24, 2003 2:11 am
by Pype.Clicker
it seems that you have a function that tries to return to an invalid address. This is the classical result of a "stack nappalm": a wrong command has overwriten some stack location without you noticed it, and among others, it has overwritten the return address of a function (not necessarily the function that is currently running, but this is more likely to be the case
Look through your code for uninitialized pointers (things like
Code: Select all
void f() {
char* ptr;
*ptr='a';
}
) or for some function-local arrays whose boundaries are broken ...
Re:Really Wierd Bochs Problem
Posted: Mon Mar 24, 2003 3:10 am
by Perica
..
Re:Really Wierd Bochs Problem
Posted: Mon Mar 24, 2003 3:44 am
by Pype.Clicker
@perica:
Your 0x08 descriptor must be wrong (check its TYPE field)... If it isn't wrong, then it's likely that your GDT is badly located by the CPU (i.E. check the GDTR registers hold the physical address of your GDT.)
btw, was this the best thread to post ?
it seems that you tend to post your own problems in s.o. else's thread rather than starting a new thread which usually leads to confusion (we don't know who's answering who). So please ...
Re:Really Wierd Bochs Problem
Posted: Mon Mar 24, 2003 4:27 am
by distantvoices
@Mastermind:
You can do the following: start box(-chs) debugger, configure a bochs-error-logfile and enable tracing via trace-on at box-cli. THen you will see, at which instruction your program craps out.
I 've experienced such weird errors when I coded the interpreter for my printf-function - the one to scan the passed string for %d, %s ,... - because at the very end, I forgot to add one small but important *text--. It lead to stack overflow and more due to an inconsistent program flow.
I recommend that you scan your code for such inconsistencies: forgotten increments/decrements, if(i=0) instead of if(!i) or if(i==0). Mark: in c it is possible to have the conditions calculated. p. ex.:if(i--) exit;
Hope this helps. With out the actual code it is a little hard to solve the problem. You might give a link to the code in question, hm?
@perica: Gosh, there exist some threads about this problem. Have the search engine look for them, thats what it is for, hmm?
stay safe
Re:Really Wierd Bochs Problem
Posted: Mon Mar 24, 2003 6:32 am
by Perica
..
Re:Really Wierd Bochs Problem
Posted: Mon Mar 24, 2003 1:34 pm
by distantvoices
Perica, I am sorry: but when you say: A small typo in my code caused the fault, why do you think box is to be blamed for that?
I do not understand the way from your premise to your conclusio. Well, I am just a nerd. Shame on me for not to unerstand simple things.
Re:Really Wierd Bochs Problem
Posted: Mon Mar 24, 2003 3:15 pm
by slacker
i like using an older PC (500mhz) with a floppy drive to test my code to make sure an error isnt the result of bochs.
Re:Really Wierd Bochs Problem
Posted: Mon Mar 24, 2003 6:12 pm
by Mastermind
slacker wrote:
i like using an older PC (500mhz) with a floppy drive to test my code to make sure an error isnt the result of bochs.
That's what i've been doing until i came across bochs.
Oh yeah... I fixed up my os... ( Win98 still dies... >:( )
Re:Really Wierd Bochs Problem
Posted: Mon Mar 24, 2003 11:12 pm
by Perica
..
Re:Really Wierd Bochs Problem
Posted: Tue Mar 25, 2003 1:39 am
by distantvoices
ok, perica
No problem.
ad box: I like using it to trace down obscure errors. it eases debugging in a very convenient manner. The only thing: I have to disable several hardware relative functions (f. ex. keyboard led switching) because those ports aren't supported by bochs. Well, i don't mind. I test it usually on a bare pc with floppy: my athlon xp workstation. Development I do on my notebook, so no need to bother about rebooting.