Skip to content

Instantly share code, notes, and snippets.

View abrodkin's full-sized avatar

Alexey Brodkin abrodkin

View GitHub Profile
@abrodkin
abrodkin / speedcrunch-for-windows.md
Created March 8, 2023 15:04
Build Speedcrunch on Windows

Install MSYS2

Install additional packages

make
mingw-w64-ucrt-x86_64-cmake
mingw-w64-ucrt-x86_64-gcc
mingw-w64-ucrt-x86_64-qt5-base
mingw-w64-ucrt-x86_64-qt5-tools
@abrodkin
abrodkin / dotfiles.md
Last active November 28, 2021 19:49
My dotfiles

.bashrc

# Figure-out location of Python user packages
PYTHON_SITE=$(python -m site --user-site)

# Powerline configuration
if [ -f $PYTHON_SITE/powerline/bindings/bash/powerline.sh ]; then
    $HOME/.local/bin/powerline-daemon -q
    POWERLINE_BASH_CONTINUATION=1
    POWERLINE_BASH_SELECT=1
@abrodkin
abrodkin / Debian-rebootstrap-for-ARCv2.md
Created April 2, 2021 07:08
Running Debian rebootstrap in Docker container

On the host:

git clone https://salsa.debian.org/vineetgarc/rebootstrap.git
cd rebootstrap
docker run --privileged --rm -it -v $PWD:/host debian:stretch /bin/bash

In the container:

apt-get update && apt-get install -y pbuilder
@abrodkin
abrodkin / build-gcc_tg.o.md
Created December 24, 2020 08:41
How to build DejaGnu's "test glue" binary: gcc_tg.o

arc-elf32-gcc -w -c -mcpu=archs -o gcc_tg.o /usr/share/dejagnu/testglue.c

@abrodkin
abrodkin / arc64-snps-linux-gnu.md
Last active November 12, 2020 12:00
Crosstool-NG configuration for ARC64 Linux toolchain
CT_CONFIG_VERSION="3"
CT_EXPERIMENTAL=y
CT_ARCH_ARC=y
CT_ARCH_64=y
CT_TARGET_VENDOR="snps"
CT_TARGET_ALIAS="arc64-linux"
CT_KERNEL_LINUX=y
CT_LINUX_SRC_DEVEL=y
CT_LINUX_DEVEL_URL="https://github.com/foss-for-synopsys-dwc-arc-processors/linux.git"

Preparation of the build host:

  1. Clone osxcross repo: git clone https://github.com/tpoechtrager/osxcross
  2. cd osxcross
  3. Download MacOS SDK: curl -sLo tarballs/MacOSX10.10.sdk.tar.xz https://www.dropbox.com/s/yfbesd249w10lpc/MacOSX10.10.sdk.tar.xz
  4. Run container for building

CentOS 8.x

docker run -v $PWD:/osxcross --name centos8-osxcross -i -t centos:centos8 /bin/bash

IoTDK

west -v -v -v flash --serial=251642517567 --use-elf

HSDK

west -v -v -v flash --serial=25164200001f --use-elf
@abrodkin
abrodkin / ARC-GNU-tools-build.md
Last active December 19, 2019 10:34
Manual ARC GNU toolchain building with Synopsys scripts

Install dependencies

Ubuntu/Debian: apt-get update && apt-get install -y texinfo byacc flex libncurses5-dev zlib1g-dev libexpat1-dev texlive build-essential git wget gawk bison xz-utils make python3 rsync locales

CentOS/RHEL 7: yum install -y autoconf automake binutils bison byacc flex gcc gcc-c++ libtool patch texinfo-tex ncurses-devel ncurses-compat-libs flex zlib-devel expat-devel git texlive-collection-latexrecommended wget make xz rsync diffutils which

Fedora, CentOS/RHEL 8: dnf install -y autoconf automake binutils bison byacc flex gcc gcc-c++ libtool patch texinfo-tex ncurses-devel ncurses-compat-libs flex zlib-devel expat-devel git texlive-collection-latexrecommended wget make xz rsync diffutils which

Get all the sources

VirGL

./configure --target-list=arc-softmmu --enable-sdl --enable-opengl --enable-virglrenderer --enable-gtk --enable-spice
./arc-softmmu/qemu-system-arc -M simhs -nographic -kernel vmlinux -cpu archs -append "root=/dev/vda ro" -drive file=rootfs.ext2,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 -vga virtio -spice gl=on

Save console output to file

qemu-system-arc -M simhs -nographic -no-reboot -monitor none -cpu archs -chardev stdio,id=char0,logfile=serial.log,signal=off -serial chardev:char0 -kernel vmlinux
@abrodkin
abrodkin / emdk-load-elf-metaware.md
Created October 2, 2018 10:26
EMDK: Load Elf with MetaWare

First we need to enable write into "ROM" and we do it with "preloadexec" command:

mdb -dll=opxdarc.so -OK -preloadexec="eval *(int*)0xf0001000=0" u-boot