Skip to content

Instantly share code, notes, and snippets.

View tosi-mosi's full-sized avatar
🎯
Focusing

tosi-mosi

🎯
Focusing
View GitHub Profile
@Theldus
Theldus / README.md
Last active April 22, 2026 07:47
The only proper way to debug 16-bit (x86) code on Qemu+GDB

The only proper way to debug 16-bit code on Qemu+GDB

(or nearly so...)

GDB is undeniably an extremely versatile debugger, with the ability to add breakpoints, watchpoints, dump memory, registers, and the source code (along with its corresponding assembly). These features make it the perfect Swiss Army knife for most programmers. In addition to that, the possibility of implementing a 'GDB Stub' and automatically supporting GDB in your application makes it an almost universal debugger for a variety of tasks.

Qemu, like other virtual machines (such as 86Box), also implements debugging via GDB Stub, which enormously facilitates the development of bootloaders, operating systems, and more. The support for 32-bit and 64-bit code is quite good, and I have never seen any complaints about it. However, for 16-bit/real mode...

Is debugging in 16-bit/real mode really that bad?

If you have ever tried to debug 16-bit code on Qemu, you know how painful it can be:

  1. GDB thinks your code is
@linzheming
linzheming / InstallDebian-HOWTO.md
Created December 15, 2020 07:02 — forked from varqox/install_debian_with_debootstrap_howto.md
Instruction how to install Debian using debootstrap

Warning

This is a tutorial from 2016, originally for installing debian jessie, it may work for newer versions of debian, but I haven't check it (however, it should mostly work because not that much changed since then). You may want to change every occurrence of buster to a name of a new version of debian.

Install debootstrap

Make work directory:

mkdir work
cd work
@mbinna
mbinna / effective_modern_cmake.md
Last active May 4, 2026 11:32
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@varqox
varqox / install_debian_with_debootstrap_howto.md
Last active March 27, 2026 01:25
Instructions how to install Debian using debootstrap
@mrliptontea
mrliptontea / sublime-text-3-windows-shortcuts.md
Last active February 26, 2026 02:37 — forked from TheShrike/gist:6111200
Sublime Text 3 - Useful Shortcuts (Windows)

Sublime Text 3 - Useful Shortcuts (Windows)

General

Shortcut Description
Ctrl+Shift+P command prompt
Ctrl+Alt+P switch project
Ctrl+P go to file
Ctrl+G go to line
@majkrzak
majkrzak / snake.asm
Created August 1, 2014 16:38
Snake like game writen in x86 real mode assembly.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; ;;;;;; ;;;;;; ;;
;; ;; ;; ;; ;;
;; ;; ;; ;;;;;; ;;; ;; ;; ;; ;; ;;; ;; ;; ;;;;;; ;;
;; ;;;;;; ;; ;; ;; ;; ;;;;;;; ;;; ;; ;; ;; ;; ;; ;; ;;
;; ;; ;; ;;;;; ;; ;; ;; ;; ;; ; ;; ;; ;; ;;;; ;;;;;; ;;
;; ;; ;; ;; ;;;;;;; ;; ;; ;; ;;; ;;;;;;; ;; ;; ;; ;;
;; ;; ;; ;;;;;; ;; ;; ;;;;;; ;;;;;; ;; ;; ;; ;; ;; ;; ;;;;;; ;;
;; ;;