[Solved] VirtualBox "mov es, ax" or "mov ss, ax" faults

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.
MichaelPetch
Member
Member
Posts: 797
Joined: Fri Aug 26, 2016 1:41 pm
Libera.chat IRC: mpetch

Re: VirtualBox "mov es, ax" (or maybe "mov ss, ax"?) faults

Post by MichaelPetch »

Octocontrabass wrote:You should find a way to check this stuff from within VirtualBox instead of using Bochs. There could be a bug elsewhere in your code that only causes problems in VirtualBox.
I totally agree. What is going on in BOCHS may not represent what is going on in VirtualBox. I asked for a code repository to test things out because I expect that the problem lies beyond the code being shown.

I'm not sure how much help can be rendered without a more complete picture.
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: VirtualBox "mov es, ax" (or maybe "mov ss, ax"?) faults

Post by iansjack »

MichaelPetch wrote:I expect that the problem lies beyond the code being shown.
I agree.

The fact that the point of failure changes when the code is slightly rearranged could well point to a problem with interrupt/exception handling.
sounds
Member
Member
Posts: 112
Joined: Sat Feb 04, 2012 5:03 pm

Re: VirtualBox "mov es, ax" (or maybe "mov ss, ax"?) faults

Post by sounds »

Interrupt/exception handling at this early stage is a triple fault.

Code: Select all

idtr:base=0x0000000000000000, limit=0x0
Thank you for the suggestions, I understand the sentiment that looking at the broader picture sometimes reveals unexpected things.
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: VirtualBox "mov es, ax" (or maybe "mov ss, ax"?) faults

Post by iansjack »

sounds wrote:No, not putting it on github, the code is in this thread.
Fair enough that you don't want to make your code public (though if you know for sure that the problem is in the code you have posted you should be able to track it down - but I don't see how you can know that for sure). You must realise that this makes it far more difficult for people to help you. In fact, if your reasons for keeping your code secret is that you eventually want to monetise it (what other reason is there for not sharing code?), why would you expect people to give their time to help you?

As for a bug in VirtualBox - bugs do happen in code, but it is highly unlikely that such a bug would have gone unnoticed. The reality is that by far the majority of problems with low-level code are the result of the coder making unwarranted assumptions, or silly mistakes, rather than a bug in their toolset.

A lot of other issues could be causing your problem - the VM configuration, your BIOS setting, particularly those related to virtualisation, what other software is running on your computer, etc. The best plan is to take everything back to the simplest level, in particular ensuring that you are not running any other virtualisation software, virus-checking software, etc., to see if this affects what is happening. With just a snippet of code and no real details of your hardware/software setup it's difficult to be more specific.
rdos
Member
Member
Posts: 3296
Joined: Wed Oct 01, 2008 1:55 pm

Re: VirtualBox "mov es, ax" (or maybe "mov ss, ax"?) faults

Post by rdos »

Many emulators have problems with segmentation, which doesn't affect major OSes like Windows or Linux, and so go unnoticed. In fact, I don't know of any emulator that can run RDOS without problems, which relates to problems with handling segmentation.
sounds
Member
Member
Posts: 112
Joined: Sat Feb 04, 2012 5:03 pm

Re: VirtualBox "mov es, ax" (or maybe "mov ss, ax"?) faults

Post by sounds »

VirtualBox 6.0.24 works fine, VirtualBox 6.1.38 segfaults. I was able to attach gdb to the VirtualBoxVM process and get a stack trace. The linux kernel on the host machine also logs the error:

Code: Select all

traps: EMT-0[4851] general protection fault ip:7f09985da76d sp:7f097456ec10 error:0 in VBoxVMM.so[7f0998471000+1bf000]
(I'm not expecting anyone to chime in at this point, just kind of closing out the topic by saying I've moved on.)
sounds
Member
Member
Posts: 112
Joined: Sat Feb 04, 2012 5:03 pm

Re: [Solved] VirtualBox "mov es, ax" or "mov ss, ax" faults

Post by sounds »

(Marking this as solved. The specific version of VirtualBox I was using - 6.1.38 - had an issue with a broken VT-D virtualization implementation.)
Post Reply