Hello!
I need to disable the blinking cursor in the text console from my C program to work directly with the framebuffer.
I'm using this code:
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/kd.h>
#include <unistd.h>
#include <stdio.h>
//...
char *tty_n;
int console_fd;
if ((tty_n = ttyname(0)) == NULL){
fprintf(stderr,"ttyname() error.\n");
exit(1);
}
console_fd = open(tty_n, O_RDWR);
if (!console_fd) {
fprintf(stderr,"Could not open console.\n");
exit(1);
}
if (ioctl( console_fd, KDSETMODE, KD_GRAPHICS))
{
fprintf(stderr,"Could not set console to KD_GRAPHICS mode.\n");
exit(1);
}
close(console_fd);
//...
It works on Tiny Core with TC.tcz installed, but does not work on minimal piCore. The error is returned by ioctl( console_fd, KDSETMODE, KD_GRAPHICS).
Installing TC.tcz increases the loading time, which I would like to avoid and I do not need graphical desctop. But I don’t have enough knowledge of which component is missing for the code to work and whether it can be installed separately from TC.tcz.
Perhaps there is some other way to solve this problem?
OS version piCore 13, board - Raspberry Pi Zero W.