BOCHS debugging stuff

This commit is contained in:
Jarkko Toivanen 2024-08-17 19:16:53 +03:00
parent c2e69b6f7f
commit 0d9fcf5ae4
Signed by: jt
GPG key ID: 9151B109B73ECAD5
3 changed files with 18 additions and 5 deletions

1
.gitignore vendored
View file

@ -4,3 +4,4 @@
*.bin *.bin
mnt/ mnt/
build/ build/
bx_enh_dbg.ini

View file

@ -8,11 +8,10 @@ image: start32.bin mount grub-cfg roska.img mnt/roska/
cp start32.bin mnt/roska/ cp start32.bin mnt/roska/
sync sync
qemu-multiboot: start32.bin qemu-run: image roska.img
qemu-system-i386 -kernel start32.bin -serial stdio
qemu-image: image roska.img
qemu-system-i386 roska.img -serial stdio qemu-system-i386 roska.img -serial stdio
bochs-run: image roska.img
bochs -qf bochsrc.txt
mount: roska.img mnt/ mount: roska.img mnt/
@if ! mountpoint -q "mnt/"; then \ @if ! mountpoint -q "mnt/"; then \
sudo mount -o loop,offset=1048576,umask=177,dmask=022,uid=$(shell id -u),gid=$(shell id -g) roska.img mnt/; \ sudo mount -o loop,offset=1048576,umask=177,dmask=022,uid=$(shell id -u),gid=$(shell id -g) roska.img mnt/; \
@ -29,7 +28,7 @@ build/:
@mkdir build @mkdir build
roska.img: mnt/ roska.img: mnt/
dd if=/dev/zero of=roska.img bs=16M count=1 dd if=/dev/zero of=roska.img bs=1k count=16128
echo 'type=83' | sudo sfdisk roska.img echo 'type=83' | sudo sfdisk roska.img
sudo losetup /dev/loop0 roska.img sudo losetup /dev/loop0 roska.img
sudo losetup /dev/loop1 roska.img -o1048576 sudo losetup /dev/loop1 roska.img -o1048576

13
bochsrc.txt Normal file
View file

@ -0,0 +1,13 @@
display_library: x, options="gui_debug"
magic_break: enabled=1
romimage: file=$BXSHARE/BIOS-bochs-legacy
vgaromimage: file=$BXSHARE/VGABIOS-lgpl-latest
clock: sync=realtime
cpu: ips=4294967295, reset_on_triple_fault=false
megs: 128
ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
ata0-master: type=disk, mode=flat, path=roska.img, cylinders=32, heads=16, spt=63
boot: disk
# Use `bximage` to get disk geometry
# TODO: Figure out how to get sensible TTY serial