Hi guys,
I'm currently trying to compile/run my kernel in bochs here at work. The problem is I'm getting an invalid opcode exception when bochs encounters the instruction 'sysenter' (which, obviously, does not happen at home)
I'm using v2.3 here, the 32-bit version (I've noticed on my home one it comes up as "Bochs: x86-64 emulator" whereas here it's missing the 64.
The systenter instruction was introduced in the PentiumII (?) IIRC so I wonder why it's not implemented in this version of bochs?
Does anyone have any ideas? Do I have to update my bochs install?
EDIT: trying to get the specific version number: bochs doesn't have a --version or -v argument - anyone know how to query it?
Bochs & SYSENTER
From Bochs user guide, 3.4 Compiling Bochs, 3.4.2 Configure Options:
Ergo, by default Bochs emulates a Pentium.Option: --enable-cpu-level={3,4,5,6}
Default: 5
Comments: Select which CPU level to emulate. Choices are 3,4,5,6 which mean to target 386, 486, Pentium, or Pentium Pro emulation. Pentium Pro support is quite incomplete, so level 5 is the best choice for now.
Every good solution is obvious once you've found it.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
I'd be tempted to say that you should check CPUID before using special processor instructions
Bochs' version is displayed whenever you start it. It will not, however, show you the ./configure options which are just as interesting to know.
Anyway, if you require sysenter, you'll have to compile bochs manually. Open cygwin, download the sources, then type ./configure --help which will tell you everything.
Bochs' version is displayed whenever you start it. It will not, however, show you the ./configure options which are just as interesting to know.
Anyway, if you require sysenter, you'll have to compile bochs manually. Open cygwin, download the sources, then type ./configure --help which will tell you everything.
Cheers guys. Looks like '6' for me. I had actually compiled it from source anyway combuster.
And when you start bochs, it will show you only the first two major version numbers (e.g. mine shows '2.3', not '2.3.1')
Combuster: the advantage to checking CPUID for sysenter would be to print a lovely helpful "this kernel will not run, fool" message, as all my syscalls except fork/exec are implemented using sysenter/sysexit!
And when you start bochs, it will show you only the first two major version numbers (e.g. mine shows '2.3', not '2.3.1')
Combuster: the advantage to checking CPUID for sysenter would be to print a lovely helpful "this kernel will not run, fool" message, as all my syscalls except fork/exec are implemented using sysenter/sysexit!
I don't know of a bochs version 2.3.1JamesM wrote:And when you start bochs, it will show you only the first two major version numbers (e.g. mine shows '2.3', not '2.3.1')
And for me bochs shows 2.3.5 correctly.
I do.bluecode wrote:I don't know of a bochs version 2.3.1
Every good solution is obvious once you've found it.
Support for sysenter/sysexit isn't linked to any cpu-level, but rather has to be additionally enabled at compile time. Try running ./configure --enable-sep and have a look at the bochs (user) documentation for more details.Cheers guys. Looks like '6' for me. I had actually compiled it from source anyway combuster
cheers,
gaf
Well I compiled it with machine-level=6 and it works. So I'm a happy chappy.Support for sysenter/sysexit isn't linked to any cpu-level, but rather has to be additionally enabled at compile time. Try running ./configure --enable-sep and have a look at the bochs (user) documentation for more details.
Partially, anyway. I'm having real difficulty compiling my code on this different computer. I've now installed a custom g++/gcc and binutils, and STILL linker errors that don't plague me at home are appearing. Currently they seem to be related to duplicate symbol names between object files and a shared library. On my system if it finds a duplicate symbol in a shared library it just quietly ignores it.
I never realised just how much difference there was between gcc/ld versions and just how easily they can break!