# [Solved] Console without framebuffer in UEFI mode

## sebaro

If I disable framebuffer in kernel I have no console.

The only way to have an X session is to autologin and autostart X.

```

   VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Kabini [Radeon HD 8400 / R3 Series] (prog-if 00 [VGA controller])

   Subsystem: ASRock Incorporation Kabini [Radeon HD 8400 / R3 Series]

   Flags: bus master, fast devsel, latency 0, IRQ 41

   Memory at c0000000 (64-bit, prefetchable) [size=256M]

   Memory at d0000000 (64-bit, prefetchable) [size=8M]

   I/O ports at f000 [size=256]

   Memory at ffb00000 (32-bit, non-prefetchable) [size=256K]

   Expansion ROM at 000c0000 [disabled] [size=128K]

   Capabilities: <access denied>

   Kernel driver in use: radeon

   Kernel modules: radeon, amdgpu

```

```

#

# Graphics support

#

# CONFIG_AGP is not set

CONFIG_VGA_ARB=y

CONFIG_VGA_ARB_MAX_GPUS=16

# CONFIG_VGA_SWITCHEROO is not set

CONFIG_DRM=y

# CONFIG_DRM_DP_AUX_CHARDEV is not set

# CONFIG_DRM_DEBUG_MM is not set

# CONFIG_DRM_DEBUG_MM_SELFTEST is not set

CONFIG_DRM_KMS_HELPER=m

# CONFIG_DRM_FBDEV_EMULATION is not set

# CONFIG_DRM_LOAD_EDID_FIRMWARE is not set

CONFIG_DRM_TTM=m

#

# I2C encoder or helper chips

#

# CONFIG_DRM_I2C_CH7006 is not set

# CONFIG_DRM_I2C_SIL164 is not set

# CONFIG_DRM_I2C_NXP_TDA998X is not set

CONFIG_DRM_RADEON=m

CONFIG_DRM_RADEON_USERPTR=y

CONFIG_DRM_AMDGPU=m

# CONFIG_DRM_AMDGPU_SI is not set

CONFIG_DRM_AMDGPU_CIK=y

CONFIG_DRM_AMDGPU_USERPTR=y

# CONFIG_DRM_AMDGPU_GART_DEBUGFS is not set

#

# ACP (Audio CoProcessor) Configuration

#

# CONFIG_DRM_AMD_ACP is not set

# CONFIG_DRM_NOUVEAU is not set

# CONFIG_DRM_I915 is not set

# CONFIG_DRM_VGEM is not set

# CONFIG_DRM_VMWGFX is not set

# CONFIG_DRM_GMA500 is not set

# CONFIG_DRM_UDL is not set

# CONFIG_DRM_AST is not set

# CONFIG_DRM_MGAG200 is not set

# CONFIG_DRM_CIRRUS_QEMU is not set

# CONFIG_DRM_QXL is not set

# CONFIG_DRM_BOCHS is not set

CONFIG_DRM_BRIDGE=y

#

# Display Interface Bridges

#

# CONFIG_DRM_ANALOGIX_ANX78XX is not set

# CONFIG_DRM_HISI_HIBMC is not set

# CONFIG_DRM_TINYDRM is not set

# CONFIG_DRM_LEGACY is not set

# CONFIG_DRM_LIB_RANDOM is not set

#

# Frame buffer Devices

#

# CONFIG_FB is not set

CONFIG_FB_CMDLINE=y

CONFIG_BACKLIGHT_LCD_SUPPORT=y

CONFIG_LCD_CLASS_DEVICE=m

CONFIG_LCD_PLATFORM=m

CONFIG_BACKLIGHT_CLASS_DEVICE=m

CONFIG_BACKLIGHT_GENERIC=m

# CONFIG_BACKLIGHT_APPLE is not set

# CONFIG_BACKLIGHT_PM8941_WLED is not set

# CONFIG_BACKLIGHT_SAHARA is not set

# CONFIG_BACKLIGHT_ADP8860 is not set

# CONFIG_BACKLIGHT_ADP8870 is not set

# CONFIG_BACKLIGHT_LM3639 is not set

# CONFIG_BACKLIGHT_LV5207LP is not set

# CONFIG_BACKLIGHT_BD6107 is not set

# CONFIG_BACKLIGHT_ARCXCNN is not set

# CONFIG_VGASTATE is not set

CONFIG_HDMI=y

#

# Console display driver support

#

CONFIG_VGA_CONSOLE=y

CONFIG_VGACON_SOFT_SCROLLBACK=y

CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64

# CONFIG_VGACON_SOFT_SCROLLBACK_PERSISTENT_ENABLE_BY_DEFAULT is not set

CONFIG_DUMMY_CONSOLE=y

CONFIG_DUMMY_CONSOLE_COLUMNS=80

CONFIG_DUMMY_CONSOLE_ROWS=25

```

----------

EDIT:

The conclusions are:

1. There is no VGA/text console in UEFI mode only in BIOS or legacy boot.

2. To have working consoles in UEFI mode, these are the kernel options for KMS drivers and EFI framebuffer.

Example is for Radeon as loadable module, it should work as built-in module too.

2.1. DRM as built-in module

```

Graphics support

 ----- ATI Radeon (DRM_RADEON) [m]

|____ Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) (DRM) [y]

       ----- Enable legacy fbdev support for your modesetting driver (DRM_FBDEV_EMULATION) [y]

|____ Frame buffer Devices 

       ----- EFI-based Framebuffer Support (FB_EFI) [y]

```

2.2 DRM as loadable module

```

Graphics support

 ----- ATI Radeon (DRM_RADEON) [m]

|____ Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) (DRM) [m]

       ----- Enable legacy fbdev support for your modesetting driver (DRM_FBDEV_EMULATION) [y]

|____ Frame buffer Devices 

       ----- EFI-based Framebuffer Support (FB_EFI) [y]

      |____ Support for frame buffer devices (FB) [y]

|____ Console display driver support

       ----- Framebuffer Console support (FRAMEBUFFER_CONSOLE) [y]

```

Last edited by sebaro on Wed Jul 26, 2017 3:38 pm; edited 4 times in total

----------

## NeddySeagoon

sebaro,

That looks like it should get you the old 80x25 text console.

Put dmesg onto a pastebin site so we can see what actually happens at startup.

It will not fit into a post.

----------

## sebaro

https://pastebin.com/raw/Fv9uAgru

```

[    0.000000] Console: colour dummy device 80x25

[    0.000000] console [tty0] enabled

```

But I don't see anything on the display.

----------

## Maxxx

See

https://forums.gentoo.org/viewtopic-t-1062760-highlight-.html

I think that you need framebuffer console support

 *Quote:*   

> - Device Drivers 
> 
> - Graphic Support 
> 
> - Console display driver support 
> ...

 

----------

## sebaro

 *Maxxx wrote:*   

> See
> 
> https://forums.gentoo.org/viewtopic-t-1062760-highlight-.html
> 
> I think that you need framebuffer console support
> ...

 

That's for graphical/framebuffer, I want the old text/vga console.

```

VGA text console (VGA_CONSOLE)

CONFIG_VGA_CONSOLE:

Saying Y here will allow you to use Linux in text mode through a

display that complies with the generic VGA standard. Virtually

everyone wants that.

```

----------

## Maxxx

But since i enabled framefuffer i have text console, with framebuffer disabled i haven't it.

----------

## NeddySeagoon

sebaro,

You could try turning off 

```
CONFIG_DUMMY_CONSOLE=y 
```

What this will do depends on how your graphics card works.

----------

## sebaro

 *NeddySeagoon wrote:*   

> sebaro,
> 
> You could try turning off 
> 
> ```
> ...

 

I can't disable it from "make config", is it safe to disable it in the config file?

 *Maxxx wrote:*   

> But since i enabled framefuffer i have text console, with framebuffer disabled i haven't it.

 

Framebuffer is for displaying boot images/splashes.

The boot process is very fast for me so I don't need these, I just need to be able to login.

----------

## NeddySeagoon

sebaro,

You must never edit the .config by hand.

menuconfig and friends know all the dependencies and hidden symbols.

One menuconfig entry may change many options in the .config file.

```
 Symbol: DUMMY_CONSOLE [=y]                                                                                                                        │  

  │ Type  : boolean                                                                                                                                   │  

  │   Defined at drivers/video/console/Kconfig:94                                                                                                     │  

  │   Depends on: HAS_IOMEM [=y] && VT [=y] && (!VGA_CONSOLE [=y] || SGI_NEWPORT_CONSOLE [=n]!=y) 
```

So DUMMY_CONSOLE is a hidden symbol which is set on when the Depends on: evaluates to true.

For AMD/Intel systems, it requires !VGA_CONSOLE ... don't do that.

----------

## sebaro

I see when booting:

 *Quote:*   

> error: no suitable video mode found.
> 
> Booting in blind mode

 

Is there some option to set in grub?

The consoles are working, they respond to keybord but are not visible.

----------

## NeddySeagoon

sebaro,

Put vga=ask on the kernel command line.  The boot process will show you a list of vga modes that it knows.

You then enter the number of the mode you want.

From memory, the numbers are 0x100 in error.  A long time ago, I used to use vga=0x317

You can edit grubs kernel command line at boot time.  When the menu appears, press 'e'.

This only changes the in memory copy.

----------

## josephg

 *NeddySeagoon wrote:*   

> From memory, the numbers are 0x100 in error.  A long time ago, I used to use vga=0x317

 

http://kernel.org/doc/Documentation/svga.txt

----------

## sebaro

I've tried different values for vga, all seems to be ignored.

----------

## NeddySeagoon

sebaro,

Did vga=ask give a list?

----------

## sebaro

 *NeddySeagoon wrote:*   

> sebaro,
> 
> Did vga=ask give a list?

 

No, it just boots. This is the command line:

```

[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.12.3-gentoo-b1 root=/dev/sda2 rootfstype=ext4 init=/usr/lib/systemd/systemd ro vga=ask libata.force=noncq

[    0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.12.3-gentoo-b1 root=/dev/sda2 rootfstype=ext4 init=/usr/lib/systemd/systemd ro vga=ask libata.force=noncq

```

----------

## NeddySeagoon

sebaro,

That command line is correct.

Lets step back a little. You want to have a plain VGA console with no framebuffer because you perceive it will solve a problem.

Maybe there is another solution, share the problem you want to solve.

----------

## sebaro

I want to replace systemd with runit/sysvinit/openrc. I want to be able to see the kernel and init messages and to be able to see the login prompt. I changed the init in kernel command line and I thought it didn't work because there was no output, but was the issue with the console not showing. I don't need the framebuffer console because the boot is fast but I guess I'll have to build another kernel with fb enabled just for testing.

----------

## mir3x

try set gfxpayload=text 

or set gfxpayload=auto in grub.conf

( if doesnt work u can try disable X86_SYSFB in kernel)

----------

## sebaro

 *mir3x wrote:*   

> try set gfxpayload=text 
> 
> or set gfxpayload=auto in grub.conf
> 
> ( if doesnt work u can try disable X86_SYSFB in kernel)

 

Tried with both auto and text, here are the grub default and grub menu entry:

```

GRUB_HIDDEN_TIMEOUT=0

GRUB_HIDDEN_TIMEOUT_QUIET=true

GRUB_TIMEOUT=3

GRUB_CMDLINE_LINUX_DEFAULT=""

GRUB_CMDLINE_LINUX=""

GRUB_GFXPAYLOAD_LINUX=text

GRUB_COLOR_NORMAL="white/black"

GRUB_COLOR_HIGHLIGHT="magenta/black"

```

```

menuentry 'Gentoo GNU/Linux' {

   savedefault

   insmod gzio

   insmod part_gpt

   insmod ext2

   set root='hd0,gpt2'

   echo   'Loading Linux 4.12.3-gentoo-b1 ...'

   linux   /boot/vmlinuz-4.12.3-gentoo-b1 root=/dev/sda2 rootfstype=ext4 init=/usr/lib/systemd/systemd ro quiet libata.force=noncq

}

```

```

# CONFIG_X86_SYSFB is not set

```

----------

## s4e8

You use the EFI boot, EFI firmware provided an GOP service and Console TextOutput service, these service can't access after kernel loading, except DIRECT WRITE the framebuffer. In order to use VGA text console, you should boot in legacy mode.

----------

## sebaro

 *s4e8 wrote:*   

> You use the EFI boot, EFI firmware provided an GOP service and Console TextOutput service, these service can't access after kernel loading, except DIRECT WRITE the framebuffer. In order to use VGA text console, you should boot in legacy mode.

 

OK, so I have two choices:

1 BIOS/Legacy booting

2 UEFI booting + frame buffer support

For choice 2, which frame buffer driver to install?

- generic: vesa/uvesa

- efi

- radeon

----------

## chithanh

For framebuffer console, enable CONFIG_FRAMEBUFFER_CONSOLE (if it is a module, make sure that it gets loaded during boot).

For the drivers enabling the framebuffer you have the following options:

radeon driver + Kabini firmware

```
CONFIG_DRM_RADEON=y
```

amdgpu driver + Kabini firmware

```
CONFIG_DRM_AMDGPU=y

CONFIG_DRM_AMDGPU_CIK=y
```

efifb

```
CONFIG_FB_EFI=y
```

simplefb

```
CONFIG_FB_SIMPLE=y

CONFIG_X86_SYSFB=y
```

If you choose one method, best disable the others.

----------

## sebaro

 *chithanh wrote:*   

> For framebuffer console, enable CONFIG_FRAMEBUFFER_CONSOLE (if it is a module, make sure that it gets loaded during boot).

 

```

Frame buffer Devices

-> Support for frame buffer devices (FB)

----> ATI Radeon display support (FB_RADEON)

Console display driver support

-> Framebuffer Console support (FRAMEBUFFER_CONSOLE)

```

I assume FB and FRAMEBUFFER_CONSOLE must be built-in, if I build them as modules I'll have to use initramfs.

----------

## chithanh

Do not enable radeonfb (CONFIG_FB_RADEON), it is the legacy radeon framebuffer which will do nothing at best, and prevent X from working properly at worst.

----------

## josephg

You can disable the framebuffer in your bootloader configuration by passing "vga=0" to the kernel.

----------

## sebaro

```

CONFIG_FB=y

CONFIG_FB_EFI=y

CONFIG_FRAMEBUFFER_CONSOLE=y

```

```

[    0.291074] efifb: probing for efifb

[    0.291093] efifb: framebuffer at 0xc0000000, using 5120k, total 5120k

[    0.291100] efifb: mode is 1280x1024x32, linelength=5120, pages=1

[    0.291106] efifb: scrolling: redraw

[    0.291112] efifb: Truecolor: size=8:8:8:8, shift=24:16:8:0

[    0.297452] Console: switching to colour frame buffer device 160x64

[    0.303670] fb0: EFI VGA frame buffer device

[    1.436878] fb: switching to radeondrmfb from EFI VGA

```

Now I can see the kernel and systemd messages but then all goes blank. I can't see the login prompt.

----------

## josephg

```
fb: switching to radeondrmfb from EFI VGA
```

 needs

```
CONFIG_FB_RADEON=m

CONFIG_DRM_RADEON=m
```

----------

## sebaro

 *josephg wrote:*   

> 
> 
> ```
> fb: switching to radeondrmfb from EFI VGA
> ```
> ...

 

Still not working:

```

#

# Graphics support

#

# CONFIG_AGP is not set

CONFIG_VGA_ARB=y

CONFIG_VGA_ARB_MAX_GPUS=16

# CONFIG_VGA_SWITCHEROO is not set

CONFIG_DRM=y

# CONFIG_DRM_DP_AUX_CHARDEV is not set

# CONFIG_DRM_DEBUG_MM is not set

# CONFIG_DRM_DEBUG_MM_SELFTEST is not set

CONFIG_DRM_KMS_HELPER=m

# CONFIG_DRM_FBDEV_EMULATION is not set

# CONFIG_DRM_LOAD_EDID_FIRMWARE is not set

CONFIG_DRM_TTM=m

#

# I2C encoder or helper chips

#

# CONFIG_DRM_I2C_CH7006 is not set

# CONFIG_DRM_I2C_SIL164 is not set

# CONFIG_DRM_I2C_NXP_TDA998X is not set

CONFIG_DRM_RADEON=m

CONFIG_DRM_RADEON_USERPTR=y

CONFIG_DRM_AMDGPU=m

# CONFIG_DRM_AMDGPU_SI is not set

CONFIG_DRM_AMDGPU_CIK=y

CONFIG_DRM_AMDGPU_USERPTR=y

# CONFIG_DRM_AMDGPU_GART_DEBUGFS is not set

#

# Frame buffer Devices

#

CONFIG_FB=y

# CONFIG_FIRMWARE_EDID is not set

CONFIG_FB_CMDLINE=y

CONFIG_FB_NOTIFY=y

CONFIG_FB_DDC=m

# CONFIG_FB_BOOT_VESA_SUPPORT is not set

CONFIG_FB_CFB_FILLRECT=y

CONFIG_FB_CFB_COPYAREA=y

CONFIG_FB_CFB_IMAGEBLIT=y

# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set

# CONFIG_FB_SYS_FILLRECT is not set

# CONFIG_FB_SYS_COPYAREA is not set

# CONFIG_FB_SYS_IMAGEBLIT is not set

# CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA is not set

# CONFIG_FB_FOREIGN_ENDIAN is not set

# CONFIG_FB_SYS_FOPS is not set

# CONFIG_FB_SVGALIB is not set

# CONFIG_FB_MACMODES is not set

CONFIG_FB_BACKLIGHT=y

CONFIG_FB_MODE_HELPERS=y

# CONFIG_FB_TILEBLITTING is not set

#

# Frame buffer hardware drivers

#

# CONFIG_FB_CIRRUS is not set

# CONFIG_FB_PM2 is not set

# CONFIG_FB_CYBER2000 is not set

# CONFIG_FB_ARC is not set

# CONFIG_FB_ASILIANT is not set

# CONFIG_FB_IMSTT is not set

# CONFIG_FB_VGA16 is not set

# CONFIG_FB_UVESA is not set

# CONFIG_FB_VESA is not set

CONFIG_FB_EFI=y

# CONFIG_FB_N411 is not set

# CONFIG_FB_HGA is not set

# CONFIG_FB_OPENCORES is not set

# CONFIG_FB_S1D13XXX is not set

# CONFIG_FB_NVIDIA is not set

# CONFIG_FB_RIVA is not set

# CONFIG_FB_I740 is not set

# CONFIG_FB_LE80578 is not set

# CONFIG_FB_MATROX is not set

CONFIG_FB_RADEON=m

CONFIG_FB_RADEON_I2C=y

CONFIG_FB_RADEON_BACKLIGHT=y

# CONFIG_FB_RADEON_DEBUG is not set

# CONFIG_FB_ATY128 is not set

# CONFIG_FB_ATY is not set

# CONFIG_FB_S3 is not set

# CONFIG_FB_SAVAGE is not set

# CONFIG_FB_SIS is not set

# CONFIG_FB_NEOMAGIC is not set

# CONFIG_FB_KYRO is not set

# CONFIG_FB_3DFX is not set

# CONFIG_FB_VOODOO1 is not set

# CONFIG_FB_VT8623 is not set

# CONFIG_FB_TRIDENT is not set

# CONFIG_FB_ARK is not set

# CONFIG_FB_PM3 is not set

# CONFIG_FB_CARMINE is not set

# CONFIG_FB_SMSCUFX is not set

# CONFIG_FB_UDL is not set

# CONFIG_FB_IBM_GXT4500 is not set

# CONFIG_FB_VIRTUAL is not set

# CONFIG_FB_METRONOME is not set

# CONFIG_FB_MB862XX is not set

# CONFIG_FB_BROADSHEET is not set

# CONFIG_FB_AUO_K190X is not set

# CONFIG_FB_SIMPLE is not set

# CONFIG_FB_SM712 is not set

#

# Console display driver support

#

CONFIG_VGA_CONSOLE=y

# CONFIG_VGACON_SOFT_SCROLLBACK is not set

CONFIG_DUMMY_CONSOLE=y

CONFIG_DUMMY_CONSOLE_COLUMNS=80

CONFIG_DUMMY_CONSOLE_ROWS=25

CONFIG_FRAMEBUFFER_CONSOLE=y

# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set

# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set

# CONFIG_FB_CON_DECOR is not set

# CONFIG_LOGO is not set

```

----------

## sebaro

To make it work I had to enable fbdev support for KMS.

These are the kernel options:

```

Graphics support

| [m] ATI Radeon (DRM_RADEON)

|----- [y] Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) (DRM)

|---------- [y] Enable legacy fbdev support for your modesetting driver (DRM_FBDEV_EMULATION)

|----- Frame buffer Devices

|---------- [y] EFI-based Framebuffer Support (FB_EFI)

```

```

[    0.288875] efifb: probing for efifb

[    0.288893] efifb: framebuffer at 0xc0000000, using 5120k, total 5120k

[    0.288900] efifb: mode is 1280x1024x32, linelength=5120, pages=1

[    0.288905] efifb: scrolling: redraw

[    0.288912] efifb: Truecolor: size=8:8:8:8, shift=24:16:8:0

[    0.301478] fb0: EFI VGA frame buffer device

[    1.417872] fb: switching to radeondrmfb from EFI VGA

[    2.759589] [drm] fb mappable at 0xC0722000

[    2.759614] [drm] fb depth is 24

[    2.759939] fbcon: radeondrmfb (fb0) is primary device

[    2.776402] radeon 0000:00:01.0: fb0: radeondrmfb frame buffer device

```

----------

## josephg

 *sebaro wrote:*   

> Enable legacy fbdev support for your modesetting driver (DRM_FBDEV_EMULATION)

 

ah yes, i hit that myself.. a while back  :Embarassed:  got thrown off by the words "legacy" "emulation" etc, and decided i didn't need it. took me a while to figure out  :Rolling Eyes: 

----------

## sebaro

I've marked this topic solved and added the conclusions on first post.

----------

