# Linux Kernel Module Cheat

#### 3.3.1. tmux gem5

If you are using gem5 instead of QEMU, `--tmux` has a different effect by default: it opens the gem5 terminal instead of the debugger:

    ./run --emulator gem5 --tmux

To open a new pane with GDB instead of the terminal, use:

    ./run --gdb

which is equivalent to:

    ./run --emulator gem5 --gdb-wait --tmux --tmux-args start_kernel --tmux-program gdb

`--tmux-program` implies `--tmux`, so we can just write:

    ./run --emulator gem5 --gdb-wait --tmux-program gdb

If you also want to see both GDB and the terminal with gem5, then you will need to open a separate shell manually as usual with `./gem5-shell`.

From inside tmux, you can create new terminals on a new window with `Ctrl-B C` split a pane yet again vertically with `Ctrl-B %` or horizontally with `Ctrl-B "`.