Skip to content

Instantly share code, notes, and snippets.

View sergev's full-sized avatar

Serge Vakulenko sergev

View GitHub Profile
@sergev
sergev / .clang-format
Last active August 5, 2021 06:38
My preferred C++ code formatting style
---
BasedOnStyle: Google
#
# Indent by four columns.
#
IndentWidth: 4
#
@sergev
sergev / a+x.full.trace
Created December 5, 2019 21:39
Test of A+X, A-X and X-A instructions, detailed trace of MESM-6 RTL simulation
Limit: 1000
Load 55 words from a+x_a-x_x-a.oct
(0) *** Reset
(1) *** Clear reset
(2) 0: 0000000000051000000 imm=0 md=A mw=IMM w_m
(2) K[0] = 00000
(2) C = 00000
(2) R = 1xx (k,undef)
(2) GIE = 0
(3) 1: 0000010000100200000 imm=0 acc=REG mr=IMM w_a
@sergev
sergev / a+x.trace
Created December 5, 2019 21:39
Test of A+X, A-X and X-A instructions, trace of MESM-6 RTL simulation
Limit: 1000
Load 55 words from a+x_a-x_x-a.oct
(0) *** Reset
(1) *** Clear reset
(2) K[0] = 00000
(2) C = 00000
(2) R = 1xx (k,undef)
(2) GIE = 0
(3) A = 0000 0000 0000 0000
(4) R = 100 (k,undef)
@sergev
sergev / boot-linux-5.4.0-pic32-failed.log
Created November 10, 2019 00:08
Boot Linux 5.4.0 on pic32mz-da with SD workaround: failed
U-Boot 2015.07-00021-g893592104d (Oct 29 2019 - 18:34:01 -0700)
Board: PIC32MZ[DA]
CPU Speed: 200 MHz
SPI: ready
DRAM: 32 MiB
Flash: 2 MiB
MMC: pic32-sdhci: 0
In: serial
Out: serial
@sergev
sergev / boot-raspbiam-pri-zero-w.log
Created November 5, 2019 19:50
Start Raspbian on Raspberry Pi Zero W board.
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.19.75+ (dom@buildbot) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611)) #1270 Tue Sep 24 18:38:54 BST 2019
[ 0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[ 0.000000] OF: fdt: Machine model: Raspberry Pi Zero W Rev 1.1
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] cma: Reserved 8 MiB at 0x1b400000
[ 0.000000] random: get_random_bytes called from start_kernel+0x8c/0x49c with crng_init=0
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 113680
[ 0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=1 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708_fb.fbswap=1 smsc95xx.macaddr=B8:27:EB:14:45:10 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000 console=ttyS0,115200 console=tty1 root=PARTUUID=6c586e13-02 rootfstype=ext4
@sergev
sergev / device-tree-linux-on-pic32.md
Created October 28, 2019 20:59
Device Tree of Linux MIPS32 on PIC32MZ-DA microcontroller

Here you can see a device tree of Linux MIPS32 running on Microchip PIC32MZ-DA Starter Kit board:

(debian) ~ # dtc -I fs -O dts /proc/device-tree
Warning (unit_address_vs_reg): Node /oc1 has a reg or ranges property, but no unit name
Warning (unit_address_vs_reg): Node /oc2 has a reg or ranges property, but no unit name
Warning (unit_address_vs_reg): Node /oc3 has a reg or ranges property, but no unit name
Warning (unit_address_vs_reg): Node /oc4 has a reg or ranges property, but no unit name
Warning (unit_address_vs_reg): Node /oc5 has a reg or ranges property, but no unit name
Warning (unit_address_vs_reg): Node /oc6 has a reg or ranges property, but no unit name
Warning (unit_address_vs_reg): Node /oc7 has a reg or ranges property, but no unit name
@sergev
sergev / device-tree-mipsel-on-qemu.md
Last active October 28, 2019 20:19
Device Tree of Linux MIPS32 on QEMU

Here you can see a device tree of Linux MIPS32 running on virtual QEMU Malta board:

root@debian:~# dtc -I fs -O dts /proc/device-tree
Warning (unit_address_vs_reg): Node /isa has a reg or ranges property, but no unit name
Warning (unit_address_vs_reg): Node /interrupt-controller@20 has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /memory has a reg or ranges property, but no unit name
/dts-v1/;

/ {
	compatible = "mti,malta";
@sergev
sergev / protocol-debian-mipsel.md
Last active October 28, 2019 20:12
Protocol of booting Debian MIPS32 on QEMU

Let's start Debian MIPS32 on QEMU:

qemu-system-mipsel \
    -cpu    4KEc \
    -M      malta \
    -m      2048 \
    -hda    hda.qcow \
    -kernel vmlinux-4.9.0-11-4kc-malta \
    -initrd initrd.img-4.9.0-11-4kc-malta \
    -append root=/dev/sda1 \
@sergev
sergev / debian-mipsel-on-qemu.md
Last active April 20, 2025 11:41
Installing Debian MIPS32 on QEMU

Let's install Debian 9.0 "Stretch" on QEMU MIPS32 under Ubuntu.

Step 1: Install QEMU

sudo apt install qemu-system-mips

Step 2: Download Linux kernel and installation image

wget http://ftp.debian.org/debian/dists/stretch/main/installer-mipsel/current/images/malta/netboot/vmlinux-4.9.0-11-4kc-malta
@sergev
sergev / boot-debian-pic32mz-dar169.log
Last active October 30, 2019 21:00
Start Debian on Microchip PIC32MZ-DA Starter Kit board with 32MZ2064DAR169 chip.
U-Boot 2015.07-00021-g893592104d (Oct 29 2019 - 18:34:01 -0700)
Board: PIC32MZ[DA]
CPU Speed: 200 MHz
SPI: ready
DRAM: 32 MiB
Flash: 2 MiB
MMC: pic32-sdhci: 0
In: serial
Out: serial