Page 1 of 1
What is this bochs error?
Posted: Wed Nov 06, 2002 7:52 am
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.
Re:What is this bochs error?
Posted: Wed Nov 06, 2002 9:29 am
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 ...
Re:What is this bochs error?
Posted: Wed Nov 06, 2002 9:32 am
by PlayOS
No, I have definately set all registers.
I am still working on it, but it seems weird.
thanks anyway.
Re:What is this bochs error?
Posted: Wed Nov 06, 2002 9:39 am
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 ...
Re:What is this bochs error?
Posted: Wed Nov 06, 2002 11:02 am
by Whatever5k
I guess you try to access a segment register that is loaded with a wrong selector...
Re:What is this bochs error?
Posted: Wed Nov 06, 2002 7:41 pm
by elias
wats bochs? i really have never heard of it
Re:What is this bochs error?
Posted: Wed Nov 06, 2002 8:06 pm
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
Re:What is this bochs error?
Posted: Wed Nov 06, 2002 8:09 pm
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.
Re:What is this bochs error?
Posted: Thu Nov 07, 2002 2:15 am
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 ...
Re:What is this bochs error?
Posted: Thu Nov 07, 2002 9:52 pm
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
Re:What is this bochs error?
Posted: Fri Nov 08, 2002 3:15 am
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.
Re:What is this bochs error?
Posted: Fri Nov 08, 2002 7:57 am
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