What is this bochs error?

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
PlayOS

What is this bochs error?

Post by PlayOS »

Hi,

I am getting this error from bochs and was wondering if anyone knows what it is, I have search the docs and web search engines, but there is nothing that tells me what causes this error.

00000228760e[CPU ] load_seg_reg(): valid bit cleared

This is error appears to mean that the valid bit of a segment register is clear however, what is the valid bit?

thanks.
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:What is this bochs error?

Post by Pype.Clicker »

probably some bochs internal bit to know if your register has been properly set up or not ... chances are you're trying to access a selector you've not set up after entering PMODE ...
PlayOS

Re:What is this bochs error?

Post by PlayOS »

No, I have definately set all registers.

I am still working on it, but it seems weird.

thanks anyway.
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:What is this bochs error?

Post by Pype.Clicker »

then i guess the answer is in BOCHS sources ... try a grep * -r on the message and try to find out what the problem is ... that's what i would do if i was stuck on it, at least ...
Whatever5k

Re:What is this bochs error?

Post by Whatever5k »

I guess you try to access a segment register that is loaded with a wrong selector...
elias

Re:What is this bochs error?

Post by elias »

wats bochs? i really have never heard of it
Curufir

Re:What is this bochs error?

Post by Curufir »

Bochs is a free opensource x86 emulator. It's capable of emulating one (Or more) 386, 486, 586 (Pentium pro support is apparently broken) processors, soundblaster card, network support and more on a number of platforms including windows and linux. It's effectively a virtual computer that sits on your desktop and uses a file as a hardrive/floppy drive (There is support to use real floppies/cdroms/partitions if you desire). People have successfully installed a number of operating systems into their Bochs setup, eg linux, win2k (I got halfway through win98SE setup before I got bored).

Go here http://bochs.sourceforge.net/ for more information.

Personally I use it because a) I don't like rebooting my computer too much b) VMWare costs a small fortune.

However because Bochs actually emulates every instruction of the processor it runs quite slowly (The cvs of version 2.0 is better at this, so maybe wait for that release), which means it's quite good for developement (Especially with the debugger) but don't expect to be playing windows games on your linux desktop ;).

VMWare/Plex86 take advantage of emulating x86 on x86 so they run much faster. If you can get Plex86 to work then congratulations, and VMWare is commercial (30 day trial I think) and very expensive.

**

Shot in the dark about the error. Could they be talking about the present bit? So you've marked the segment as not present when you setup.

Curufir
PlayOS

Re:What is this bochs error?

Post by PlayOS »

abless:

All selectors are valid and no attempt to change them is made, however now I have made some changes to the code and I get a CS selector is null error, when bochs exits it reports that my EIP points to 0x9ffc4 (0x9ffc1) which is way beyond where it should be (I am expecting it to be somewhere in between 0x20000 and 0x22500) so something is definately wrong in my code, I'll get there in the end. ;)

elias:

Bochs is just a PC emulator that allows you to run and test your OS without having to reboot your development machine all the time (very slow). :)

thanks for your help.
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:What is this bochs error?

Post by Pype.Clicker »

just a question ... does this occur in interrupts-enabled mode ? if so, i fear what you experience is a push/pop mispairing (thus returning to an invalid stack frame, etc ...)
it could explain the incorrect EIP, the invalid segments and all the other stuffs ...
PlayOS

Re:What is this bochs error?

Post by PlayOS »

Hi,

I have given up on the C version of my IDT, and now after implementing wrappers the the IDT entries in asm, I am getting a

pop_ad: not enough bytes on stack

error, except even if I dont have any POPAD instructions in my code, I still get this error, so does anyone know what bochs is on about?

curufir:

What do you mean that pentium pro support is broken in bochs, maybe this is my problem, I think I have a 786, I dont know about pemtium pro, but maybe this is the problem.

thanks.

What
PlayOS

Re:What is this bochs error?

Post by PlayOS »

Can someone explain this to me please:

I write this in an ASM file:

_INT_001_WRAPPER:
   PUSHAD
   MOV      EAX, DWORD [MEM_KERNEL_DATA + KERNEL_IDT_HANDLER_PTR_TABLE + 0004]
   CALL   EAX
   POPAD
   IRET

Assemble it with NASM, and when I disassemble it with NDISASM I get this:

0002001F 60 PUSHA
00020020 A11C084000 MOV EAX, [0x40081c]
00020025 FFD0 CALL EAX
00020027 61 POPA
00020028 CF IRET

So why does the PUSHAD\POPAD get changed to PUSHA\POPA, I am disaasmbling to 32bit code so why does it convert my code, I need the AD versions not the A. Any ideas?

thanks.
Curufir

Re:What is this bochs error?

Post by Curufir »

PlayOS:

What I meant is that the Bochs docs specifically say that the pentium pro emulation is broken (Actually it's unfinished, but to my mind that's the same thing) so don't compile it to emulate anything above pentium.

Curufir
Post Reply