On Thu, Mar 28, 2019 at 07:02:11AM +0000, Shivaprashanth H wrote: > hi Larkin, > > yes. I am looking to port the hibernate feature from openbsd to freebsd. > > so in freebsd, i see dev/ada >
I don't know what physical device that corresponds to. According to the FreeBSD man page, that could really be anything that communicates using the ATA command set. Once you find out what physical device it is, you'll need to implement a side-effect-free I/O routine. The ones we've built so far (wd/ahci/nvme/sdmmc) all reimplement a write function that uses private memory carved out of an area reserved in memory called the piglet. The machine is quiesced by that point (no interrupts, etc) and the write routine is required to only touch memory in the page it has been assigned in the piglet. The one that is likely closest to your needs is ahci_hibernate_io, found in /sys/dev/ic/ahci.c. The layout of the private area in the piglet is described by the struct at the head of that function. Note that in the case softraid(4) is being used, the private page is shared between both the side effect free softraid I/O functions and whatever underlying device-specific side effect free I/O function. IIRC when I wrote that code, I put one struct at one end of the private page and the other struct at the other end. I am not sure if FreeBSD has a similar concept. Good luck. -ml > ________________________________ > From: Mike Larkin <[email protected]> > Sent: Thursday, March 28, 2019 12:25:41 PM > To: Shivaprashanth H > Cc: [email protected] > Subject: Re: hibernate_io function > > On Thu, Mar 28, 2019 at 06:03:25AM +0000, Shivaprashanth H wrote: > > the get_hibernate_io_function() in sys/arch/amd64/amd64/hibernate_machdep.c > > > > support for 'wd' and 'sd' (ahci, nvme, softraid, sdmmc) are present > > > > in my system i see /dev/ada0 > > > > so which of the above are compatible with /dev/ada0 drive? > > > > 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." > > Are you sure you're running OpenBSD? /dev/ada0 looks like something FreeBSD > would use. > > -ml > 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."
