"FreeBASIC program in Linux text mode Error?

Linux specific questions.
St_W
Posts: 1495
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: "FreeBASIC program in Linux text mode Error?

Postby St_W » Jul 26, 2016 21:46

petan wrote:By my point of view (after all research), everybody who is coding FB graphic app for linux text mode must be familiar with this parts:
[...]
Also, after quick seeing on gfxlib linux source from posted link (THX for it !) seems, that /dev/fb0 MUST be ON for proper GFX job (even I am not C coder).
I didn't check if this relevant detail, IMHO, is written in GFX documentation, in case the gfxlib is OK.

The Linux Framebuffer (fbdev) is just one one graphics backend supported by FreeBasic's gfxlib2. Normally people use X11 as graphics backend so people don't have to care about all that stuff. If they use the framebuffer graphics (btw I don't like the term "text mode" for fbdev as it's all about graphic so "text mode" is IMHO an inappropriate term for it) people have to be familiar with that, but I wouldn't consider that abnormal. While probably most entries in your requirements list are probably not needed in most cases the remaining one describe just basic knowledge about the used graphics system (e.g. comparable to knowing how to change the display resolution / color depth in Windows if you'd use that).
/dev/fb0 is the default framebuffer device in the gfxlib2 implementation, but it can be overridden by setting an environment variable (see implementation for more detail). Of course the framebuffer device must be working to use the framebuffer as graphics backend :-)

I don't know whether there's any documentation about the different backends supported by gfxlib2 like DirectX and GDI on Windows or X11 and fbdev on Linux, but it would be definitely good to have one. Honestly I didn't know that gfxlib2 supports fbdev before this thread and was surprised that there's an implementation for that.

Tourist Trap wrote:I still don't understand why not launching some apps that would theorically try to display images even in text-mode. Why not testing osome:
[...]
Hopefully all of this will be just a switch to activate at boot sequence and a software designed for text-mode may be able to say something about this in its documentation or even as an error message.
As far as we know (e.g. by writing urandom to fbdev or running the C program I posted earlier) the graphics hardware works correctly, so there's no need to run any program like lynx for additional testing. Btw I doubt that the other mentioned programs could use framebuffer graphics. (And again, framebuffer is about graphics, not a "text-mode").


Of course it's hard to say and we can only give an educated guess, but from Gablea's description the issue is probably a bug in gfxlib2. Still a configuration problem or even a bug in the framebuffer driver of the used Linux system are absolutely possible as well as many other reasons. The problem is that it's very hard to debug if we can't reproduce the issue.
caseih
Posts: 1518
Joined: Feb 26, 2007 5:32

Re: FreeBASIC program in Linux Error?

Postby caseih » Jul 26, 2016 23:29

Tourist Trap wrote:I still don't understand why not launching some apps that would theorically try to display images even in text-mode. Why not testing osome:
-- firefox
-- vlc
-- browsers of the lynx familly
-- ..etc.

Hopefully all of this will be just a switch to activate at boot sequence and a software designed for text-mode may be able to say something about this in its documentation or even as an error message.

As Petan says, this is not a "text mode" issue nor is it something that running firefox or vlc would help diagnose. Lynx is a text-only browser and doesn't do graphics as far as I know, but elinks may have framebuffer support, but I don't know if most distros include support by default. The other apps you mention are *X11 apps* meaning they require a working X11 display server to operate. On newer distros, these apps can display to the Wayland display server instead, but that's yet another animal and not this framebuffer that Gablea is trying to use.
Gablea
Posts: 1049
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Re: "FreeBASIC program in Linux text mode Error?

Postby Gablea » Jul 27, 2016 1:03

I DID IT

I have managed to get the program to work in plain text mode of Debian 8 (never have managed to get it to work in that version)

This is what i did to get it to work

1. edited the grub setting file and set GURB_GFXMODE to 800x600x32
2. Added GRUB_GFXPAYLOAD_LINUX=800x600x32
3. apt-get installed the following programs sudo, Mysql, xorg, xserver-xorg-video-vesa, xfe (so i can do updates via usb etc)

as I understood it when debain was first installed it did not have a frame buffer set up so when I installed Xorg xorg created one and then because I
set the GFX resolutions at boot the system used them settings.

Below is a photo of the NPoS application RUNNING on the actual hardware (I am tomorrow evening updating my development machine to 8 again)

Image
Image
Image
Image

As you can see it is pulling data from a central Mysql server (linux) I do still have a lot of work to do o n the project but NOW i can load it with out any desktop needed I can crack on with the project :)

Thanks once again to everyone who has advised and guided me

Andy
Tourist Trap
Posts: 2901
Joined: Jun 02, 2015 16:24

Re: "FreeBASIC program in Linux text mode Error?

Postby Tourist Trap » Jul 27, 2016 3:42

Gablea wrote:I DID IT

Nice to hear that Gablea.
St_W
Posts: 1495
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: "FreeBASIC program in Linux text mode Error?

Postby St_W » Jul 27, 2016 10:08

Gablea wrote:I DID IT
I have managed to get the program to work in plain text mode of Debian 8 (never have managed to get it to work in that version)

Nice to hear that it works, so it was a configuration issue on your side and no issue with the gfxlib2 - also nice.
Again, it's no text mode, it's a graphics mode. If you wanted text mode you would have to set GRUB_GFXPAYLOAD_LINUX=text instead of the graphics mode (then no framebuffer device would be available).

Gablea wrote:1. edited the grub setting file and set GRUB_GFXMODE to 800x600x32
2. Added GRUB_GFXPAYLOAD_LINUX=800x600x32
3. apt-get installed the following programs sudo, Mysql, xorg, xserver-xorg-video-vesa, xfe (so i can do updates via usb etc)
as I understood it when debain was first installed it did not have a frame buffer set up so when I installed Xorg xorg created one and then because I
set the GFX resolutions at boot the system used them settings.

IMHO the relevant part was setting the graphics mode, which apparently wasn't detected/chosen correctly by default. As far as I know you don't need any X-Server stuff to use the framebuffer, so I don't see a reason for installing xorg or xserver-xorg-video-vesa except you need it for other programs (like the mentioned xfe), but I'd simply manage the system via SSH.
Gablea
Posts: 1049
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Re: "FreeBASIC program in Linux text mode Error?

Postby Gablea » Jul 27, 2016 12:10

I am still getting use to the linux systems (so never used SSH)

I am also trying to work out a way of running my touchscreen app without xserver (but the touchscreen seems to only use x server at the moment but im waiting for a email from the manufacturers)

Return to “Linux”

Who is online

Users browsing this forum: No registered users and 2 guests