VOGONS


First post, by Walter Dnes

User metadata
Rank Newbie
Rank
Newbie

Going through some old stuff/backups, I discovered that years ago I'd backed up Chessmaster 3000 and some obscure DOS games to CD. I even found my Chessmaster 3000 floppies! I haven't had any luck getting Dosbox going on my linux machine, 1999 Dell Dimension, 450 mhz PIII, 128 megs of ram, ATI Rage Pro 3D (Mach64 *NOT* Rage 128). Running blackbox WM on X11, on Gentoo linux 2.6.11-r11. And yes, my make.conf does use the PIII to its fullest, but it's not insane.
CFLAGS="-O2 -march=pentium3 -fomit-frame-pointer -mmmx -msse -mfpmath=sse"

I'm not a programmer, or a professional linux admin, but in the past 48 hours, I've put strace through its paces trying to figure out what's going on. I've found...
- Dosbox died, and complained about SDL not being able to init a display device
- strace log showed that it died when trying to open a non-existant /dev/svga
- the svgalib_helper module *MUST* be rebuilt every time I upgrade my kernel
- the svgalib_helper module does not load automatically
- "modprobe svgalib_helper" creates /dev/svga and /dev/svga1
- but the owner:group is root:root and permisions are 660, so I did "chgrp games /dev/svg*" (my regular user iD is a member of "games" group")
- something needs access to /dev/console, which normally has 600 permission. I changed that to 660, which should be sufficient, as /dev/console is accessable by group "tty" which my regular user ID is also a member of

I've now "advanced" to the point where svgalib spins its wheels for a few seconds, and segfaults. It doesn't matter whether I run dosbox as regular user or root. I can't figure out what strace is saying, so I'm uploading the tail end of the log. The strace log is over 3 megabytes, but it's probably just the last bit that's useful.

Reply 1 of 11, by HunterZ

User metadata
Rank l33t++
Rank
l33t++

Have you been able to get any other SVGALIB and/or SDL apps working?

Reply 2 of 11, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

hmm yes. well dosbox tends to run using X instead of vgalib.
but to be honest I never tried the vgalib variant of sdl. I always use X

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

Reply 3 of 11, by `Moe`

User metadata
Rank Oldbie
Rank
Oldbie

Dosbox doesn't like SDL returning an error on video mode initialization. It doesn't handle that correctly and crashed. However, the true problem is that SDL couldn't initialize your video system. I can't help you there either, but that's what you have to get going. I would guess svgalib can't switch to the desired resolution or bit depth - and you just have to find out why 😉

You could also try the framebuffer console instead of svgalib if you know how to enable it and your kernel supports that.

Reply 4 of 11, by HunterZ

User metadata
Rank l33t++
Rank
l33t++

DOSBox should be fixed to not crash. No matter what error happens, a robust program should catch and handle it gracefully instead of crashing...

Reply 5 of 11, by Guest

User metadata
Walter Dnes wrote:

I've now "advanced" to the point where svgalib spins its wheels for a few seconds, and segfaults. It doesn't matter whether I run dosbox as regular user or root. I can't figure out what strace is saying, so I'm uploading the tail end of the log. The strace log is over 3 megabytes, but it's probably just the last bit that's useful.

I managed to figure it out, indirectly, backwards, etc. To make sure that I had the latest versions of everything relevant, I rebuilt svgalib and everything that depended on svgalib. At the end of the "links" build output, was a note that links (aka links2) needed to be suid in order to be able to use svgalib. This reminded me that one of the last commands in the strace log was "getuid32()", which indicated that it cared about setuid. I setuid dosbox, and it now comes up in drive Z:. The following error comes up, but at least I'm in dosbox...

CONFIG: Using default settings. Create a configfile to change them
ALSA:Can't subscribe to MIDI port (65:0)
MIDI:Opened device:none

Does somebody want me to post a checklist or FAQ entry about my "experiences", to save other linux users a bunch of fumbling around? To the instructions on my first post, add the following...

chmod u+s /usr/games/bin/dosbox
*WARNING* this can be a security risk; use with care, and not on multi-user machines.

Reply 6 of 11, by HunterZ

User metadata
Rank l33t++
Rank
l33t++

That would be great. You could add the info to the Wiki if you wanted.

It looks like the next step is to get ALSA working on your system so you can have MIDI support 😀

Reply 7 of 11, by `Moe`

User metadata
Rank Oldbie
Rank
Oldbie

ALSA seems to be working for him, there's just no (hardware) MIDI port. Typical average onboard sound... the timidity++ package provides a soft synth that can register as a MIDI port. More details can be found in the package's docs.

Reply 8 of 11, by Guest

User metadata
HunterZ wrote:

That would be great. You could add the info to the Wiki if you wanted.

It looks like the next step is to get ALSA working on your system so you can have MIDI support 😀

I'll hold off "educating others" until I get the various combinations sorted out and I know what I'm doing. Here's what I think I've found so far...
- dosbox requires sdl
- sdl has the option of being compiled with, or without, svgalib support
- svgalib bangs away directly at the hardare, which requires root-level permission.
- if sdl is compiled with svgalib linked in, any program using sdl (dosbox or mplayer or whatever) indirectly uses svgalib, and therefore must be run setuid root (potential security risk, frowned on in linux)
- if sdl is compiled *WITHOUT* linkage to svgalib, I find I don't have to screw around with loading svgalib_helper and chmod /dev/console and setuid dosbox as root.

Running *WITHOUT* svgalib linked into sdl is obviously the preferred way to go. On Gentoo, I control the system and can rebuild sdl to my specs. On "consumer-oriented-desktop" versions of linux, the end-user may not have that level of control, and may have to resort to running dosbox setuid root, etc.

Reply 9 of 11, by `Moe`

User metadata
Rank Oldbie
Rank
Oldbie

I wonder why svgalib needs to be linked in... many other libs, like OpenGL, are used differently: SDL only loads the DLL (or .so for linux) when it is first accessed. Needs special programming, though - probably whoever did the svgalib driver left that out.

By the way, what happens if you "export SDL_VIDEODRIVER=x11" before you run dosbox with your svgalib-linked-in SDL? SDL shouldn't access svgalib at all in that case. It might just be the autodetect that triggers svgalib calls.

Reply 10 of 11, by HunterZ

User metadata
Rank l33t++
Rank
l33t++

It sounds like he's saying that it doesn't need to be linked in. My guess is that SDL supports both X and svgalib as output devices under linux (makes sense to me).

Reply 11 of 11, by Walter Dnes

User metadata
Rank Newbie
Rank
Newbie

And it's way out in left field. There's been an upgrade to bash 3 recently. I have a customized prompt that is supposed to show up in shells and subshells (e.g. an xterm). It's no longer showing up the way I like it. Something has changed the way environmental variables like "PS" are passed. "PS" wasn't getting passed properly under my weird scheme. Neither was "DISPLAY". Not finding "DISPLAY", sdl went to "plan B", namely svga.

I was going nuts trying to correlate behaviour from a few days ago (before the bash upgrade), with current behaviour (after bash upgrade). DISPLAY existed in text consoles so launching from there used X, which I always have running in the background. DISPLAY did not exist inside an xterm, so dosbox tried using svga.

I've straightened out how environmental variables are passed under the "new and improved" layout and things work properly. That's my current explanation, and I think it covers everything.