Skip to content

Instantly share code, notes, and snippets.

@ryo
ryo / kdump.txt
Created November 27, 2021 18:30
dotnet hello world sample on netbsd. (with compat_linux)
14063 14063 ktrace EMUL "netbsd"
14063 14063 ktrace CALL execve(0x7f7fff41ca17,0x7f7fff41c370,0x7f7fff41c380)
14063 14063 ktrace NAMI "/var/tmp/dotnet_work/MyApp/bin/Release/net6.0/linux-x64/./MyApp"
14063 14063 ktrace NAMI "/emul/linux"
14063 14063 ktrace NAMI "/emul/linux/lib64/ld-linux-x86-64.so.2"
14063 14063 MyApp EMUL "linux"
14063 14063 MyApp RET execve -1 errno -2 No such file or directory
14063 14063 MyApp CALL brk(0)
14063 14063 MyApp RET brk 151552/0x25000
14063 14063 MyApp CALL arch_prctl(0x3001,0x7f7fffffe390)
download from https://busybox.net/
# file busybox-armv7l
busybox-armv7l: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, stripped
# readelf -a busybox-armv7l
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
@ryo
ryo / robust_test.c
Last active September 28, 2021 10:46
#include <stdio.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <sys/futex.h>
#include <sys/wait.h>
int
main(int argc, char *argv[])
{
cvs -q diff -u -a -p kern_exec.c
Index: kern_exec.c
===================================================================
RCS file: /src/cvs/cvsroot-netbsd/src/sys/kern/kern_exec.c,v
retrieving revision 1.506
diff -u -a -p -r1.506 kern_exec.c
--- kern_exec.c 11 Jun 2021 12:54:22 -0000 1.506
+++ kern_exec.c 28 Sep 2021 03:56:37 -0000
@@ -87,6 +87,7 @@ __KERNEL_RCSID(0, "$NetBSD: kern_exec.c,
#include <sys/acct.h>
@ryo
ryo / log
Created June 17, 2021 03:55
netbsd/X96MAX+ WIP
[ 1.0000000] uboot: args 0x1fff1000, 0, 0, 0
[ 1.0000000] NetBSD/evbarm (fdt) booting ...
[ 1.0000000] FDT /memory @ 0x0 size 0x78000000
[ 1.0000000] initarm: memory start 0 end 78000000 (len 78000000)
[ 1.0000000] initarm: fdt_build_bootconfig
[ 1.0000000] Usable memory:
[ 1.0000000] 0 - 1fff0fff
[ 1.0000000] 1fffd000 - 77ffffff
[ 1.0000000] Creating L2 tables: ffff000000000000-ffff00001fdfffff : 0000000000000000-000000001fdfffff
[ 1.0000000] pmapboot_enter: va=0xffff000000000000, pa=0x0, size=0x1fe00000, blocksize=0x200000, attr=0x0060000000000000
include "arch/evbarm/conf/GENERIC64"
ixg* at pci? dev ? function ? # Intel 8259x 10 gigabit
options MULTIPROCESSOR
options DB_MAX_WIDTH=0
options DB_MAX_LINE=64
#options UVMHIST,PMAPHIST
PCI configuration registers:
Common header:
0x00: 0x15638086 0x00100146 0x02000001 0x00800010
Vendor Name: Intel (0x8086)
Device Name: X550 10G Ethernet (0x1563)
Command register: 0x0146
I/O space accesses: off
Memory space accesses: on
Bus mastering: on
cvs -q diff -aU30 -a -p ix_txrx.c
Index: ix_txrx.c
===================================================================
RCS file: /src/cvs/cvsroot-netbsd/src/sys/dev/pci/ixgbe/ix_txrx.c,v
retrieving revision 1.72
diff -a -U 30 -a -p -r1.72 ix_txrx.c
--- ix_txrx.c 11 May 2021 01:30:30 -0000 1.72
+++ ix_txrx.c 12 May 2021 06:32:54 -0000
@@ -1307,121 +1307,156 @@ ixgbe_setup_hw_rsc(struct rx_ring *rxr)
IXGBE_WRITE_REG(hw, IXGBE_PSRTYPE(0),
cvs -q diff -u -a -p .
Index: bus_space.c
===================================================================
RCS file: /src/cvs/cvsroot-netbsd/src/sys/arch/aarch64/aarch64/bus_space.c,v
retrieving revision 1.15
diff -u -a -p -r1.15 bus_space.c
--- bus_space.c 14 Dec 2020 19:32:29 -0000 1.15
+++ bus_space.c 8 Apr 2021 14:58:02 -0000
@@ -702,6 +702,7 @@ generic_bs_pe_1(void *t, bus_space_handl
cvs -q diff -u -a -p idle_machdep.S
Index: idle_machdep.S
===================================================================
RCS file: /src/cvs/cvsroot-netbsd/src/sys/arch/aarch64/aarch64/idle_machdep.S,v
retrieving revision 1.6
diff -u -a -p -r1.6 idle_machdep.S
--- idle_machdep.S 12 Aug 2020 13:19:35 -0000 1.6
+++ idle_machdep.S 3 Feb 2021 16:28:38 -0000
@@ -37,6 +37,9 @@