loading the coredump file to memory

Shivaprashanth H shivprashanth.h at globaledgesoft.com
Wed Mar 27 05:23:31 UTC 2019


resuming in openbsd is mostly reverse of suspend sequence.


sys/stand/boot/boot.c -> boot() is the entry point on OS

machdep - perform some machine dependant tasks
devboot - determine boot from device type
copy boot image to kernel path

set kernel address and timeout value

bootdev_has_hibernate - check if hibernate image exists by checking hibernate flag status

if yes, copy the image to /bsd.booted path
loadfile - load kernel image




________________________________
From: Shivaprashanth H
Sent: Wednesday, March 27, 2019 10:31:25 AM
To: Adrian Chadd
Cc: Peter Jeremy; freebsd-acpi at freebsd.org
Subject: Re: loading the coredump file to memory


here is a summary of what openbsd do (code flow i have identified)

  1.  ZZZ -Z is the command to hibernate
  2.  acpiioctl (sys/dev/acpi/acpi.c) handles the hibernation
  3.  does _TTS, _PTS, _GTS etc programming as per acpi specs required for entering sleep states
  4.  allocate memory for hibernation image
  5.  suspend devices
  6.  freeze processes
  7.  reset clocks
  8.  disable interrupts
  9.  write to pm registers as mentioned in acpi specs
  10. enable wakeup sources
  11. save cpu context
  12. hibernate_suspend (sys/kern/subr_hibernate.c)
     *  1. Calculating this machine's hibernate_info information
      *  2. Allocating a piglet and saving the piglet's physaddr
     *  3. Calculating the memory chunks
     *  4. Writing the compressed chunks to disk
     *  5. Writing the chunk table
     *  6. Writing the signature block (hibernate_info)
  13. powerdown disk drives
  14. write to WKS_STS and SLP_TYPx as per acpi specs


-Shiva



________________________________
From: Shivaprashanth H
Sent: Wednesday, March 27, 2019 12:50 AM
To: Adrian Chadd
Cc: Peter Jeremy; freebsd-acpi at freebsd.org
Subject: Re: loading the coredump file to memory

In short it creates hibernate image in a swap space before going to suspend. After boot checks for availability of image and if present loads it. I can share more details tomorrow.

Get Outlook for Android<https://aka.ms/ghei36>

________________________________
From: Adrian Chadd <adrian.chadd at gmail.com>
Sent: Wednesday, March 27, 2019 12:39:01 AM
To: Shivaprashanth H
Cc: Peter Jeremy; freebsd-acpi at freebsd.org
Subject: Re: loading the coredump file to memory

hi,

What's openbsd do exactly?


-adrian


On Tue, 26 Mar 2019 at 12:00, Shivaprashanth H <shivprashanth.h at globaledgesoft.com<mailto:shivprashanth.h at globaledgesoft.com>> wrote:
Two options. One to use coredump. Other to port from openbsd where hibernate is working fine

Get Outlook for Android<https://aka.ms/ghei36>

________________________________
From: Adrian Chadd <adrian.chadd at gmail.com<mailto:adrian.chadd at gmail.com>>
Sent: Wednesday, March 27, 2019 12:27:55 AM
To: Shivaprashanth H
Cc: Peter Jeremy; freebsd-acpi at freebsd.org<mailto:freebsd-acpi at freebsd.org>
Subject: Re: loading the coredump file to memory

woo!



-adrian


On Tue, 26 Mar 2019 at 11:55, Shivaprashanth H <shivprashanth.h at globaledgesoft.com<mailto:shivprashanth.h at globaledgesoft.com>> wrote:
Yes 😁

Get Outlook for Android<https://aka.ms/ghei36>

________________________________
From: Adrian Chadd <adrian.chadd at gmail.com<mailto:adrian.chadd at gmail.com>>
Sent: Wednesday, March 27, 2019 12:24:17 AM
To: Peter Jeremy
Cc: Shivaprashanth H; freebsd-acpi at freebsd.org<mailto:freebsd-acpi at freebsd.org>
Subject: Re: loading the coredump file to memory

... is someone trying to make suspend-to-disk work? :)


-adrian

On Tue, 26 Mar 2019 at 11:45, Peter Jeremy <peter at rulingia.com<mailto:peter at rulingia.com>> wrote:
On 2019-Mar-26 13:16:40 +0000, Shivaprashanth H <shivprashanth.h at globaledgesoft.com<mailto:shivprashanth.h at globaledgesoft.com>> wrote:
>using sysctl debug.kdb.panic=1 command, panic can be simulated which results in system reboot and writing of system context(ram snapshot?) to a file vmcore.x in /var/crash
>
>my question is, will it be possible to load this file back into memory?

If you mean, can you take the crashdump and turn it back into a running system,
no that's not possible.  Maybe if you explain what your objective is, we might
be able to make suggestions.

(And, I'm not sure how this relates to ACPI).
--
Peter Jeremy
Disclaimer: "This message is intended only for the designated recipient(s). It may contain confidential or proprietary information and may be subject to other confidentiality protections. If you are not a designated recipient, you may not review, copy or distribute this message. Please notify the sender by e-mail and delete this message. GlobalEdge does not accept any liability for virus infected mails."
Disclaimer: "This message is intended only for the designated recipient(s). It may contain confidential or proprietary information and may be subject to other confidentiality protections. If you are not a designated recipient, you may not review, copy or distribute this message. Please notify the sender by e-mail and delete this message. GlobalEdge does not accept any liability for virus infected mails."
Disclaimer: "This message is intended only for the designated recipient(s). It may contain confidential or proprietary information and may be subject to other confidentiality protections. If you are not a designated recipient, you may not review, copy or distribute this message. Please notify the sender by e-mail and delete this message. GlobalEdge does not accept any liability for virus infected mails."


More information about the freebsd-acpi mailing list