Skip to content

Instantly share code, notes, and snippets.

View tkchk's full-sized avatar

Alex Tkachuk tkchk

View GitHub Profile
@felipeek
felipeek / linux-debug.md
Created August 9, 2020 00:03
How to debug the Linux Kernel using VirtualBox

Assumptions: Host machine is linux.

  1. Download virtualbox
  2. Install a linux flavour. Preference for Debian since distro-dependent commands in the following steps will be debian-dependent
  3. Run your VM.
  4. Inside VM, download last kernel code from kernel.org
  5. Extract linux src code
  6. Copy your configuration file from /boot/config-$(uname -r) to .config in the extract linux src code folder.
  7. Make sure .config has the following options: CONFIG_FRAME_POINTER=y , CONFIG_KGDB=y , CONFIG_KGDB_SERIAL_CONSOLE=y , CONFIG_KGDB_KDB=y , CONFIG_KDB_KEYBOARD=y. Change if necessary. Alternatively use make xconfig to configure in UI.
  8. Install compilation dependencies (debian: sudo apt-get install build-essential libncurses-dev bison flex libssl-dev libelf-dev)
@rigred
rigred / Seagate ST2000DL001 F3 commands
Created May 27, 2017 15:50
Dump of the F3 commands for the ST2000DL001 Seagate Drive CC97 FW
Rst 0x20M
(P) SATA Reset
ASCII Diag mode
F3 T>
ASCII Diag mode
F3 T>/C
@CMCDragonkai
CMCDragonkai / memory_layout.md
Last active June 17, 2024 12:05
Linux: Understanding the Memory Layout of Linux Executables

Understanding the Memory Layout of Linux Executables

Required tools for playing around with memory:

  • hexdump
  • objdump
  • readelf
  • xxd
  • gcore