Skip to content

Instantly share code, notes, and snippets.

@serghost
Last active March 5, 2025 17:31
Show Gist options
  • Save serghost/3bd56b52c191fc3d9e1bf1c1792599b6 to your computer and use it in GitHub Desktop.
Save serghost/3bd56b52c191fc3d9e1bf1c1792599b6 to your computer and use it in GitHub Desktop.
Makefile
git clone https://github.com/mit-pdos/xv6-public.git
Open Makefile, replace line 32 with:
TOOLPREFIX = i686-elf-
After line 80:
CFLAGS += $(shell $(CC) -fno-stack-protector -E -x c /dev/null >/dev/null 2>&1 && echo -fno-stack-protector)
Add:
CFLAGS += -Wno-array-bounds
CFLAGS += -Wno-infinite-recursion
Run:
make qemu-gdb
In another tab run:
lldb
Here you can navigate and make breakpoints, i.e:
target create kernel
gdb-remote 25501
breakpoint set --name main
continue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment