0

I am using an Intel Quark SoC and am trying to read some data from RAM after a triple fault occurs. I am saving some data before the reset occur and want to read it after my program restarts. Is this possible or the RAM is cleared?

Ross Ridge
  • 38,414
  • 7
  • 81
  • 112
Keith Ape
  • 1,103
  • 1
  • 12
  • 28
  • 6
    Yes, possible. Back in the days of OS/2 on a 286 they used a similar technique to switch from protected mode to real mode by triple faulting (was faster than the reset via the 8042 keyboard controller). The trick is that you have to tell the system that you want to force a warm reset that doesn't destroy ram. You can do that via the BDA which is [documented online](http://stanislavs.org/helppc/bios_data_area.html) in particular memory address 0x40:0x72 or physical address 0x472 . I believe this technique still work on modern hardware even on a triple fault, but I haven't tried it in a while. – Michael Petch Apr 13 '16 at 20:09
  • You should write that as an answer, @MichaelPetch – David Hoelzer Apr 13 '16 at 22:12
  • @DavidHoelzer : Anyone who wishes to write an answer can be my guest. I can't say for certainty that this still works and I do know that some VMs didn't (still don't?) honor it. They may now, but I don't really know .There is a gap in my knowledge, and my comment is more set to what had a better chance of working in the old days. My feeling is that this is probably an XY problem. – Michael Petch Apr 13 '16 at 23:00
  • @user2628079 : Is there a particular reason you want to do this? Is there a problem you are trying to avoid or solve? I would be curious to know WHY you want to do this? Maybe there is a better way to do what you are looking to do? – Michael Petch Apr 13 '16 at 23:01
  • 2
    @MichaelPetch I tried it with a recent version of VirtualBox and it doesn't seem to honour it, at least not after a triple fault reset or keyboard reset. The BIOS supports it though, it works with JMP 0f000h:0fff0h. – Ross Ridge Apr 14 '16 at 02:43
  • 1
    Thanks @RossRidge , I'm not actually surprised and appreciate you looking at it. It reinforces my opinion that this is not an easy question to answer except for "it depends". I think the more prudent question to have answered is why the OP wishes to do this. Maybe they are looking for a solution to another question that may have better alternatives than this. – Michael Petch Apr 14 '16 at 03:18
  • Dear @MichaelPetch, I am currently working on a validation for the Segmentation and tasking in the x86 "on an Intel Quark SoC". The problem is that I am running a lot of test and some of these tests generate a GP fault... so I want to automate these tests in a way that even if a GP fault happens I would save my data (ex: test results, executed tests, etc ...) somewhere in the RAM and then do a soft reset and execute the tests from the beginning but excluding the one that caused a GP fault (This RAM Variable will then have data about which tests cause the issue and it will be ignored). – Keith Ape Apr 14 '16 at 09:38
  • 2
    So install a GP fault handler that saves the data and restarts your tests? In any case you should have mentioned in your question that you're using Quark SoC CPU. It's likely you're using UEFI firmware that isn't PC compatible and doesn't support BIOS interfaces. It may very well have no method of preserving RAM during tests. (Also why are you validating "segmentation and tasking"? Do you have some reason to suspect Intel may have not implemented this correctly?) – Ross Ridge Apr 14 '16 at 18:03
  • @RossRidge, I am not sure how can I go from the GP fault handler to the beginning of the tests .. isn't it that an IRET from the handler will return to the EIP just at the faulty instruction ? Is there a way that I can return from the handler to the beginning of the tests directly ??... concerning the validation its more of we trying to understand what could be a non-typical way of manipulating segmentation and tasking in the x86. One last thing I tried to check the RAM reset issue and I can confirm that the RAM DOESN'T get reset on the Intel Quark SE... thanks Ross for your help and support ! – Keith Ape Apr 17 '16 at 20:45

0 Answers0