You are not logged in.

#1 2013-03-07 11:07:21

Aditya Raj Bhatt
Member
From: New Delhi, India
Registered: 2013-02-27
Posts: 17

[SOLVED]How to run dosbox in virtual console (without X) ?

Hello. In the past week I've been shifting my entire computing in the console (without GUI). I've found the apps cmus(audio player), mplayer2(video player), fbida(image viewer), lesspipe(to read pdf's and other things) and its been real fun and feasible too.

However, dosbox is an essential application that I have to startxfce4 to use. Please tell me how to run it in the console. Its entirely commandline based, except the startup, so there must be some way?

P.S- My school uses the ultra-outdated turbo c++ compiler to teach the language. Its got some vendor dependant libraries (conio.h, graphics.h), so its necessary that I use dosbox to run it. If you can't help me with dosbox, then can you please tell me how to run tc.exe in the console. That'll do as well.

P.P.S- Please don't tell me to rebel and use gcc. I tried that. NOT an experience I'll want to repeat again. big_smile

Last edited by Aditya Raj Bhatt (2013-03-08 15:10:05)

Offline

#2 2013-03-07 11:30:41

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,841

Re: [SOLVED]How to run dosbox in virtual console (without X) ?


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#3 2013-03-07 15:17:32

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 4,416

Re: [SOLVED]How to run dosbox in virtual console (without X) ?

Dosbox uses SDL for video output, and SDL can use many video drivers.
You can set which videodriver it should use through the SDL_VIDEODRIVER environment variable.
see http://sdl.beuc.net/sdl.wiki/SDL_envvars

fbcon, directfb and svgalib seem worth a try.

NOTE :
i've run SDL programs on console a few years ago, but stopped doing that after a few hangs.
Upon hang the whole system was stuck, and all i could do was a hard reboot.


An alternative to starting  WM/DE would be to use a customized .xinitrc with startx.
all you need to do is have exec dosbox in it instead of exec somewm .
This will start an X session that is exclusively used by/for dosbox .

Last edited by Lone_Wolf (2013-03-07 15:18:05)


Booting with apg Openrc, NOT systemd.
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#4 2013-03-07 22:04:06

Aditya Raj Bhatt
Member
From: New Delhi, India
Registered: 2013-02-27
Posts: 17

Re: [SOLVED]How to run dosbox in virtual console (without X) ?

The problem is solved and dosbox is running perfectly. Typing sudo dosbox DID open it in the console but messed up the keyboard (down arrow became enter, - became e or something). And doing exec dosbox in ~/.xinitrc opened it up too, but failed to detect my keyboard. So no commands typed, unable to exit, I had to do a hard reboot for both the cases. And I exported the SDL_VIDEODRIVER to fbcon and other things but that didn't work.

So I read the raspberry pi forum that skanky posted above and that led to other posts. The final solution-

Create a folder /root/.dosbox and a file in it  dosbox-0.74.conf 
Do the following changes-
usescancodes=false //And then quite far below
keyboardlayout=us //Or whatever you want. Search dosbox keyboardlayout. The developers have a list of supported layouts on their site.

Now - sudo dosbox in the console runs it flawlessly.

How do I mark it as solved or closed like in other forums?

P.S- Thanks for the quick replies. The Arch community really is awesome. Just like the wiki. This was my first post and now I know where to come after reading the comprehensive wiki you guys have built.

EDIT : I forgot to mention that the dosbox-0.74.conf has to be obtained in two ways. 1. Running dosbox from console and getting it hanged. Then you'll have to reboot and you'll find the file in ~/.dosbox (both the folder and file are automatically generated). This is NOT recommended.
2. Running dosbox in the X server. This also generates the file which you can copy to /root/.dosbox (create the folder if it doesn't exist). This is safe.

Last edited by Aditya Raj Bhatt (2013-03-08 07:55:01)

Offline

#5 2013-03-08 09:08:38

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,841

Re: [SOLVED]How to run dosbox in virtual console (without X) ?

Nice. Can you mark the thread as solved by editing the title in your first post, please? smile


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

Board footer

Powered by FluxBB