(诛仙剑C-SKY)4-FrameBuffer

本文介绍如何在GX6605S开发板上配置HDMI接口并进行帧缓冲(FB)编程,同时提供开启SWAP以解决内存不足问题的方法。文章包括修改inittab、使用特定的buildroot配置、以及如何在Linux内核中启用SWAP的详细步骤。

作者:cp
时间:2019-05-12
申明:本文一些素材取自网络,归原作者所有

写在前面

开发板提供了HDMI接口,一定要试试FB

1.环境

参见第一节“4.串口+HDMI”,

  1. 使用csky_610_gx6605sfb_4.9_uclibc_br_defconfig
  2. 进入根文件系统后修改/etc/inittab
# Put a getty on the serial port
- tty0::respawn:/sbin/getty -L  tty0 0 vt100 # GENERIC_SERIAL
+ ttyS0::respawn:/sbin/getty -L  ttyS0 0 vt100 # GENERIC_SERIAL

PS:禁止printk,隐藏光标echo -e "\033[?25l" > /dev/tty0

2.FB编程

  • /dev/fb0
//程序见参考[2][3]

3.SWAP

使用UI时考虑到内存不足可以开启swap,但是buildroot中的Linux内核默认没有开启,按照**参考[4]**的做法:

  1. 打开buildroot/board/nationalchip/gx66xx/gx66xx.config, 查找CONFIG_SWAP, 找到# CONFIG_SWAP is not set, 修改为CONFIG_SWAP=y并保存
  2. 打开buildroot/output/build/linux-4.9.56/.config, 查找CONFIG_SWAP, 找到# CONFIG_SWAP is not set, 修改为CONFIG_SWAP=y并保存
  3. make csky_gx6605s_fbcon_br_defconfig & make

如果想配置为开机自动挂载,可以如下设置:

  1. 打开/etc/fstab添加/swapfile swap swap defaults 0 0
  2. 打开/etc/inittab::sysinit:/bin/mount -a之前添加::sysinit:/sbin/swapon -a

参考

[1]https://c-sky.github.io/docs/gx6605s.html
[2]https://github.com/friendlyarm/matrix/blob/master/demo/matrix-fbtft/Matrix-fbtft.c
[3]https://github.com/c-sky/linux-sdk-examples/tree/master/fb
[4]https://github.com/c-sky/forum/issues/78
[5]https://www.linuxquestions.org/questions/linux-general-1/2-6-3-swapon-function-not-implemented-155442/
[6]https://bbs.sipeed.com/t/tutorial-setup-swap-file-for-zero/56

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值