A multitasking operating system and kernel with an interactive shell.
bless - graphical hexadecimal Gtk# editor.
Edit the FILEs as a sequence of bytes
, allowing read/write, search, pattern finding, efficient query-replace, multi-tabbing, customized data-views, plugins, and many other features. Using bless command:
bless ./bin/LavaOS.img
qemu-system-x86_64 -hda ./bin/LavaOS.img
./bin/cross/bin/$TARGET-gcc --version # For compile C files.
./bin/cross/bin/$TARGET-g++ --version # For compile C++ files.
./bin/cross/bin/$TARGET-ld # Linker.
nasm -f bin file_name.asm -o file_name.bin
To disassemble it, simply using ndisasm
command:
ndisasm boot.binemu-system-x86_64 -hda file_name.bin -S -gdb stdio
NOTE: We should use kernel.elf (kernel image) to add symbol instead of using disk image.
First, entering to gdb mode:
gdb
Adding traceable symbol file:
add-symbol-file /bin/kernel.o 0x0100000
Set break point in symbol:
break kernel_entry_point
Start debugging with remote target:
target remote | qemu-system-x86_64 -hda ./bin/LavaOS.img -S -gdb stdio
Switching to assembly:
layout asm
And step by step. prints out registers in both raw format (hex) and natural format in gdb:
info registers
gdb
In gdb:
add-symbol-file ./src/kernel/core/kernel.o 0x0100000
target remote | qemu-system-x86_64 -hda ./bin/LavaOS.img -S -gdb stdio
# Set break point in file-line
break kernel.cc:21
# continue
c
# print value of ptr variable
print ptr
sudo mount -t vfat ./bin/LavaOS.img /mnt/d/
# do some thing ...
sudo umount /mnt/d/