RO1 : No software cursor displayed on fbcon

Has anyone figured out how to get the fbcon software cursor to display when logging in without starting X?

Ideally, it should display when apps like nano, vim, or emacs are launched and once they are closed. ANy kind of editing from the console is pretty much impossible until this is sorted.

R

you’re looking for “gpm”

I should clarify that I’m not referring to the mouse cursor but to the console mode command line cursor, often referred to these days as the insertion point.

1 Like

you’re looking for fbcon "no cursor" - Google Search :sweat_smile:

it might need a kernel recompile if it’s a hardware graphics issue…

I have not worked this out yet, and it also affects gpm (which does not work by default on my R01, although I’ve updated my keyboard firmware, which may have affected the device tree for the mouse… I’ve tried to get it working by modifying the config). Without a cursor, there’s no “pointer” for gpm or related tools to move around the console.

I don’t see any cursor-related options in the kernel config file that’s in /boot, and simply changing /sys/class/graphics/fbcon/cursor_blink to 1 doesn’t seem to have an effect for me.

I had a quick skim through some of the resources that show up on a Google search, and I’ve seen a (unvalidated) comment that Allwinner SoC doesn’t have hardware cursor, I’m not able to confirm that. I’ve also tried a few other things to no avail so far. Will keep researching…

2 Likes

Thanks @andypiper for digging into this. Its nearly impossible to do anything useful without X if the console can’t show a cursor. It would be really nice to have even a non-blinking cursor. Its really weird counting keystrokes to guess where the cursor now is. :smiley:

1 Like

I think my next step, which may take a while, is to try to follow the Debian installation notes and even do a kernel compile, so I can take more of a look at what options are available. It’s a bit frustrating that the kernel is ~2-3 years old, it would be great to have up-to-date sources to build from.

Wondering whether the Clockwork Pi staff folks have any ability to help, beyond the existing wiki information they shared?

2 Likes

I have no problem with an old kernel so long as it works. Unless there is a missing command line switch or some other trick to turn on the cursor in console mode it doesn’t work. So maybe a fresher kernel will have that fixed.

1 Like

Indeed, lack of blinking cursor, or more any cursor somewhat tripped me up first and is quite annoying. I suspect this is because the code that runs the console, drivers/video/fbdev/subxi new. It’s not in mainline OR android (eg drivers/video/fbdev - kernel/common - Git at Google OR linux/drivers/video/fbdev at master · smaeul/linux · GitHub - which is seems to be the point in the tree that they forked to make the d1 sdk OR smaeul’s tree thats looking at d1 support for mainline). The issue is that smaeul is targetting the Nezha board which is similar but different to our r01 board. The actual fb code seems to be in the sdk mirror that ccu made with the added r01 patches: last_linux-5.4/drivers/video/fbdev/sunxi at master · cuu/last_linux-5.4 · GitHub. So compiling your own newer kernel will involve probably taking smaeul’s tree as a start fro d1, understanding whats missing given smaeul says don’t merge , adding in the r01 patches (DevTerm/Code/patch/d1 at main · clockworkpi/DevTerm · GitHub), which are mostly small fixes, but does include the backlight driver, which is not in mainline and adding the sunxi fbdev, which is large:

thomas ~/devterm/last_linux-5.4/drivers/video/fbdev/sunxi (master u=)$ cloc .
     655 text files.
     641 unique files.                                          
      16 files ignored.

github.com/AlDanial/cloc v 1.92  T=1.30 s (492.6 files/s, 349080.2 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
C                              286          25993          18031         257268
C/C++ Header                   339           6121          12997         133352
make                            16             88             37            332
-------------------------------------------------------------------------------
SUM:                           641          32202          31065         390952
-------------------------------------------------------------------------------

So all in all getting a “new” linux is quite a task. Googling the config for it CONFIG_FB_CONSOLE_SUNXI shows not many hits, however there is a pine64 reference, so there is hope someone will pick that up. Looking at the actual code shows that this is not new, and some files date back more than 5 years ago. We seem to have the CONFIG_LCD_SUPPORT_TFT08006 set, so inside that: drivers/video/fbdev/sunxi/disp2/disp/lcd. Really it should Allwinner pushing this into mainline.

2 Likes

Unfortunately Allwinner is rather slothful at getting docs and drivers out to the Linux community. By the time they get the D1 fully supported they will likely have moved two generations from the D1 into whatever they call the future SOC. I don’t think the R8 would be as well supported if it weren’t for the efforts of NTC’s folk in producing the CHIP. And last I looked that was the best supported SOC Allwinner makes.

Thanks for the links I was looking to download kernel source last night… and ran out of time hunting for them.

I’ve found one way to get a cursor from the console. Try this from the shell, while in console mode:

printf '\033[?24;64c'

On my R-01 it gives me a full cell green block cursor. That’s not what its supposed to do. Its supposed to be red. Trying variations I get some really weird results. So I’m still trying to figure out what’s going on. I found this escape sequence here:

But this is helpful! I can now use editors and edit the command line!

1 Like

For me the cursor disappears when I run nano or vim so not a complete solution from what I can tell. Good progress though.

Hah! joe wins again! It keeps the cursor. Yes, this solution is the digital equivalent of bubble gum & bailing wire. I imagine anything that resets the terminal will turn the cursor off. It might help to wrap this into a script that is easily called. I also added it to my .bash_profile.

A real solution will likely require a patch to the kernel. I ran into that page I linked to while trying to figure out what /sys/class/graphics/fb0/cursor does. Writing to it likes to hang the shell on either the DevTerm or my x86 laptop. I finally found something that described it as the X,Y of the cursor… So I’m assuming that has to do with position and not whether or not its turned on. I still need to find the kernel source.

WARN: Anyone brave enough to try out joe should be aware it defaults to mostly WordStar (WS) keystrokes. It does have other emulations. Check the man page. Since the first commercial screen oriented text editor I acquired was WordStar on CP/M-80 it works for me. :wink: Well that and the long association with Borland language tools… which also used keystrokes similar to WS.

It is amazing. A cursor has appeared! :smiley:

1 Like
printf '\033[?24;64c'

I am editing with ed because the cursor disappears in vi. :smiley:

Ow! Try Joe. For those not familiar with the WordStar keys you can install the joe package and call either jpico for Pine’s PICO emulation or jmacs for emacs emulation.

Anyhow it leaves the cursor on, on my R-01.

Thanks, I try this.

You can just apt-get install joe. :slight_smile:

1 Like