On Sun, 06 Mar 2011 09:29:52 +1200 (MSK), Valery V. Sedletski wrote:
PS: maybe, offtopic, but I'm in trouble a bit.
Already googled the Linux Framebuffer HOWTO and several articles. It seems that vesafb will not work for me (I have Matrox G400 card, on which I get a message "Cannot set vga mode, press Enter..." when booting Linux. Also, it supports VESA 2.0, but GRUB sees only modes not higher than 800x600). I also found some drivers in ./kernel/drivers/video/matrox, will check them.
Hi Valery,
Already googled the Linux Framebuffer HOWTO and several articles. It seems that vesafb will not work for me (I have Matrox G400 card, on which I get a message "Cannot set vga mode, press Enter..." when booting Linux. Also, it supports VESA 2.0, but GRUB sees only modes not higher than 800x600). I also found some drivers in ./kernel/drivers/video/matrox, will check them.
what is your incentive to use the fbdev backend of libSDL? Most of the time, we are using the Linux version of Genode with X11, which is very convenient during development. (for deployment, we would not recommend the Linux version) If your graphics card is supported by X11, there is no need to fiddle with fbdev drivers of the Linux kernel.
However, from time to time, we have used libSDL directly with fbdev. So once you get the Linux driver for your graphics card running, Genode should work as expected.
Cheers Norman
On Mon, 07 Mar 2011 11:15:00 +0100, Norman Feske wrote:
Hi Valery,
Already googled the Linux Framebuffer HOWTO and several articles. It seems that vesafb will not work for me (I have Matrox G400
card,
on which I get a message "Cannot set vga mode, press Enter..." when booting Linux. Also, it supports VESA 2.0, but GRUB sees only
modes
not higher than 800x600). I also found some drivers in ./kernel/drivers/video/matrox, will check them.
what is your incentive to use the fbdev backend of libSDL? Most of the time, we are using the Linux version of Genode with X11, which is very convenient during development. (for deployment, we would not recommend the Linux version) If your graphics card is supported by X11, there is no need to fiddle with fbdev drivers of the Linux kernel.
I just compiled Genode in console, not in xterm, so I first tried launching Core from there. So, I noticed that it tries to use a framebuffer, so I decided that it is intended way to work. Fiasco.UX seems to work from console too, so I decided that it will work likewise :)
However, from time to time, we have used libSDL directly with fbdev. So once you get the Linux driver for your graphics card running, Genode should work as expected.
Yes, it even worked. I copied the os\config\demo file to build\bin\config, beside the other executables symlinks. I loaded matrox framebuffer driver, and then /dev/fb0 appeared. So, I started core and Genode started with a Launchpad!
But strange. I managed to hurt my Debian Lenny by OS/2 chkdsk (Linux is installed on JFS filesystem, and I forgot to say OS/2 to not touch the Linux partition. So, today after some crash, JFS chkdsk is started, and it moved /dev, /bin, /sbin and /usr/bin dirs to lost+found.). Then I reinstalled Linux, and after that Genode won't start anymore. Strange, When I start Core, it spawns Init, then I see two lines in the screen log:
[init -> launchpad] Could not open file "config" [init -> launchpad] Could not obtain config file
-- so, it starts init, and init knows that it must start launchpad (from 'config' file, I think), but nevertheless, it says that 'config' could not be found! Strange, it did found 'config' before I reinstalled Linux, but now won't. I thought that maybe, it is something wrong with permissions, but I made
chmod 777 config chown root.root config
and tried to start Core as root. Then it won't find 'config' again. What could be wrong? Need I copy the full Core log?
WBR, valery
Hello Valery,
Yes, it even worked. I copied the os\config\demo file to build\bin\config, beside the other executables symlinks. I loaded matrox framebuffer driver, and then /dev/fb0 appeared. So, I started core and Genode started with a Launchpad!
Please use 'os/config/linux_demo' instead of 'os/config/demo'. You want to use the SDL-based framebuffer driver, don't you? ;-)
BTW, you may also try doing a 'make run/demo' in your Genode build directory. The build system should compile and configure everything to run the default demo (you'll need to install 'expect' though, see: 'http://genode.org/documentation/release-notes/11.02#section-30').
But strange. I managed to hurt my Debian Lenny by OS/2 chkdsk (Linux is installed on JFS filesystem, and I forgot to say OS/2 to not touch the Linux partition. So, today after some crash, JFS chkdsk is started, and it moved /dev, /bin, /sbin and /usr/bin dirs to lost+found.). Then I reinstalled Linux, and after that Genode won't start anymore. Strange, When I start Core, it spawns Init, then I see two lines in the screen log:
[init -> launchpad] Could not open file "config" [init -> launchpad] Could not obtain config file
-- so, it starts init, and init knows that it must start launchpad (from 'config' file, I think), but nevertheless, it says that 'config' could not be found! Strange, it did found 'config' before I reinstalled Linux, but now won't. I thought that maybe, it is something wrong with permissions, but I made
The message is actually fine. It shows that init has started 'launchpad' as instructed by init's config. So the config file is there. Now launchpad simply complains that there is no sub config for launchpad (indeed, there isn't). So it will fall back to a builtin default configuration. That is the normal behaviour. If you want to configure launchpad, you'll need to add a '<config>' subnode in launchpad's '<start>' node. You may have a look at 'os/config/nested_config' to see how to pass configurations to subsystems, and the 'demo/src/app/launchpad/README' for the configuration options for launchpad.
and tried to start Core as root. Then it won't find 'config' again. What could be wrong? Need I copy the full Core log?
Running core as root is not needed. It runs fine as plain user-level process.
Norman
On Mon, 07 Mar 2011 14:48:13 +0100, Norman Feske wrote:
Hello Valery,
Yes, it even worked. I copied the os\config\demo file to build\bin\config, beside the other executables symlinks. I loaded matrox framebuffer driver, and then /dev/fb0 appeared. So, I started core and Genode started with a Launchpad!
Please use 'os/config/linux_demo' instead of 'os/config/demo'. You want to use the SDL-based framebuffer driver, don't you? ;-)
Oh, sorry, I messed a bit -- I used linux_demo the previous time, then I forgot about it and took 'demo' next time :(
BTW, you may also try doing a 'make run/demo' in your Genode build directory. The build system should compile and configure everything to run the default demo (you'll need to install 'expect' though, see: 'http://genode.org/documentation/release-notes/11.02#section-30').
But strange. I managed to hurt my Debian Lenny by OS/2 chkdsk (Linux is installed on JFS filesystem, and I forgot to say OS/2 to not touch the Linux partition. So, today after some crash, JFS chkdsk is started, and it moved /dev, /bin, /sbin and /usr/bin dirs to lost+found.). Then I reinstalled Linux, and after that Genode won't start anymore. Strange, When I start Core, it spawns Init, then I see two lines in the screen log:
[init -> launchpad] Could not open file "config" [init -> launchpad] Could not obtain config file
-- so, it starts init, and init knows that it must start launchpad (from 'config' file, I think), but nevertheless, it says that 'config' could not be found! Strange, it did found 'config' before I reinstalled Linux, but now won't. I thought that maybe, it is something wrong with permissions, but I made
The message is actually fine. It shows that init has started 'launchpad' as instructed by init's config. So the config file is there. Now launchpad simply complains that there is no sub config for launchpad (indeed, there isn't). So it will fall back to a builtin default configuration. That is the normal behaviour. If you want to configure launchpad, you'll need to add a '<config>' subnode in launchpad's '<start>' node. You may have a look at 'os/config/nested_config' to see how to pass configurations to subsystems, and the 'demo/src/app/launchpad/README' for the configuration options for launchpad.
So, it is a normal behaviour, well. Then I mentioned wrong log lines -- there were some other errors. The full log looked like this:
[===================cut here========================] dtp:/media/os2l/var/src/genode/genode-11.02/bulid/bin# ./core int main(): --- create local services --- int main(): --- start init --- int main(): transferred 79 MB to init int main(): --- init created, waiting for exit condition --- [init] unsupported program segment type 0x4 No protocol specified No protocol specified [init -> launchpad] Could not open file "config" [init -> launchpad] Could not obtain config file [init -> fb_sdl] creating virtual framebuffer for mode 1024x768@16 [init -> fb_sdl] int main(int, char**): fb_ds_cap has port 34566 [init -> nitpicker] framebuffer is 1024x768@1 [init -> nitpicker] create session with args: fb_mode=1, label="launchpad", ram_quota=1646592 [init -> nitpicker] Could not open file "config" [init -> nitpicker] Could not obtain config file [init -> nitpicker] create session with args: fb_width=1024, fb_height=1504, fb_mode=1, label="launchpad", ram_quota=3088384 [init -> launchpad] Could not open file "config" [init -> launchpad] --- entering main loop --- ^Cint main(): --- destroying init --- virtual void Genode::Core_parent::close(Genode::Session_capability): implement me, please virtual void Genode::Core_parent::close(Genode::Session_capability): implement me, please context area detach from 0x2fe000 - not implemented int main(): --- core main says good bye --- dtp:/media/os2l/var/src/genode/genode-11.02/bulid/bin# ===================cut here========================]
Namely, something about incorrect program segment type 0x4. -- This log I have got when tried to specify a video mode with
vga=0x314 (1024x768x16bit)
in Linux kernel command line. So, that was probably, the compiled-in into the kernel vesa fb driver. With it I got that log, and no subsequent switch to the graphics video mode -- libSDL remained in text mode!
Yesterday I tried to remove the vga= line from Linux kernel command line, and launch Matrox fb driver again manually. libSDL then started the graphics mode successfully, like it was in the first time! So, maybe, it is some bug in Linux vesafb driver -- I thought that I broke something when I reinstalled Linux, but now appears that the cause was the use of another fb driver, which doesn't work.
PS: I also tried to start the Linux Genode version from within X11. -- There was still vesafb driver active in the console, but when I started it in xterm, libSDL again tried to use a framebuffer backend, not the X11 one. Maybe, I must edit some config files to switch backends or this is a bug too?
WBR, valery
Hi,
So, it is a normal behaviour, well. Then I mentioned wrong log lines -- there were some other errors. The full log looked like this:
[===================cut here========================] dtp:/media/os2l/var/src/genode/genode-11.02/bulid/bin# ./core int main(): --- create local services --- int main(): --- start init --- int main(): transferred 79 MB to init int main(): --- init created, waiting for exit condition --- [init] unsupported program segment type 0x4 No protocol specified No protocol specified [init -> launchpad] Could not open file "config" [init -> launchpad] Could not obtain config file [init -> fb_sdl] creating virtual framebuffer for mode 1024x768@16 [init -> fb_sdl] int main(int, char**): fb_ds_cap has port 34566 [init -> nitpicker] framebuffer is 1024x768@1 [init -> nitpicker] create session with args: fb_mode=1, label="launchpad", ram_quota=1646592 [init -> nitpicker] Could not open file "config" [init -> nitpicker] Could not obtain config file [init -> nitpicker] create session with args: fb_width=1024, fb_height=1504, fb_mode=1, label="launchpad", ram_quota=3088384 [init -> launchpad] Could not open file "config" [init -> launchpad] --- entering main loop --- ^Cint main(): --- destroying init --- virtual void Genode::Core_parent::close(Genode::Session_capability): implement me, please virtual void Genode::Core_parent::close(Genode::Session_capability): implement me, please context area detach from 0x2fe000 - not implemented int main(): --- core main says good bye --- dtp:/media/os2l/var/src/genode/genode-11.02/bulid/bin# ===================cut here========================]
Namely, something about incorrect program segment type 0x4. -- This log I have got when tried to specify a video mode with
vga=0x314 (1024x768x16bit)
in Linux kernel command line. So, that was probably, the compiled-in into the kernel vesa fb driver. With it I got that log, and no subsequent switch to the graphics video mode -- libSDL remained in text mode!
Yesterday I tried to remove the vga= line from Linux kernel command line, and launch Matrox fb driver again manually. libSDL then started the graphics mode successfully, like it was in the first time! So, maybe, it is some bug in Linux vesafb driver -- I thought that I broke something when I reinstalled Linux, but now appears that the cause was the use of another fb driver, which doesn't work.
PS: I also tried to start the Linux Genode version from within X11. -- There was still vesafb driver active in the console, but when I started it in xterm, libSDL again tried to use a framebuffer backend, not the X11 one. Maybe, I must edit some config files to switch backends or this is a bug too?
Please make sure to install DirectFB with fbcon support (I disabled X as well), also install/compile libsdl with DirectFB support. Take care of the permissions of /dev/fb0. Test this setup with some Linux SDL application to see if it works.
After that please apply the attached patch to Genode and see if it works for you.
Sebastian
On Tue, 08 Mar 2011 11:09:13 +0100, Sebastian Sumpf wrote:
Please make sure to install DirectFB with fbcon support (I disabled X as well),
I have DirectFB 1.0.1 installed; in the /usr/lib/directfb-1.0-0/systems I have libdirectfb_fbdev.[a,so] and libdirectfb_x11.[a,so] libraries. So, I think, in directfb, both X11 and fbdev are supported. (need I to disable X11?) Maybe, you meant fbdev support, not fbcon? So, it seems that both x11 and fbdev enabled in my libdirectfb. Need I SDL support in directfb? I tried co compile it myself, but when I enable SDL support, it won't compile, because it don't like SDL_Surface declaration in SDL_video.h. (no idea, why -- maybe some undefined types? -- for example, in SDL_Surface declaration in my SDL/SDL_video.h I have private structure members, like struct private_hwdata *hwdata, and this struct has undefined type. I tried to change struct private_hwdata * to void * but no effect) I finally decided to leave the DirectFB version I have supplied with my Debian Lenny.
also install/compile libsdl with DirectFB support.
SDL and DirectFB must support each other or only DirectFB support in SDL is needed? How can I determine is some option enabled or not? I have both sdl_config and directfb_config scripts, can they answer this question?
Take care of the permissions of /dev/fb0. Test this setup with some Linux SDL application to see if it works.
I tried qemu, it works (both text-mode apps and graphic ones work, at least VGA mode OS/2 logo works in a VM), but keyboard works strangely (at least, arrow keys -- Down arrow acts like Enter, for example). So, SDL seems to work (but I have no idea, in which app I can test both SDL and DirectFB)
After that please apply the attached patch to Genode and see if it works for you.
Yes, I added 'case PT_NOTE:' choice in a switch statement in base/src/base/elf/elf_binary.cc, and recompiled, then it no more complains about incorrect program header/section.
WBR, valery
l4-hackers@os.inf.tu-dresden.de