Date: Mon, 9 Mar 1998 18:45:37 -0500 (EST) From: "Bruce M. Walter" <walter@fortean.com> To: Andrew Maltsev <am@amsoft.ru> Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: APM power off (patch) Message-ID: <Pine.BSF.3.96.980309183606.19411A-100000@aries.fortean.com> In-Reply-To: <199803092330.CAA06308@amsoft.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
> Ok. I understand. But should we distinguish devices and core system? > All the time I mean powering off core system after all devices were shut > down or powered down by their drivers - by at_shutdown queues or other > means. Yes. When I say device, I mean device driver. You can look at a UPS or an APM bios extension as a 'device'. The code for specific functions belongs in the driver, where it's interacted with by userland, the kernel etc, etc. > > 1) Execute all registered SHUTDOWN_PRE_SYNC functions > > 2) Kill all processes > > 3) Sync the filesystem > > 4) Execute all registered SHUTDOWN_POST_SYNC functions > > 5) (with patches) Execute all registered SHUTDOWN_POWEROFF functions > > 6) Halt if requested > > 7) Check for a panic > > 8) Reboot > > So, step 8) should be: > 8) reboot or power off, whatever requested. Well, I'm actually proposing it's taken out of the kernel (step 8) and put into the callout functions (step 5). The implementation of the SHUTDOWN_POWEROFF queue allows this by having a queue specifically for functions need to be called after EVERYTHING else related to shutdown is said and done. Steps 6,7 and 8 all are in the same category, but for various reasons stay in-kernel: Halt, because all it is is a tight loop. Panic (I presume) because it needs direct access to kernel information to perform a crash dump. Reboot is just a fallthrough which performs a hardware reset. - Bruce ======================================================================== || Bruce M. Walter || 107 Timber Hollow Court #335 || || Senior Network Consultant || Chapel Hill, NC 27514 || || Fortean Technologies, Inc. || Tel: 919-967-4766 || || Information Technology Consultants || Fax: 919-967-4395 || ======================================================================== || BSD Unix -- It's not just a job, it's a way of life! || ======================================================================== To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.980309183606.19411A-100000>