fishBlog

专注嵌入式开发

首页 文章 归档
目录
2026-09-06
Linux►Drivers

FBCon、VT 文本渲染与启动 Logo

FBCon、VT 文本渲染与启动 Logo

1. 位置

fbcon源码位于drivers/video/fbdev/core/,只有CONFIG_FRAMEBUFFER_CONSOLE=y时链接进fb.o。

drivers/video/console/中的dummycon/vgacon等是其它VT console后端。

2. 调用关系

1
2
3
4
5
6
printk/TTY/VT
-> consw callbacks
-> fbcon
-> bitblit/tileblit
-> fb_ops fillrect/copyarea/imageblit/cursor
-> framebuffer

3. 绑定

fbcon注册后可在framebuffer出现时接管VT;fbcon=map:可指定VT到fb映射。VT_HW_CONSOLE_BINDING支持在console drivers间切换。

4. 字符渲染

bitblit根据font bitmap、前景/背景色和字符属性生成imageblit。滚屏可:

  • copyarea移动像素;
  • pan/wrap调整显示起点;
  • redraw整屏。

选择取决于fb能力和配置。

5. Cursor

softcursor.c可软件反色/绘制光标;硬件fb_cursor由驱动提供。Cursor timer和VT切换需与console lock同步。

6. 旋转

可选0/90/180/270度转换,代码分布在fbcon_rotate/cw/ccw/ud。旋转增加CPU和内存带宽成本。

7. Blank

VT blank最终触发fb blank和可能的backlight/DPMS。解除blank需恢复mode、palette和console内容。

8. Logo

logo.c根据架构和颜色深度选择mono/VGA16/CLUT224 logo,在fbcon准备阶段绘制。

pnmtologo是构建host工具,将PBM/PPM转换为内核数据。

9. 启动时序

1
2
3
4
5
6
early console
-> framebuffer/DRM driver probe
-> register fb_info
-> fbcon attach
-> takeover VT
-> optional logo

过早移除firmware framebuffer会使console短暂黑屏,aperture handoff需协调。

10. 并发

fbcon运行于console/TTY路径,可能在panic或atomic上下文附近被调用。Driver drawing回调不能随意睡眠;慢速framebuffer常使用deferred I/O和专门约束。

11. RK3588

Rockchip vendor defconfig未显式列出CONFIG_FB/FRAMEBUFFER_CONSOLE,最终值受Kconfig和产品fragment影响。Android产品常不依赖fbcon,Linux控制台产品可能通过DRM fbdev emulation获得fbcon。

12. 调试

  • kernel cmdline console=、fbcon=;
  • /proc/consoles;
  • /sys/class/vtconsole/;
  • /proc/fb;
  • DRM/fb probe顺序;
  • 检查是否被nomodeset影响。
Share
  • Kernel
  • Linux
上一篇
FBDev 用户接口、IOCTL、MMap 与 Sysfs
下一篇
显示模式、EDID 与 Device Tree Timing

文章互动

阅读 --

留言

0 条留言

正在加载留言…

Categories

  • AI17
    • GGML3
    • LLaMA-Factory4
    • LlamaIndex4
    • llama.cpp4
    • 全栈1
    • 总览1
  • Ceph34
    • BlueStore5
    • CRUSH1
    • Crimson8
    • IO1
    • MDS1
    • OSD8
    • SPDK7
    • librbd1
    • 总览2
  • Linux433
    • Drivers273
    • FS46
    • IPC10
    • Init11
    • Kernel22
    • MM15
    • Net13
    • Sound22
    • Virt9
    • io_uring11
    • 总览1
  • ROS2113
    • Fast-DDS2
    • Perception5
    • ROS8
    • Tooling2
    • Visualization19
    • iceoryx11
    • osrf1
    • 总览9
    • 核心56
  • SLAM10
    • slam_toolbox10
  • Zephyr8
  • 工业协议48
    • CANopen14
    • EtherCAT8
    • MQTT16
    • Modbus10
  • 算法14
    • OpenCV7
    • YOLO7

Tags

  • AI17
  • BlueStore5
  • CANopen14
  • CRUSH1
  • Ceph34
  • Crimson8
  • EtherCAT8
  • Fast-DDS2
  • GGML3
  • Humble113
  • IO1
  • Kernel433
  • LLaMA-Factory4
  • Linux433
  • LlamaIndex4
  • MDS1
  • MQTT16
  • Modbus10
  • OSD8
  • OpenCV7
  • Perception5
  • ROS8
  • ROS2117
  • RTOS8
  • SLAM10
  • SPDK7
  • Tooling2
  • Visualization19
  • YOLO7
  • Zephyr8
  • iceoryx11
  • librbd1
  • llama.cpp4
  • osrf1
  • rcl56
  • rmw56
  • rqt19
  • slam_toolbox10
  • 全栈1
  • 工业协议48
  • 总览3
  • 算法14

Tag Cloud

AI BlueStore CANopen CRUSH Ceph Crimson EtherCAT Fast-DDS GGML Humble IO Kernel LLaMA-Factory Linux LlamaIndex MDS MQTT Modbus OSD OpenCV Perception ROS ROS2 RTOS SLAM SPDK Tooling Visualization YOLO Zephyr iceoryx librbd llama.cpp osrf rcl rmw rqt slam_toolbox 全栈 工业协议 总览 算法

Archives

  • September 2026677

Recent Posts

  • OpenCV 4.13.0 源码文件索引与导航
  • YOLOv5 7.0:源码文件索引
  • OpenCV 4.13.0 配置、构建与使用指南
  • YOLOv5 7.0:配置与使用
  • OpenCV 4.13.0 HAL 与性能优化
全站阅读 访客
QQ群:1078463731chenpan459@foxmail.com
© 2026 fish
首页 文章 归档