summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Fankhauser hiddenalpha.ch2023-10-28 13:37:16 +0200
committerAndreas Fankhauser hiddenalpha.ch2023-10-28 13:37:16 +0200
commitb0499b5ef664471b2da273133cd3d40d101740a1 (patch)
tree18cf023d380de0770fbf6dfa0544ab7ce6f75c46
parent91c875e8f9292a0bab79ccf75249771e8b681d21 (diff)
downloadUnspecifiedGarbage-b0499b5ef664471b2da273133cd3d40d101740a1.zip
UnspecifiedGarbage-b0499b5ef664471b2da273133cd3d40d101740a1.tar.gz
Add some notes.
-rw-r--r--doc/note/gdb/gdb.txt10
-rw-r--r--doc/note/qemu/build-libpcap.txt64
-rw-r--r--doc/note/qemu/qemu.txt8
3 files changed, 80 insertions, 2 deletions
diff --git a/doc/note/gdb/gdb.txt b/doc/note/gdb/gdb.txt
new file mode 100644
index 0000000..20cbd4d
--- /dev/null
+++ b/doc/note/gdb/gdb.txt
@@ -0,0 +1,10 @@
+
+## Print next few ASM instructions
+
+ x/3i $pc
+
+
+## Sources
+
+- [Print asm instructions](https://stackoverflow.com/a/59331366/4415884)
+
diff --git a/doc/note/qemu/build-libpcap.txt b/doc/note/qemu/build-libpcap.txt
new file mode 100644
index 0000000..b86dd1c
--- /dev/null
+++ b/doc/note/qemu/build-libpcap.txt
@@ -0,0 +1,64 @@
+
+### Debian native
+true \
+ && PKGS_TO_ADD="curl ca-certificates gcc make libc6-dev flex bison" \
+ && SUDO=sudo \
+ && PKGINIT="$SUDO apt update" \
+ && PKGADD="$SUDO apt install -y --no-install-recommends" \
+ && HOST= \
+ && true
+
+
+### Alpine mingw cross
+true \
+ && PKGS_TO_ADD="binutils curl mingw-w64-gcc make tar flex bison" \
+ && SUDO="/home/$USER/.local/bin/mysudo" \
+ && PKGINIT=true \
+ && PKGADD="$SUDO apk add" \
+ && HOST=x86_64-w64-mingw32 \
+ && true
+
+
+## Generic
+true \
+ && PCAP_VERSION="1.10.4" \
+ && CACHE_DIR="/var/tmp" \
+ && WORKDIR="/tmp" \
+ && INSTALL_ROOT="/usr/local" \
+ && MAKE_JOBS=$(nproc) \
+ && true
+
+
+## Make
+true \
+ && PCAP_URL="https://github.com/the-tcpdump-group/libpcap/archive/refs/tags/libpcap-${PCAP_VERSION:?}.tar.gz" \
+ && PCAP_SRCTGZ="${CACHE_DIR:?}/pcap-${PCAP_VERSION:?}.tgz" \
+ && PCAP_BINTGZ="${PCAP_SRCTGZ%.*}-bin.tgz" \
+ && if test -f "${PCAP_SRCTGZ:?}" ]; then true \
+ && echo "[DEBUG] Already have \"${PCAP_SRCTGZ:?}\"" \
+ ;else true \
+ && echo curl -sSL "${PCAP_URL:?}" -o "${PCAP_SRCTGZ:?}" \
+ && curl -sSL "${PCAP_URL:?}" -o "${PCAP_SRCTGZ:?}" \
+ ;fi \
+ && ( mkdir "${WORKDIR:?}/pcap-${PCAP_VERSION}" \
+ && cd "${WORKDIR:?}/pcap-${PCAP_VERSION}" \
+ && tar xf "${PCAP_SRCTGZ:?}" \
+ && cd * \
+ && ./configure --prefix=${WORKDIR:?}/pcap-"${PCAP_VERSION:?}"/out \
+ && make clean \
+ && make -j$(nproc) \
+ && make install \
+ && cd ../out \
+ && rm bin/pcap-config lib/pkgconfig -rf \
+ && tar cf "${PCAP_BINTGZ:?}" * \
+ && printf '\n Build pcap Done\n\n' \
+ ) \
+ && true
+
+
+### Install
+true \
+ && $SUDO mkdir -p "${INSTALL_ROOT:?}" \
+ && $SUDO tar -C "${INSTALL_ROOT:?}" -xf "${PCAP_BINTGZ:?}" \
+ && true
+
diff --git a/doc/note/qemu/qemu.txt b/doc/note/qemu/qemu.txt
index fd85b1b..62cf11d 100644
--- a/doc/note/qemu/qemu.txt
+++ b/doc/note/qemu/qemu.txt
@@ -42,6 +42,9 @@ qemu-system-x86_64 \
-boot order=dc \
-cdrom "path/to/cd.iso" \
-hda "$(dirname "$(realpath "$0")")/hda.qcow2" \
+ `# Host-Only Network` \
+ -netdev user,id=n1,restrict=y \
+ -device e1000,netdev=n1 \
`# 10.0.2.x network with host redirect` \
-netdev user,id=n0,hostfwd=tcp:127.0.0.1:${SSH_PORT:-2222}-:22 \
-device e1000,netdev=n0 \
@@ -53,8 +56,9 @@ qemu-system-x86_64 \
-device usb-ehci,id=usb,bus=pci.0,addr=0x4 -device usb-tablet \
`# Choose ONE of those for graphic output` \
-nographic \
- -display gtk \
- -display sdl \
+ -display sdl,grab-mod=rctrl \
+ -display gtk,show-menubar=on \
+ -display vnc=127.0.0.1:0 `#HINT: 0 is port 5900` \
;
### Example manual adapter setup (inside VM) for socket mcast network: