K-Res

Method to compile 32bit programs on 64bit Linux CentOS 7

The method recorded here theoretically applies to all RedHat‑based Linux distributions!
Normally on 64bit Linux (after installing gcc and related tools), compiled executables target the 64bit environment. If you want to compile for 32bit (which can also run on 64bit systems), just add the -m32 option to gcc (for ld there is a corresponding -melf_i386). Although compiling only requires adding the parameter, you still need to install the 32bit versions of the C and C++ standard libraries.

For example, if you compile directly with -m32, you will get the following error:

[kres@localhost test6432]$ gcc -m32 test.c
In file included from /usr/include/features.h:399:0,
from /usr/include/unistd.h:25,
from /usr/include/usb.h:28,
from test.c:1:
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h:No such file or directory

# include ;
^
compilation terminated.
Continue reading…

Hard‑mod upgrade of Lenovo Y1S router to 64M flash

Since replacing it with the Redmi AX6000 last October, the Y1S that had served for nearly 10 years finally retired and has since been sitting unused in a box…

Until recently, while browsing the Enshan forum, I accidentally saw a post by user 1421890054: 【2022-1-22】折腾一下OpenWrt-Lenovo-newifi-y1s-R22.1.1-mt7620a-USB, and realized that the Y1S can actually support larger flash chips (the original Winbond 25Q128 is only 16M, and after installing OpenWrt there is basically no room for software…). So I dug out the retired Y1S, planning to try a hard‑mod flash upgrade for fun.

Continue reading…

Method to convert PCB footprints from LCSC EasyEDA to KiCad format

Recently I have been learning EDA, using the open source KiCad. Basic operations are simple, but compared to EasyEDA’s web ecosystem, KiCad’s component symbols and footprints are less convenient. Fortunately I found a method to import EasyEDA PCB footprints into KiCad (borrowed from others, haha). Original post: http://www.taodudu.cc/news/show-5505674.html?action=onClick. Recording here:

When using KiCad, sometimes a footprint is missing and needs to be drawn manually. But drawing is troublesome. Instead, you can download directly from EasyEDA.
First log in to the EasyEDA web version: https://pro.lceda.cn/ and enter the standard version.

Continue reading…

Cherry MX2.0S RGB keyboard LED failure episode three

Following the previous two repair records of Cherry MX2.0S RGB LED failures (see earlier notes: Repair log of Cherry MX2.0S RGB keyboard lighting failure after more than 3 years , Cherry MX2.0S RGB keyboard LED failure repair log again), after about two months another group of keys (Ctrl, Shift, =, F11) developed the same fault:

Because I know this keyboard has the bad LED issue, I often subconsciously press keys repeatedly to trigger the lighting effect and check if any LEDs have died.

This time I caught it in the act, witnessing the entire process of this group of LEDs going from ‘normal to failing’:

Continue reading…

Problems encountered when cloning submodules in a GitHub project

GitHub is truly a treasure trove of open source, not only for learning code but also for learning how to use git!

Recently I studied the Off‑the‑Record‑iOS project (https://github.com/chrisballinger/Off-the-Record-iOS) and practiced using git submodules.

This project has a Submodules folder containing other open source projects it depends on. At first I did not notice, and just downloaded the ZIP. In XCode many file names showed up in red, revealing missing dependencies. There were quite a few, so I abandoned manual downloading.

Searching, I found issue #87 where someone asked the same question: https://github.com/chrisballinger/Off-the-Record-iOS/issues/87. Following the answer, I cloned the project with git and ran git submodule init && git submodule update (for git 1.6 and later you can use git clone –recursive). Updating worked for the first few submodules, but then a new error appeared:

Submodule path ‘Submodules/DAKeyboardControl’: checked out ‘5352d1ff2d1131d974d94406ed8fcf8eb068aa72’
Cloning into ‘Submodules/LibOrange’…
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Clone of ‘git@github.com:ChatSecure/LibOrange.git’ into submodule path ‘Submodules/LibOrange’ failed

Continue reading…

Windows symbolic link (shortcut) follow behavior in network shares

This issue appeared during the following operation. First, a PowerShell script was used to create a symbolic link:

New-Item -ItemType SymbolicLink -Path d:\share_folder\ -Name latest -Target d:\share_folder\v1000 -Force

This command creates a shortcut named ‘latest’ inside d:\share_folder, pointing to the sibling folder v1000. Then share_folder was shared over the network. When accessing \\xxx.xxx.xxx.xxx\share_folder\latest from another machine, the error appeared: ‘Cannot follow symbolic link because its type is disabled’. Searching online revealed the reason, for example: https://www.zywvvd.com/notes/system/windows/symlink-disabled/symlink-disabled/

By default, Windows only allows symbolic link following locally. Remote‑to‑local (a shortcut inside a share pointing to a local path) and remote‑to‑remote (a shortcut inside a share pointing to another share path) are disabled. Following the solution, running: fsutil behavior set SymlinkEvaluation R2L:1 enables remote‑to‑local following. But then accessing the link produced ‘target folder does not exist’.

Continue reading…

One possible cause of the ‘Cannot mix incompatible Qt library with this library’ error

The complete error message looks like this:

Output in the debug console:

QtTest.exe (15068): Loaded 'D:\Qt\6.8.3\msvc2022_64\plugins\styles\qmodernwindowsstyled.dll'. Symbols loaded.
Cannot mix incompatible Qt library (6.8.3) with this library (6.8.0)
Debug Error!

Program: D:\Qt\6.8.3\msvc2022_64\bin\Qt6Cored.dll
Module: 6.8.0
File: C:/Users/qt/work/qt/qtbase/src/corelib/kernel/qobject_p.h
Line: 233

Cannot mix incompatible Qt library (6.8.3) with this library (6.8.0)

(Press Retry to debug the application)

This error occurred in a simple test program using QOpenGLWidget. The message clearly indicates that different versions of Qt libraries were mixed. Searching online shows many similar cases, usually caused by overlapping Qt DLL versions in the system PATH, because Qt loads many dynamic libraries as plugins. But after checking repeatedly, I confirmed that my environment did not have this issue. I only had one Qt installation, the prebuilt 6.8.3 version installed via Qt Maintenance Tool under D:\Qt\6.8.3. If I ignored the error, the program still ran correctly, but the popup was annoying, so I needed to investigate.

Continue reading…

A deeper look into the issue of PS2 failing to recognize certain PS1 memory cards

After installing the 816HD mod chip on my long‑unused PS2, the console essentially reached the 230 BIOS 9W perfect state. PS1 games were also fully supported (so far I have not seen any functional impact from the two‑reset behavior). Naturally, when replaying classic PS1 titles, saving is essential, so I dug out my PS1 memory card that had been stored for 15 years (I used it back in arcade shops):
IMG_0744
When I inserted it into the PS2, the browser could not recognize it. Searching online, I found many forum discussions about this issue. In short, PS2 has poor compatibility with PS1 memory cards, especially assembled or off‑brand cards (mine is clearly a cheap clone using the so‑called ‘cow dung’ chip). Some users even reported the opposite: clone cards work but original Sony cards do not. Others mentioned that Sony’s PocketStation, which has an LCD screen, works 100% reliably. I also saw sellers on Taobao offering PS1 original cards claiming full PS2 compatibility.

Just when I was about to buy an original PS1 card, I discovered something surprising: although my old clone card could not be recognized in the PS2 memory card management screen, once I booted into a PS1 game, the card was recognized. It showed messages like ‘memory card full’ or ‘no usable save data’. This suggested the card was not broken, but simply suffering from a compatibility issue.

Later, while playing a Chinese‑translated Japanese version of Resident Evil 3, I found an old save file on the card. Loading worked normally, and saving (overwriting) also worked. So the card functions perfectly during PS1 mode on the PS2, even though the PS2’s memory card manager (and tools like uLaunchElf) cannot detect it.

Continue reading…