Clean Shutdown?

Kernel, Main, Utilities & Applications, Miscellaneous Devices.
vk3heg
Posts: 1
Joined: Mon Oct 18, 2021 11:56 am

Clean Shutdown?

Unread post 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
Xbytez
Site Admin
Posts: 469
Joined: Wed May 20, 2020 3:36 pm
Has thanked: 214 times
Been thanked: 787 times

Re: Clean Shutdown?

Unread post 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.
throAU
Posts: 181
Joined: Fri Sep 11, 2020 1:06 am
Has thanked: 229 times
Been thanked: 27 times

Re: Clean Shutdown?

Unread post 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.
Post Reply