VOGONS


First post, by jennifer3

User metadata
Rank Newbie
Rank
Newbie

When I have DOSBox up and I walk away from my computer, it won't hibernate. I'm certain it is DOSBox that is doing this, because if it's NOT running then my computer goes into hibernation just fine after so many minutes.

This happens when the DOS prompt is showing and when I'm running a program (usually one that I wrote using Turbo C).

I understand there's some system call a program can make that turns off "hibernatability". Should I try to intercept this call and no-op it? (I'm trying to ALLOW hibernation not stop it.)

I'm using Debian Linux 6 (Wheezy) with the MATE desktop.

Jennifer

Reply 1 of 9, by jennifer3

User metadata
Rank Newbie
Rank
Newbie

Bump.

It turns out it wasn't hibernation that was being blocked, it was sleep (suspend) mode.

In any case, isn't there some sort of system call that a program (such as DOSBox) uses to block hibernation/sleep? Perhaps I could use a hex editor to "no-op" this call.

The ideal solution would be a configuration option that allows (a) blocking of sleep, (b) always allowing sleep to happen, or (c) allowing sleep when the DOS prompt is displayed but blocking it otherwise.

Jennifer

Reply 2 of 9, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Isn't it doing exactly what it is meant to do?
It's running so it should block going to sleep. When you want your machine to sleep make a script to kill Dosbox after a certain time... (Or force it into background and look at the dosbox config, there is something about priority in background and you can set it to pause)

Dosbox is for games and either you play or you don't 😉

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 3 of 9, by ripa

User metadata
Rank Oldbie
Rank
Oldbie

https://msdn.microsoft.com/en-us/library/wind … v=vs.85%29.aspx

You probably need to implement that yourself in Dosbox (and/or supporting libraries like SDL).

edit: or environment variable SDL_VIDEO_ALLOW_SCREENSAVER=1 might help.

Reply 4 of 9, by jennifer3

User metadata
Rank Newbie
Rank
Newbie

What I need is to be able to walk away and when it reaches a certain time of no input, allow the computer to go to sleep, same as with most apps.

I don't want to shut down DOSBox, because then I'll lose whatever I've done up to that point. I do want to be able to pick up exactly where I left off.

ripa wrote:

https://msdn.microsoft.com/en-us/library/wind … v=vs.85%29.aspx

You probably need to implement that yourself in Dosbox (and/or supporting libraries like SDL).

edit: or environment variable SDL_VIDEO_ALLOW_SCREENSAVER=1 might help.

I wouldn't know where to find such a variable. Building from source is definitely outside my skill set. (I tried downloading the source but I couldn't find anything that looked like an emulator -- just a lot of scripts and header files.)

Jennifer

Reply 5 of 9, by ripa

User metadata
Rank Oldbie
Rank
Oldbie

Sorry, you said system call so I thought you knew programming. Anyway, the environment variable might help without modifying Dosbox. If Dosbox allows Windows to start a screensaver, it might also allow the system idle timer to expire and go into standby. How to set the path and environment variables in Windows

Reply 6 of 9, by jennifer3

User metadata
Rank Newbie
Rank
Newbie

I'm an old mainframe hog. While I do have some PC programming knowledge, I don't know everything.

I entered the environment variable in DOSBox using the SET command. (Did I say I was using Debian Linux 6 [Wheezy] with the MATE desktop? See the OP.)

Jennifer

Reply 7 of 9, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

No, you have to enter it in a terminal (xterm) and start dosbox from that terminal.

Water flows down the stream
How to ask questions the smart way!

Reply 8 of 9, by Stiletto

User metadata
Rank l33t++
Rank
l33t++
Qbix wrote:

No, you have to enter it in a terminal (xterm) and start dosbox from that terminal.

Yeah, it's an environmental variable for the "host OS", not the "guest OS", in virtual-machine parlance (not that DOSBox is a virtual machine)

"I see a little silhouette-o of a man, Scaramouche, Scaramouche, will you
do the Fandango!" - Queen

Stiletto

Reply 9 of 9, by Jorpho

User metadata
Rank l33t++
Rank
l33t++

I recall from Screeching when running DosBox that DOSBox is constantly making calls to SDL_Delay. Perhaps that is enough to keep the computer "awake".

jennifer3 wrote:

I don't want to shut down DOSBox, because then I'll lose whatever I've done up to that point. I do want to be able to pick up exactly where I left off.

Perhaps you should consider the experimental save state support (included with the SVN Daum build) ? That would allow you to close DOSBox and later pick up exactly where you left off.