# simple-framebuffer / simplefb guide?

## jhon987

Is it possible that someone would write down the steps needed to get simplefb working?

I recently got a new PC and I want to make it work with proprietary Nvidia (for performance reasons) and uvesa is no longer a possibility.

I can't get any framebuffer visuals whatsoever and it seems simplefb is the best option there is, however I've no idea how to get it to work.

I enabled it in the kernel and recompiled it, I've added "video=simplefb:mtrr:3,ywrap" to GRUB_CMDLINE_LINUX_DEFAULT and then ran "grub-mkconfig -o /boot/grub/grub.cfg" and yet upon booting there's nothing more than choppy mangled image.

When switching between ttys there's only blank screen with a row of colored pixels.

I don't use initramfs on this machine, and I haven't went through the steps of building a device tree (if that is actually needed).

Can anyone please help?

----------

## jburns

Try the efifb. I have both CONFIG_FB_EFI=y and CONFIG_FB_SIMPLE=y

See https://wiki.archlinux.org/index.php/GRUB/Tips_and_tricks#Setting_the_framebuffer_resolution

----------

## jhon987

 *jburns wrote:*   

> Try the efifb. I have both CONFIG_FB_EFI=y and CONFIG_FB_SIMPLE=y
> 
> See https://wiki.archlinux.org/index.php/GRUB/Tips_and_tricks#Setting_the_framebuffer_resolution

 

I don't use EFI and haven't created an EFI partition. The link explains about the grub gfx values which I pretty much got right anyways.

Thanks for trying to help though

----------

## jhon987

Also, I noticed dmesg outputs the following:

simple-framebuffer: probe of simple-framebuffer.0 failed with error -12

----------

## jburns

https://forums.gentoo.org/viewtopic-p-8111658.html#8111658 has some information on setting up a framebuffer.

----------

## jhon987

 *jburns wrote:*   

> https://forums.gentoo.org/viewtopic-p-8111658.html#8111658 has some information on setting up a framebuffer.

 

Thanks, the bottom line from that link is that I should figure out how to resolve my:

```
simple-framebuffer: probe of simple-framebuffer.0 failed with error -12
```

error.

However, I've no idea as there's almost no documentation regarding this error on the internet

----------

## guitou

Hello.

searching google for: simple-framebuffer error 12

first link tells error is ENOMEM (out of memory)

And other results obtained seem relevant (one googledocs discussion telling about required kernel params, others?..).

++

Gi)

----------

## jhon987

 *guitou wrote:*   

> Hello.
> 
> searching google for: simple-framebuffer error 12
> 
> first link tells error is ENOMEM (out of memory)
> ...

 

Well, the first link has no solution to offer and with 16GB of RAM I somehow doubt it is a OOM issue.

The rest of the links I saw have nothing useful to contribute either.

So currently, I use nvidia-drivers and have no way to get into console mode or even see the GRUB itself...

Nouveau has very poor performance, though probably less buggy than Nvidia blobs, and so I'm left with this semi-functional configuration probably until I'll get too frustrated with the bugs and decide to revert to poorly performing nouveau at some point.

Thanks for trying to help though.

----------

## NeddySeagoon

jhon987,

Simplefb takes over the framebuffer left by something else. You don't get to set it up. The kernel only draws on it.

Conventional wisdom is that you use the VGA text console with the nvidia binary blob but any framebuffer that does not attempt to configure the hardware should work. That only leaves simple and efi.

Maybe vesa too, if your graphics card firmware supports it.

Please post the output of 

```
lspci -knn
```

and put your kernel .config file onto a pastebin site.

----------

## jhon987

Ok Neddy, thanks for your time.

```
$ lspci -knn

00:00.0 Host bridge [0600]: Intel Corporation Device [8086:3ec2] (rev 07)

        Subsystem: ASUSTeK Computer Inc. Device [1043:8694]

00:01.0 PCI bridge [0604]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) [8086:1901] (rev 07)

        Kernel driver in use: pcieport

00:14.0 USB controller [0c03]: Intel Corporation Device [8086:a36d] (rev 10)

        Subsystem: ASUSTeK Computer Inc. Device [1043:8694]

        Kernel driver in use: xhci_hcd

00:14.2 RAM memory [0500]: Intel Corporation Device [8086:a36f] (rev 10)

        Subsystem: ASUSTeK Computer Inc. Device [1043:8694]

00:14.3 Network controller [0280]: Intel Corporation Device [8086:a370] (rev 10)

        Subsystem: Intel Corporation Device [8086:0034]

00:16.0 Communication controller [0780]: Intel Corporation Device [8086:a360] (rev 10)

        Subsystem: ASUSTeK Computer Inc. Device [1043:8694]

00:17.0 SATA controller [0106]: Intel Corporation Device [8086:a352] (rev 10)

        Subsystem: ASUSTeK Computer Inc. Device [1043:8694]

        Kernel driver in use: ahci

00:1b.0 PCI bridge [0604]: Intel Corporation Device [8086:a342] (rev f0)

        Kernel driver in use: pcieport

00:1c.0 PCI bridge [0604]: Intel Corporation Device [8086:a33a] (rev f0)

        Kernel driver in use: pcieport

00:1c.3 PCI bridge [0604]: Intel Corporation Device [8086:a33b] (rev f0)

        Kernel driver in use: pcieport

00:1d.0 PCI bridge [0604]: Intel Corporation Device [8086:a330] (rev f0)

        Kernel driver in use: pcieport

00:1f.0 ISA bridge [0601]: Intel Corporation Device [8086:a304] (rev 10)

        Subsystem: ASUSTeK Computer Inc. Device [1043:8694]

00:1f.3 Audio device [0403]: Intel Corporation Device [8086:a348] (rev 10)

        Subsystem: ASUSTeK Computer Inc. Device [1043:8760]

        Kernel driver in use: snd_hda_intel

00:1f.4 SMBus [0c05]: Intel Corporation Device [8086:a323] (rev 10)

        Subsystem: ASUSTeK Computer Inc. Device [1043:8694]

        Kernel driver in use: i801_smbus

00:1f.5 Serial bus controller [0c80]: Intel Corporation Device [8086:a324] (rev 10)

        Subsystem: ASUSTeK Computer Inc. Device [1043:8694]

00:1f.6 Ethernet controller [0200]: Intel Corporation Ethernet Connection (7) I219-V [8086:15bc] (rev 10)

        Subsystem: ASUSTeK Computer Inc. Ethernet Connection (7) I219-V [1043:8672]

        Kernel driver in use: e1000e

01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GF114 [GeForce GTX 560 Ti] [10de:1200] (rev a1)

        Subsystem: Gigabyte Technology Co., Ltd GF114 [GeForce GTX 560 Ti] [1458:3515]

        Kernel driver in use: nvidia

        Kernel modules: nvidia_drm, nvidia

01:00.1 Audio device [0403]: NVIDIA Corporation GF114 HDMI Audio Controller [10de:0e0c] (rev a1)

        Subsystem: Gigabyte Technology Co., Ltd GF114 HDMI Audio Controller [1458:3515]

        Kernel driver in use: snd_hda_intel
```

Kernel config: http://ix.io/1s9w

Please note that currently I've disabled all framebuffers including CONFIG_FB_SIMPLE and CONFIG_FB_EFI but previously I had each individually compiled into the kernel  and also had the CONFIG_FIRMWARE_EDID compiled as well.

My GRUB file might be of interest as well:

```
# Copyright 1999-2015 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

#

# To populate all changes in this file you need to regenerate your

# grub configuration file afterwards:

#     'grub2-mkconfig -o /boot/grub/grub.cfg'

#

# See the grub info page for documentation on possible variables and

# their associated values.

GRUB_DISTRIBUTOR="Gentoo"

# Default menu entry

#GRUB_DEFAULT=0

# Boot the default entry this many seconds after the menu is displayed

GRUB_TIMEOUT=8

#GRUB_TIMEOUT_STYLE=menu

# Append parameters to the linux kernel command line

#GRUB_CMDLINE_LINUX="init=/sbin/openrc-init"

#

# Examples:

#

# Boot with network interface renaming disabled

# GRUB_CMDLINE_LINUX="net.ifnames=0"

#

# Boot with systemd instead of sysvinit (openrc)

#GRUB_CMDLINE_LINUX="init=/usr/lib/systemd/systemd"

# Append parameters to the linux kernel command line for non-recovery entries

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash rootfstype=ext4 nvidia-drm.modeset=1"

#video=pcie_aspm=force vga=792 video=vesafb:mtrr:3,ywrap"

#video=uvesafb:1280x1024-24,mtrr:3,ywrap"

#video=simplefb:mtrr:3,ywrap"

# Uncomment to disable graphical terminal (grub-pc only)

#GRUB_TERMINAL=console

# The resolution used on graphical terminal.

# Note that you can use only modes which your graphic card supports via VBE.

# You can see them in real GRUB with the command `vbeinfo'.

#GRUB_GFXMODE=1920x1080x24

GRUB_GFXMODE=1280x1024-24,auto

# Set to 'text' to force the Linux kernel to boot in normal text

# mode, 'keep' to preserve the graphics mode set using

# 'GRUB_GFXMODE', 'WIDTHxHEIGHT'['xDEPTH'] to set a particular

# graphics mode, or a sequence of these separated by commas or

# semicolons to try several modes in sequence.

GRUB_GFXPAYLOAD_LINUX=keep

# Path to theme spec txt file.

# The starfield is by default provided with use truetype.

# NOTE: when enabling custom theme, ensure you have required font/etc.

#GRUB_THEME="/boot/grub/themes/breeze/theme.txt"

# Background image used on graphical terminal.

# Can be in various bitmap formats.

#GRUB_BACKGROUND="/boot/grub/mybackground.png"

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel

#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries

#GRUB_DISABLE_RECOVERY=true

# Uncomment to disable generation of the submenu and put all choices on

# the top-level menu.

# Besides the visual affect of no sub menu, this makes navigation of the

# menu easier for a user who can't see the screen.

#GRUB_DISABLE_SUBMENU=y

# Uncomment to play a tone when the main menu is displayed.

# This is useful, for example, to allow users who can't see the screen

# to know when they can make a choice on the menu.

#GRUB_INIT_TUNE="60 800 1"
```

Also, I'm not sure whether it's relevant but my screen is connected to the PC via an HDMI cord

----------

## NeddySeagoon

jhon987,

You have the simpleframebuffer turned off in your kernel.

```
# CONFIG_FB_SIMPLE is not set
```

You do have 

```
CONFIG_VGA_CONSOLE=y
```

which is the old text only console and 

```
CONFIG_FRAMEBUFFER_CONSOLE=y
```

Now, the kernel prefers a framebuffer console over the old text console when both are configured.

Unfortunately, its not an error to tell the kernel to use a framebuffer console like this, then not configure one. I've been there and done that.

As you have demonstrated, you get black text on a black background, which is rather difficult to read.

If you turn off CONFIG_FRAMEBUFFER_CONSOLE, you should get the text console.

Since this should of worked in one of your prior configurations, it provokes the question of "Are you running the kernel you think you are?"

Look in 

```
uname -a 
```

```
$ uname -a

Linux NeddySeagoon_Static 4.19.0-gentoo #1 SMP PREEMPT Thu Oct 25 19:29:44 BST 2018 x86_64 AMD Phenom(tm) II X6 1090T Processor AuthenticAMD GNU/Linux
```

That tells that I'm running 4.19.0-gentoo #1 which has been built once (#1)

It was built at Thu Oct 25 19:29:44 BST 2018.  You may not be aware of the build number but you probably remember your last kernel build.

Is the build date/time what you expect?

If not, you probably forgot to mount /boot for the kernel install.

Rebuild your kernel, with CONFIG_FB_SIMPLE support. Reboot. Check uname -a and if its OK but there is no console, please pastebin the output of dmesg.

----------

## Muso

Well, that's disappointing,   My monitor is 2560x1080.

```
╭─root@Otherness /home/rasalom  

╰─# hwinfo --framebuffer

02: None 00.0: 11001 VESA Framebuffer                           

  [Created at bios.459]

  Unique ID: rdCR.PFxKO2hSZ+2

  Hardware Class: framebuffer

  Model: "NVIDIA GM206 Board"

  Vendor: "NVIDIA Corporation"

  Device: "GM206 Board"

  SubVendor: "NVIDIA"

  SubDevice: 

  Revision: "Chip Rev"

  Memory Size: 16 MB

  Memory Range: 0xf1000000-0xf1ffffff (rw)

  Mode 0x0300: 640x400 (+640), 8 bits

  Mode 0x0301: 640x480 (+640), 8 bits

  Mode 0x0303: 800x600 (+800), 8 bits

  Mode 0x0305: 1024x768 (+1024), 8 bits

  Mode 0x030e: 320x200 (+640), 16 bits

  Mode 0x030f: 320x200 (+1280), 24 bits

  Mode 0x0311: 640x480 (+1280), 16 bits

  Mode 0x0312: 640x480 (+2560), 24 bits

  Mode 0x0314: 800x600 (+1600), 16 bits

  Mode 0x0315: 800x600 (+3200), 24 bits

  Mode 0x0317: 1024x768 (+2048), 16 bits

  Mode 0x0318: 1024x768 (+4096), 24 bits

  Mode 0x0330: 320x200 (+320), 8 bits

  Mode 0x0331: 320x400 (+320), 8 bits

  Mode 0x0332: 320x400 (+640), 16 bits

  Mode 0x0333: 320x400 (+1280), 24 bits

  Mode 0x0334: 320x240 (+320), 8 bits

  Mode 0x0335: 320x240 (+640), 16 bits

  Mode 0x0336: 320x240 (+1280), 24 bits

  Mode 0x033d: 640x400 (+1280), 16 bits

  Mode 0x033e: 640x400 (+2560), 24 bits

  Config Status: cfg=new, avail=yes, need=no, active=unknown

```

----------

## jhon987

Hello Neddy,

 *Quote:*   

> As you have demonstrated, you get black text on a black background, which is rather difficult to read. 

 

Well that's not accurate, perhaps I didn't explain it correctly, so after I see the bios logo there's a blinking dash to the top left of the screen which stays there for about a second and then when the GRUB text should follow all I see is a colorful image about the size of 1280x1024, it's not actually an image but rather a blend of, what seems to me, repeating mixed pixels. Almost a year ago I wrote a program which takes png images and converts them to jpeg using jpeglib.h library directly and during my writing of this program the initial outcome was usually a blend of colorful pixels which happened because the remapping of each pixel converted from png to jpeg was incorrect.

Anyways, after the boot finishes and from the moment I get to SDDM and later on, when I switch to any of the other ttys (not tty 7) all I see is a black/blank screen.

```

$ uname -a

Linux Gentoo 4.14.78-gentoo #28 SMP Sat Nov 17 08:23:05 IST 2018 x86_64 Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz GenuineIntel GNU/Linux
```

current kernel config: http://ix.io/1sb9

I didn't separate /boot from /rootfs, it's all in one partition hence why I don't use initramfs, I like to keep it simple

dmesg: http://ix.io/1sba

Edit: I just noticed this in dmesg -

```

Scanning for low memory corruption every 60 seconds

[    0.210537] ioremap on RAM at 0x0000000009000000 - 0x00000000094fffff

[    0.210539] ------------[ cut here ]------------

[    0.210543] WARNING: CPU: 1 PID: 1 at arch/x86/mm/ioremap.c:119 __ioremap_caller+0x27f/0x2c0

[    0.210543] Modules linked in:

[    0.210545] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.14.78-gentoo #28

[    0.210546] Hardware name: System manufacturer System Product Name/TUF H370-PRO GAMING (WI-FI), BIOS 0904 09/14/2018

[    0.210547] task: ffff94580b200000 task.stack: ffffab2d01908000

[    0.210548] RIP: 0010:__ioremap_caller+0x27f/0x2c0

[    0.210549] RSP: 0000:ffffab2d0190bbb8 EFLAGS: 00010296

[    0.210550] RAX: 0000000000000039 RBX: 0000000009000000 RCX: ffffffffa7846af8

[    0.210550] RDX: 0000000000000001 RSI: 0000000000000086 RDI: ffffffffa7e1dd4c

[    0.210551] RBP: 0000000000000001 R08: 000000000000021e R09: 0000000000000004

[    0.210551] R10: ffff94580af92ee0 R11: 0000000000000001 R12: 0000000000500000

[    0.210552] R13: ffff94580ab4a000 R14: 0000000000000000 R15: ffffffffa6bdeed3

[    0.210553] FS:  0000000000000000(0000) GS:ffff94580d240000(0000) knlGS:0000000000000000

[    0.210554] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033

[    0.210554] CR2: 0000000000000000 CR3: 000000020800a001 CR4: 00000000003606e0

[    0.210555] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000

[    0.210556] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

[    0.210556] Call Trace:

[    0.210560]  simplefb_probe+0x233/0x3a0

[    0.210562]  platform_drv_probe+0x33/0x90

[    0.210564]  driver_probe_device+0x207/0x2d0

[    0.210565]  ? __driver_attach+0x90/0x90

[    0.210567]  bus_for_each_drv+0x54/0x80

[    0.210568]  __device_attach+0xb0/0x110

[    0.210570]  bus_probe_device+0x85/0xa0

[    0.210571]  device_add+0x3b5/0x5d0

[    0.210573]  ? set_debug_rodata+0xc/0xc

[    0.210575]  ? __kmalloc_track_caller+0x123/0x1a0

[    0.210576]  platform_device_add+0x104/0x220

[    0.210577]  ? set_debug_rodata+0xc/0xc

[    0.210579]  platform_device_register_full+0xeb/0x100

[    0.210581]  ? pci_swiotlb_late_init+0x1f/0x1f

[    0.210582]  platform_device_register_resndata.constprop.0+0x49/0x52

[    0.210584]  create_simplefb+0xb2/0xc1

[    0.210586]  sysfb_init+0x52/0x6c

[    0.210587]  do_one_initcall+0x39/0x150

[    0.210589]  kernel_init_freeable+0x150/0x1d7

[    0.210591]  ? rest_init+0xb0/0xb0

[    0.210592]  kernel_init+0x5/0x100

[    0.210594]  ret_from_fork+0x35/0x40

[    0.210595] Code: 05 af 16 fe 00 48 09 04 24 e9 28 ff ff ff 48 8d 54 24 28 48 8d 74 24 18 48 c7 c7 85 cd 58 a7 c6 05 bc 6c 0d 01 01 e8 c7 5f 05 00 <0f> 0b 45 31 f6 e9 f5 fd ff ff 48 89 fe 48 c7 c7 20 cc 58 a7 e8 

[    0.210617] random: get_random_bytes called from print_oops_end_marker+0x34/0x50 with crng_init=0

[    0.210618] ---[ end trace 2f096cd68d45f412 ]---

[    0.210621] simple-framebuffer: probe of simple-framebuffer.0 failed with error -12
```

So, as you can see it ends up with the error I previously mentioned (12)

----------

## NeddySeagoon

jhon987,

The boot process is the BIOS does its thing and loads Grub. I'll skip the details.

Once grub is loaded. its all alone and has to make its own arrangements for its user interface.

Your problem is here, not in the kernel, at least, not yet.

The kernel relies on something setting up the simple framebuffer before it loads, so all it has to do is draw on it.

Since the grub screen is incorrect, its unlikely the kernel can use simple framebuffer, until that's fixed.

I still use grub-static, so you should start a new topic about the grub display being in a mess.

I'm not going to be any help with grub2.

----------

## jhon987

Ok Neddy, so if I understand you correctly, what you're saying is that there something wrong with my GRUB2 installation, possibly a faulty configuration or worse, a corrupted segment, or something along the lines of that...

Well I can tell you when I partitioned the new SSD I got I gave bios_grub the 2MB it requires and unlike previously, I formatted the partition as ext2 instead of vfat/fat32 so maybe that has something to do with it.

Other than that I've enabled 64bit optimization in the bios yet the GRUB target I used was --target=i386-pc so that also might be the culprit.

I guess I'll just have to do some trial and error to figure out. Thanks for pointing me in the right direction (I think)

----------

## NeddySeagoon

jhon987,

grub uses the bios_grub for itself, only if you try to mix BIOS booting with a GPT disklable.

If you BIOS and a MSDOS disklable, grub uses the free space before the first partition.

Grub uses the bios_grub space raw. Any filesystem you make there will be overwritten. 

Whatever, until you get fhe grub menu to display properly, the kernel can't use the framebuffer that it leaves behind.

----------

## jhon987

Neddy you champ it turns out indeed the culprit was my enabling of 64bit optimization in the bios, once I've disabled that all of a sudden I could see grub again, and then after recompiling the kernel with

```
CONFIG_FRAMEBUFFER_CONSOLE=y
```

I can now also switch between ttys and actually see text instead of a mere black screen.

Now I I'm curious whether it would be possible for me to install grub for 64bit (e.g. --target=x86_64-efi) even though I don't use efi and also turn on 64bit optimization in my bios, but that's not relevant for this thread I guess.

Thank you so much for the help Neddy, your experience and deep understanding are priceless!

----------

