This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For RISC-V Linux v5.18 | |
# Add Linux symbol (before MMU setup) | |
add-symbol-file vmlinux -o -0xfffffffeffe00000 | |
# OpenSBI symbol | |
add-symbol-file fw_jump.elf | |
# Linux kernel 1st line | |
br *0x80200000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Linux SMP + interrupt synchronization | |
- https://linux-kernel-labs.github.io/master/lectures/smp.html#process-and-interrupt-context-synchronization | |
- https://www.kernel.org/doc/html/v4.20/kernel-hacking/locking.html#hard-irq-context | |
- https://www.kernel.org/doc/html/v4.20/kernel-hacking/locking.html#table-of-minimum-requirements |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Linux SPI driver | |
Slides: | |
- 2017, Groking the Linux SPI Subsystem: http://events17.linuxfoundation.org/sites/events/files/slides/Groking%20the%20Linux%20SPI%20Subsystem.pdf | |
- 2014, What’s going on with SPI?: https://elinux.org/images/2/20/Whats_going_on_with_SPI--mark_brown.pdf | |
Some reference: | |
- Overview of Linux kernel SPI support: https://www.kernel.org/doc/Documentation/spi/spi-summary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int foo(int a, int b) | |
{ | |
return a+b; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Segger - Getting printf Output from Target to Debugger: https://blog.segger.com/getting-printf-output-from-target-to-debugger/ | |
Tutorial: Using Single Wire Output SWO with ARM Cortex-M and Eclipse: https://mcuoneclipse.com/2016/10/17/tutorial-using-single-wire-output-swo-with-arm-cortex-m-and-eclipse/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# requirement: | |
# install libcgroup | |
# | |
# usage: | |
# $ ./tc_cgroup.sh | |
# $ cgexec -g net_cls:gdrive fish | |
USER=susu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grep -R hw/ -e "TYPE_VIRTIO_DEVICE" | cut -d : -f 1 | xargs -I {} wc {} | column -t | sort -n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef _GNU_SOURCE | |
#define _GNU_SOURCE 1 | |
#endif | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
#include <sys/time.h> | |
#include <sys/wait.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Linux interrupt handler | |
// request_irq() | |
// Linux 4.9 | |
// setup handler to irqaction | |
- request_threaded_irq() | |
- source: include/linux/interrupt.h, kernel/irq/manage.c | |
- irqaction is a chain(queue?) in irq_desc | |
- if IRQF_SHARED isn't set, there is only one irqaction in the chain. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vmi_read() | |
=> [VMI_TM_KERNEL_SYMBOL] vmi_translate_ksym2v() | |
=> vmi_pagetable_lookup_cache() | |
// dtb = vmi->kpgd if pid == 0 | |
// = vmi_pid_to_dtb(vmi, ctx->pid, &dtb) if pid > 0 | |
=> vmi_read_page(vmi, pfn) | |
vmi_pagetable_lookup_cache() |
NewerOlder