hacks.moe

GitHub | Gitlab | Feed | Privacy Policy | Contact & Impressum

Jelly Comb WGJP-012 on Debian 10

To use the cheapo USB touchpad branded as Jelly Comb WGJP-012 on Debian 10 Buster, you might have to do a bit of tweaking.

  1. Make sure you have xserver-xorg-input-libinput, xserver-xorg-input-evdev and server-xorg-input-mouse installed.

  2. Make sure you do not have xserver-xorg-libinput-synaptics installed.

  3. Create a file /etc/X11/xorg.conf.d/40-libinput.conf with the following contents.

    Section "InputClass"
        Identifier "libinput touchpad catchall"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
        Option "Tapping" "on"
    EndSection
    

After a reboot, you should be able to left-click (single tap), right-click (tap with two fingers) and scroll (swipe with two fingers.)

(Infos taken from the Debian Wiki, but shortened for the Jelly Comb touchpad.)

Compiling aarch64 Binaries for gem5 SE Mode

Update April 2019: As of this commit, aarch64 Linux binaries should work as-is in SE mode, even if compiled with glibc. Thank you Ciro for letting me know and thanks to the gem5 developers in general :)

The gem5 simulator has a useful system call emulation mode that lets you run programs without a Linux kernel. The system calls issued by your program are handled by gem5.

Unfortunately, using regular GCC with glibc creates programs that gem5 does not fully support.

~/gem5dir $ aarch64-unknown-linux-gnu-gcc -static hello.c -o hello
~/gem5dir $ build/ARM/gem5.opt configs/example/se.py -c hello
gem5 Simulator System.  http://gem5.org
gem5 is copyrighted software; use the --copyright option for details.

gem5 compiled Sep  8 2018 15:18:08
gem5 started Sep  9 2018 10:45:17
gem5 executing on faui00h, pid 12059
command line: build/ARM/gem5.opt configs/example/se.py -c hello

/proj/ciptmp/ru64tiji/BA/Git/gem5/configs/common/CacheConfig.py:48: \
    SyntaxWarning: import * only allowed at module level
def config_cache(options, system):
Global frequency set at 1000000000000 ticks per second
warn: DRAM device capacity (8192 Mbytes) does not match the address \
    range assigned (512 Mbytes)
0: system.remote_gdb: listening for remote gdb on port 7000
**** REAL SIMULATION ****
info: Entering event queue @ 0.  Starting simulation...
panic: Attempted to execute unimplemented instruction 'mrs' \
    (inst 0x4d5380001)
Memory Usage: 639976 KBytes
Program aborted at tick 266500

The main culprit is the following error.

panic: Attempted to execute unimplemented instruction 'mrs'

To get a working program, you can use an embedded C library that does not use the advanced features glibc uses. I've had success with uClibc.

Using uClibc does require you to build your own tool chain including compiler, but it's all automated and explained well at www.uclibc.org/about.html. Essentially, you're going to do the following:

  1. Download buildroot.
  2. Run make menuconfig.
  3. Set (1) Target Architecture to AArch64 (little endian) and (2) Build options > libraries to static only. If you want C++ support or some other features, there are flags to configure that as well. It's probably a good idea to go through all options, there aren't that many.
  4. Save your config, exit the menu and run make.

After compilation, the directory /output/host/bin contains your just built compilers and binutils for aarch64. Let's try them out!

~/gem5dir $ aarch64-buildroot-linux-uclibc-gcc -static hello.c -o hello
~/gem5dir $ build/ARM/gem5.opt configs/example/se.py -c hello
gem5 Simulator System.  http://gem5.org
gem5 is copyrighted software; use the --copyright option for details.

gem5 compiled Sep  8 2018 15:18:08
gem5 started Sep  9 2018 10:58:26
gem5 executing on faui00h, pid 13513
command line: build/ARM/gem5.opt configs/example/se.py -c hello

/proj/ciptmp/ru64tiji/BA/Git/gem5/configs/common/CacheConfig.py:48: \
    SyntaxWarning: import * only allowed at module level
def config_cache(options, system):
Global frequency set at 1000000000000 ticks per second
warn: DRAM device capacity (8192 Mbytes) does not match the address \
    range assigned (512 Mbytes)
warn: Unknown operating system; assuming Linux.
0: system.remote_gdb: listening for remote gdb on port 7000
**** REAL SIMULATION ****
info: Entering event queue @ 0.  Starting simulation...
Hello, ARM!
Exiting @ tick 589000 because exiting with last active thread context

Success!