OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 4:23 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: VirtualBox "mov es, ax" (or maybe "mov ss, ax"?) faults
PostPosted: Mon Dec 26, 2022 2:11 am 
Offline
Member
Member

Joined: Fri Aug 26, 2016 1:41 pm
Posts: 671
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.


Top
 Profile  
 
 Post subject: Re: VirtualBox "mov es, ax" (or maybe "mov ss, ax"?) faults
PostPosted: Mon Dec 26, 2022 3:00 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
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.


Top
 Profile  
 
 Post subject: Re: VirtualBox "mov es, ax" (or maybe "mov ss, ax"?) faults
PostPosted: Mon Dec 26, 2022 12:05 pm 
Offline
Member
Member

Joined: Sat Feb 04, 2012 5:03 pm
Posts: 111
Interrupt/exception handling at this early stage is a triple fault.
Code:
idtr:base=0x0000000000000000, limit=0x0
Thank you for the suggestions, I understand the sentiment that looking at the broader picture sometimes reveals unexpected things.


Top
 Profile  
 
 Post subject: Re: VirtualBox "mov es, ax" (or maybe "mov ss, ax"?) faults
PostPosted: Tue Dec 27, 2022 3:06 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
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.


Top
 Profile  
 
 Post subject: Re: VirtualBox "mov es, ax" (or maybe "mov ss, ax"?) faults
PostPosted: Tue Dec 27, 2022 9:14 am 
Offline
Member
Member

Joined: Wed Oct 01, 2008 1:55 pm
Posts: 3191
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.


Top
 Profile  
 
 Post subject: Re: VirtualBox "mov es, ax" (or maybe "mov ss, ax"?) faults
PostPosted: Tue Dec 27, 2022 1:15 pm 
Offline
Member
Member

Joined: Sat Feb 04, 2012 5:03 pm
Posts: 111
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:
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.)


Top
 Profile  
 
 Post subject: Re: [Solved] VirtualBox "mov es, ax" or "mov ss, ax" faults
PostPosted: Thu Feb 02, 2023 11:09 pm 
Offline
Member
Member

Joined: Sat Feb 04, 2012 5:03 pm
Posts: 111
(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.)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], DotBot [Bot] and 62 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group