Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Weekend Project:Building a Raspberry Pi Zero Laptop from a Cardboard Box (satoshinm.github.io)
6 points by satoshinm on Nov 14, 2017 | hide | past | web | favorite | 1 comment

Updated this blog post just now, I found out how to effectively mirror the Linux console to the OLED module:

The basic technique is to run /usr/bin/screendump to capture the Linux console text, then write it to the SSD1325 module over SPI. However, the problem I ran into was this small 2.7" 128x64 display can only fit at most 9 rows and 31 columns of text, much smaller than any normal video mode (like the fabled 25x80 standard).

This could be solved by reimplementing a terminal emulator, of course, but an easier solution is to restrict the size of the console. On Linux, this can be accomplished using `stty rows 9` and `stty cols 31`. These commands cannot increase the size, but can decrease the console viewport beneath the maximum supported by the current font and graphics resolution. So now I can use my USB keyboard to interact with the real Linux console, and have it displayed properly on the OLED display, even working as you would expect with full-screen terminal programs such as vi.

If anyone is interested updated script (with screenshots) is available at: https://github.com/satoshinm/oledterm

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact