Skip to content

Instantly share code, notes, and snippets.

View olegslavkin's full-sized avatar

Slavkin Oleg olegslavkin

  • Russia, Moscow
View GitHub Profile
gcc -O3 -S test.cc -o-
@olegslavkin
olegslavkin / extract START and ENTRY from Linux Kernel.md
Last active June 29, 2019 15:28
Extract information about START and ENTRY point from Linux Kernel
START=`${CROSS_COMPILE}objdump -h vmlinux |awk '$2 == ".text" {print $4;}'`
ENTRY=`${CROSS_COMPILE}objdump -f vmlinux |awk '/start/ {print $3;}'`
echo $START
echo $ENTRY
@olegslavkin
olegslavkin / 50-mtrack.conf
Created June 24, 2019 10:59
Macbook air /usr/share/X11/xorg.conf.d/50-mtrack.conf
# Install mtrack driver 0.5.0++
# Save this file to /usr/share/X11/xorg.conf.d/50-mtrack.conf
# This config is specialized for MacBook Air 2012 (5,2)
Section "InputClass"
MatchIsTouchpad "on"
Identifier "Touchpads"
MatchDevicePath "/dev/input/event*"
Driver "mtrack"
# The faster you move, the more distance pointer will travel, using "polynomial" profile
Option "AccelerationProfile" "2"
@olegslavkin
olegslavkin / gist:3c77efdf72b48f185e00874c6aaadf3b
Created June 20, 2019 09:33
Ubuntu NAT for usb-lan to WiFi
sudo iptables -t nat -A POSTROUTING -o wlp8s0 -j MASQUERADE
sudo iptables -A FORWARD -i enx00e0600014f9 -o wlp8s0 -j ACCEPT
sudo iptables -A FORWARD -i wlp8s0 -o enx00e0600014f9 -j ACCEPT
@olegslavkin
olegslavkin / LFE5UM5G-45F-VERSA-EVN.md
Last active June 2, 2023 03:44
Lattice ECP5-5G Versa Development Kit

Первое включение.

Поведение индикаторов devboard

  • При первом включение горят постоянно светодиоды: D20, D9, D11, D12, D31 (green), D13 (blue)
  • Светодиоды D21 - D29 включаются по-переменно.
  • 14-ти сегментный дисплей по-переменно включаются все сегменты, включая точку справа.

Сообщения в Linux

$ dmesg
...

Подключенный к USB порту телефон (на зараядке)

[40398.092815] usb 1-2: new high-speed USB device number 6 using xhci_hcd
[40398.243708] usb 1-2: New USB device found, idVendor=0e8d, idProduct=2000, bcdDevice= 1.00
[40398.243713] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[40398.243717] usb 1-2: Product: MT65xx Preloader
[40398.243720] usb 1-2: Manufacturer: MediaTek
[40398.875673] cdc_acm 1-2:1.0: Zero length descriptor references
[40398.875680] cdc_acm: probe of 1-2:1.0 failed with error -22
[40398.875731] cdc_acm 1-2:1.1: ttyACM0: USB ACM device
@olegslavkin
olegslavkin / tionpro28_linux_kernel-v5.0.9_dmesg.txt
Created April 30, 2019 12:39
dmesg output for TionPro28 (Freescale imx28-evk)
/ # dmesg
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 5.0.9 (root@tionpro28-build) (gcc version 8.2.0 (Ubuntu 8.2.0-7ubuntu1)) #2 Tue Apr 30 09:51:30 UTC 2019
[ 0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
[ 0.000000] CPU: VIVT data cache, VIVT instruction cache
[ 0.000000] OF: fdt: Machine model: Freescale i.MX28 Evaluation Kit
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] On node 0 totalpages: 32768
[ 0.000000] Normal zone: 256 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
@olegslavkin
olegslavkin / Embedded ARM Lab.md
Last active June 9, 2019 09:29
QEMU ARM Lab in docker

prepare host (docker host)

export EALAB=~/Projects/qemu-arm-lab/
mkdir -p ${EALAB} && cd "$_"

# This's for rootfs booted by NFS 
# install nfs server. For ubuntu apt install -y nfs-kernel-server
echo "${EALAB}/rootfs *(rw,sync,no_root_squash,no_subtree_check)" | sudo tee --append /etc/exports
sudo systemctl restart nfs-kernel-server.service
@olegslavkin
olegslavkin / qemu-arm_docker.md
Last active August 13, 2020 10:27
Setup ARM Development Environment with QEMU

docker

mkdir ~/Downloads/arm/
cd ~/Downloads/arm/
docker run -it --rm -v $(pwd):/mnt --privileged -w /mnt --name arm ubuntu

prepare container

apt update
apt install gcc-arm-linux-gnueabi python gcc pkg-config libglib2.0-dev libpixman-1-dev libncurses-dev bison flex wget git bc -y

Компиляция qemu

Инструкция основанная на CentOS 7.6

Установка неободимы пакетов

yum install -y git make gcc glib2-devel zlib-devel pixman-devel bison flex

Создание rootfs

mkdir -p ~/rootfs