Page 1 of 1

Clean Shutdown?

Posted: Mon Oct 25, 2021 4:16 am
by vk3heg
HI Guys,

had my mister for a few days so far, and loving the beast. It's so flexible.

BUT there is one nagging issue I'm not fining a answer for, and that is how to cleanly shutdown the core that's running, and mister it's self.

I've found doing a "poweroff" in a ssh session only reboot's the whole system. As SD cards are flakey I want to cleanly shutdown.

I've looked through the wiki, and unless it's hiding, I;m not finding this answer.

Thanks

Stephen

Re: Clean Shutdown?

Posted: Mon Oct 25, 2021 8:18 am
by Xbytez
Here is a quote from Sorgelig from the old Atari MiSTer forum:
It's not like raspberry pi. MiSTer normally loads with system mounted as read-only. Some computer cores open their hard file in read-write - this is the only file opened in write mode. Usually if this computer core doesn't write constantly (which is usually the case) then even in this condition it's safe to just power off as hard file opened in sync mode (buffers are flushed immediately upon write).

For the safest option i suggest quickly (no longer than 2 seconds!) press LSHIFT+LCTRL+LALT+RALT - this will reload Menu core and it will ensure that all files are closed.

Then you can simply power off.

Re: Clean Shutdown?

Posted: Tue Oct 26, 2021 11:47 am
by throAU
To add to this - the purpose of "safe shutdown" for modern computers is to ensure that all files are written to disk by flushing disk buffers prior to power off. Which is why as per sorgelig's quoted post above, Mister is OK as it mounts most stuff read-only. Disk write caching is a relatively modern (vs. the systems MiSTer is running) thing.

* the console cores won't be mounting their ROMs read/write, so no worries - no write cache to flush
* the old computer cores (other than PC - e.g., Amiga, ST, etc.) never really had any safe shutdown procedure either as they had minimal/small or no disk IO buffering. even DOS was a case of maybe park the drive heads on the physical hard drive to avoid damage from hard drive movement when powered off (irrelevant for MiSTer) but that wasn't an OS shutdown per-se. even if you were running smartdrv disk cache with DOS 5.0+ or Windows 3.1+, it defaulted to read-cache only (and thus no disk cache to flush to disk)
* console core save states are handled by mister which i do not believe is doing buffered IO (it writes at time of save, so once the "save" progress bar is complete you're good to go, as it has completed the writing to SD card)

the long story short:
* Mister itself doesn't need safe shutdown.
* almost all the cores won't care either, with the possible exception of ao486(?) - depending on what OS you're running on it. Maybe if you're running ao486 with Windows do a safe shutdown inside of windows to ensure the PC emulation does what it needs to do inside of its own environment - then you're good to just power off the Mister.

Raspberry pi is a bit different as everything is running via software emulation on top of linux, which mounts things read/write and uses the linux OS filesystem write caching.