Really Wierd Bochs Problem

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.
Post Reply
Mastermind

Really Wierd Bochs Problem

Post 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...)
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Really Wierd Bochs Problem

Post 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
Mastermind

Re:Really Wierd Bochs Problem

Post by Mastermind »

Oops... Sorry!

[attachment deleted by admin]
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Really Wierd Bochs Problem

Post 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 ...
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:Really Wierd Bochs Problem

Post by Perica »

..
Last edited by Perica on Sun Dec 03, 2006 8:58 pm, edited 1 time in total.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Really Wierd Bochs Problem

Post 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 ...
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:Really Wierd Bochs Problem

Post 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
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:Really Wierd Bochs Problem

Post by Perica »

..
Last edited by Perica on Sun Dec 03, 2006 8:58 pm, edited 1 time in total.
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:Really Wierd Bochs Problem

Post 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. :)
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
slacker

Re:Really Wierd Bochs Problem

Post 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.
Mastermind

Re:Really Wierd Bochs Problem

Post 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... >:( )
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:Really Wierd Bochs Problem

Post by Perica »

..
Last edited by Perica on Sun Dec 03, 2006 8:58 pm, edited 1 time in total.
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:Really Wierd Bochs Problem

Post 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.
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
Post Reply