1 ======================= 2 The Framebuffer Console 3 ======================= 4 5 The framebuffer console (fbcon), as its name i 6 console running on top of the framebuffer devi 7 any standard text console driver, such as the 8 features that can be attributed to the graphic 9 10 In the x86 architecture, the framebuffer conso 11 some even treat it as a toy. For other archite 12 display device, text or graphical. 13 14 What are the features of fbcon? The framebuff 15 high resolutions, varying font types, display 16 etc. Theoretically, multi-colored fonts, blend 17 made available by the underlying graphics card 18 19 A. Configuration 20 ================ 21 22 The framebuffer console can be enabled by usin 23 configuration tool. It is under Device Driver 24 Console display driver support->Framebuffer Co 25 Select 'y' to compile support statically or 'm 26 module will be fbcon. 27 28 In order for fbcon to activate, at least one f 29 required, so choose from any of the numerous d 30 systems, they almost universally have VGA card 31 always be available. However, using a chipset- 32 more speed and features, such as the ability t 33 dynamically. 34 35 To display the penguin logo, choose any logo a 36 support->Bootup logo. 37 38 Also, you will need to select at least one com 39 you don't do anything, the kernel configuratio 40 usually an 8x16 font. 41 42 GOTCHA: A common bug report is enabling the fr 43 framebuffer console. Depending on the driver, 44 garbled display, but the system still boots to 45 fortunate to have a driver that does not alter 46 will still get a VGA console. 47 48 B. Loading 49 ========== 50 51 Possible scenarios: 52 53 1. Driver and fbcon are compiled statically 54 55 Usually, fbcon will automatically tak 56 exception is vesafb. It needs to be 57 vga= boot option parameter. 58 59 2. Driver is compiled statically, fbcon is com 60 61 Depending on the driver, you either g 62 garbled display, as mentioned above. 63 do a 'modprobe fbcon'. 64 65 3. Driver is compiled as a module, fbcon is co 66 67 You get your standard console. Once 68 'modprobe xxxfb', fbcon automatically 69 the possible exception of using the f 70 71 4. Driver and fbcon are compiled as a module. 72 73 You can load them in any order. Once 74 over the console. 75 76 C. Boot options 77 78 The framebuffer console has several, 79 that can change its behavior. 80 81 1. fbcon=font:<name> 82 83 Select the initial font to use. The va 84 compiled-in fonts: 10x18, 6x10, 6x8, 7 85 PEARL8x8, ProFont6x11, SUN12x22, SUN8x 86 87 Note, not all drivers can handle font 88 such as vga16fb. 89 90 91 2. fbcon=map:<0123> 92 93 This is an interesting option. It tell 94 which console. The value '0123' is a s 95 the total length is 64 which is the nu 96 the above example, it is expanded to 0 97 will be:: 98 99 tty | 1 2 3 4 5 6 7 8 9 ... 100 fb | 0 1 2 3 0 1 2 3 0 ... 101 102 ('cat /proc/fb' should tell yo 103 104 One side effect that may be useful is 105 the number of loaded fb drivers. For e 106 available, fb0, adding fbcon=map:1 tel 107 console. 108 109 Later on, when you want to map the con 110 device, you can use the con2fbmap util 111 112 3. fbcon=vc:<n1>-<n2> 113 114 This option tells fbcon to take over o 115 specified by the values 'n1' and 'n2'. 116 outside the given range will still be 117 console driver. 118 119 NOTE: For x86 machines, the standard c 120 is typically located on the same video 121 are controlled by the VGA console will 122 123 4. fbcon=rotate:<n> 124 125 This option changes the orientation an 126 value 'n' accepts the following: 127 128 - 0 - normal orientation (0 degree 129 - 1 - clockwise orientation (90 de 130 - 2 - upside down orientation (180 131 - 3 - counterclockwise orientation 132 133 The angle can be changed anytime after 134 numbers to any one of the 2 attributes 135 /sys/class/graphics/fbcon: 136 137 - rotate - rotate the disp 138 - rotate_all - rotate the disp 139 140 Console rotation will only become avai 141 Rotation support is compiled in your k 142 143 NOTE: This is purely console rotation. 144 use the framebuffer will remain at the 145 Actually, the underlying fb driver is 146 rotation. 147 148 5. fbcon=margin:<color> 149 150 This option specifies the color of the 151 leftover area at the right and the bot 152 used by text. By default, this area wi 153 is an integer number that depends on t 154 155 6. fbcon=nodefer 156 157 If the kernel is compiled with deferre 158 the framebuffer contents, left in plac 159 be preserved until there actually is s 160 This option causes fbcon to bind immed 161 162 7. fbcon=logo-pos:<location> 163 164 The only possible 'location' is 'cente 165 given, the bootup logo is moved from t 166 location to the center of the framebuf 167 displayed due to multiple CPUs, the co 168 as a whole. 169 170 8. fbcon=logo-count:<n> 171 172 The value 'n' overrides the number of 173 logo, and -1 gives the default which i 174 175 C. Attaching, Detaching and Unloading 176 177 Before going on to how to attach, detach and u 178 illustration of the dependencies may help. 179 180 The console layer, as with most subsystems, ne 181 the hardware. Thus, in a VGA console:: 182 183 console ---> VGA driver ---> hardware. 184 185 Assuming the VGA driver can be unloaded, one m 186 from the console layer before unloading the dr 187 unloaded if it is still bound to the console l 188 Documentation/driver-api/console.rst for more 189 190 This is more complicated in the case of the fr 191 because fbcon is an intermediate layer between 192 193 console ---> fbcon ---> fbdev drivers 194 195 The fbdev drivers cannot be unloaded if bound 196 be unloaded if it's bound to the console layer 197 198 So to unload the fbdev drivers, one must first 199 then unbind the fbdev drivers from fbcon. For 200 the console layer will automatically unbind fr 201 fbcon. Thus, there is no need to explicitly un 202 fbcon. 203 204 So, how do we unbind fbcon from the console? P 205 Documentation/driver-api/console.rst. To summa 206 207 Echo a value to the bind file that represents 208 driver. So assuming vtcon1 represents fbcon, t 209 210 echo 1 > /sys/class/vtconsole/vtcon1/bind - 211 c 212 echo 0 > /sys/class/vtconsole/vtcon1/bind - 213 c 214 215 If fbcon is detached from the console layer, y 216 usually VGA text mode) will take over. A few 217 restore VGA text mode for you. With the rest, 218 must take a few additional steps to make sure 219 restored properly. The following is one of the 220 221 1. Download or install vbetool. This utility 222 distributions nowadays, and is usually part 223 224 2. In your kernel configuration, ensure that C 225 to 'y' or 'm'. Enable one or more of your f 226 227 3. Boot into text mode and as root run:: 228 229 vbetool vbestate save > <vga state fil 230 231 The above command saves the register conten 232 hardware to <vga state file>. You need to 233 the state file can be reused. 234 235 4. If fbcon is compiled as a module, load fbco 236 237 modprobe fbcon 238 239 5. Now to detach fbcon:: 240 241 vbetool vbestate restore < <vga state f 242 echo 0 > /sys/class/vtconsole/vtcon1/bi 243 244 6. That's it, you're back to VGA mode. And if 245 you can unload it by 'rmmod fbcon'. 246 247 7. To reattach fbcon:: 248 249 echo 1 > /sys/class/vtconsole/vtcon1/bi 250 251 8. Once fbcon is unbound, all drivers register 252 become unbound. This means that fbcon and ind 253 can be unloaded or reloaded at will. Reloading 254 automatically bind the console, fbcon and the 255 all the drivers without unloading fbcon will m 256 console to bind fbcon. 257 258 Notes for vesafb users: 259 ======================= 260 261 Unfortunately, if your bootline includes a vga 262 hardware in graphics mode, such as when loadin 263 Instead, vgacon will replace the default boot 264 won't get any display after detaching fbcon. Y 265 you can reattach vesafb. However, to reattach 266 the following: 267 268 Variation 1: 269 270 a. Before detaching fbcon, do:: 271 272 vbetool vbemode save > <vesa state fil 273 274 275 b. Detach fbcon as in step 5. 276 277 c. Attach fbcon:: 278 279 vbetool vbestate restore < <vesa state 280 echo 1 > /sys/class/vtconsole/vtcon1/b 281 282 Variation 2: 283 284 a. Before detaching fbcon, do:: 285 286 echo <ID> > /sys/class/tty/console/bin 287 288 vbetool vbemode get 289 290 b. Take note of the mode number 291 292 b. Detach fbcon as in step 5. 293 294 c. Attach fbcon:: 295 296 vbetool vbemode set <mode number> && \ 297 echo 1 > /sys/class/vtconsole/vtcon1/b 298 299 Samples: 300 ======== 301 302 Here are 2 sample bash scripts that you can us 303 framebuffer console driver if you are on an X8 304 305 #!/bin/bash 306 # Unbind fbcon 307 308 # Change this to where your actual vgastate 309 # Or Use VGASTATE=$1 to indicate the state f 310 VGASTATE=/tmp/vgastate 311 312 # path to vbetool 313 VBETOOL=/usr/local/bin 314 315 316 for (( i = 0; i < 16; i++)) 317 do 318 if test -x /sys/class/vtconsole/vtcon$i; t 319 if [ `cat /sys/class/vtconsole/vtcon$i 320 = 1 ]; then 321 if test -x $VBETOOL/vbetool; then 322 echo Unbinding vtcon$i 323 $VBETOOL/vbetool vbestate resto 324 echo 0 > /sys/class/vtconsole/v 325 fi 326 fi 327 fi 328 done 329 330 ---------------------------------------------- 331 332 :: 333 334 #!/bin/bash 335 # Bind fbcon 336 337 for (( i = 0; i < 16; i++)) 338 do 339 if test -x /sys/class/vtconsole/vtcon$i; t 340 if [ `cat /sys/class/vtconsole/vtcon$i 341 = 1 ]; then 342 echo Unbinding vtcon$i 343 echo 1 > /sys/class/vtconsole/vtcon$ 344 fi 345 fi 346 done 347 348 Antonino Daplas <adaplas@pol.net>
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.