Отладка bochs img не удалось

Я сгенерировал img, который будет использоваться для отладки в gdb, я создал bochs с заглушкой enable gdb, но когда я пытаюсь его отладить. Бохи говорят

"это не загрузочное устройство"

, ниже мой код

nasm -f elf64 helloos.nas -g -F stabs
gcc -o helloos helloos.o -g
objcopy -O binary helloos helloos.bin

dd if=/dev/zero of=emptydisk.img bs=512 count=2880 
dd if=helloos.bin of=helloos.img bs=512 count=1 
dd if=emptydisk.img of=helloos.img skip=1 seek=1 bs=512 count=2879

и моя конфигурация.bochsrc, у меня включен gdb, даже если я отключу его, появится сообщение, что это не загрузочное устройство.

romimage: file=/home/terry/Desktop/bochs-2.6/bios/BIOS-bochs-latest 
#romimage: file=bios/seabios-1.6.3.bin
#romimage: file=mybios.bin, address=0xfff80000 # 512k at memory top

#=======================================================================
# VGAROMIMAGE
# You now need to load a VGA ROM BIOS into C0000.
#=======================================================================
#vgaromimage: file=bios/VGABIOS-elpin-2.40
vgaromimage: file=/home/terry/Desktop/bochs-2.6/bios/VGABIOS-lgpl-latest
#vgaromimage: file=bios/VGABIOS-lgpl-latest-cirrus

#=======================================================================
# VGA:
# This defines parameters related to the VGA display
#
#   EXTENSION
#     Here you can specify the display extension to be used. With the value
#     'none' you can use standard VGA with no extension. Other supported
#     values are 'vbe' for Bochs VBE and 'cirrus' for Cirrus SVGA support.
#
#   UPDATE_FREQ
#     The VGA update frequency is based on the emulated clock and the default
#     value is 5. Keep in mind that you must tweak the 'cpu: ips=N' directive
#     to be as close to the number of emulated instructions-per-second your
#     workstation can do, for this to be accurate. If the realtime sync is
#     enabled with the 'clock' option, the value is based on the real time.
#     This parameter can be changed at runtime.
#
# Examples:
#   vga: extension=cirrus, update_freq=10
#=======================================================================
#vga: extension=vbe, update_freq=5

#=======================================================================
# FLOPPYA:
# Point this to pathname of floppy image file or device
# This should be of a bootable floppy(image/device) if you're
# booting from 'a' (or 'floppy').
#
# You can set the initial status of the media to 'ejected' or 'inserted'.
#   floppya: 2_88=path, status=ejected    (2.88M 3.5"  media)
#   floppya: 1_44=path, status=inserted   (1.44M 3.5"  media)
#   floppya: 1_2=path, status=ejected     (1.2M  5.25" media)
#   floppya: 720k=path, status=inserted   (720K  3.5"  media)
#   floppya: 360k=path, status=inserted   (360K  5.25" media)
#   floppya: 320k=path, status=inserted   (320K  5.25" media)
#   floppya: 180k=path, status=inserted   (180K  5.25" media)
#   floppya: 160k=path, status=inserted   (160K  5.25" media)
#   floppya: image=path, status=inserted  (guess media type from image size)
#   floppya: 1_44=vvfat:path, status=inserted  (use directory as VFAT media)
#   floppya: type=1_44                    (1.44M 3.5" floppy drive, no media)
#
# The path should be the name of a disk image file.  On Unix, you can use a raw
# device name such as /dev/fd0 on Linux.  On win32 platforms, use drive letters
# such as a: or b: as the path.  The parameter 'image' works with image files
# only. In that case the size must match one of the supported types.
# The parameter 'type' can be used to enable the floppy drive without media
# and status specified. Usually the drive type is set up based on the media type.
# The optional parameter 'write_protected' can be used to control the media
# write protect switch. By default it is turned off.
#=======================================================================
floppya: 1_44=/home/terry/Desktop/osask-linux/day1/helloos.img, status=inserted
#floppya: image=../1.44, status=inserted
#floppya: 1_44=/dev/fd0H1440, status=inserted
#floppya: 1_2=../1_2, status=inserted
#floppya: 1_44=a:, status=inserted
#floppya: 1_44=a.img, status=inserted, write_protected=1
#floppya: 1_44=/dev/rfd0a, status=inserted

#=======================================================================
# FLOPPYB:
# See FLOPPYA above for syntax
#=======================================================================
#floppyb: 1_44=b:, status=inserted
#floppyb: 1_44=b.img, status=inserted

#=======================================================================
# ATA0, ATA1, ATA2, ATA3
# ATA controller for hard disks and caroms
#
# ata[0-3]: enabled=[0|1], ioaddr1=addr, ioaddr2=addr, irq=number
# 
# These options enables up to 4 ata channels. For each channel
# the two base io addresses and the irq must be specified.
# 
# ata0 and ata1 are enabled by default with the values shown below
#
# Examples:
#   ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
#   ata1: enabled=1, ioaddr1=0x170, ioaddr2=0x370, irq=15
#   ata2: enabled=1, ioaddr1=0x1e8, ioaddr2=0x3e0, irq=11
#   ata3: enabled=1, ioaddr1=0x168, ioaddr2=0x360, irq=9
#=======================================================================
ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
ata1: enabled=1, ioaddr1=0x170, ioaddr2=0x370, irq=15
ata2: enabled=0, ioaddr1=0x1e8, ioaddr2=0x3e0, irq=11
ata3: enabled=0, ioaddr1=0x168, ioaddr2=0x360, irq=9


#ata0-master: type=disk, mode=flat, path="30M.sample"

boot: floppy
#boot: disk


log: bochsout.txt


mouse: enabled=0


#=======================================================================
# GDBSTUB:
# Enable GDB stub. See user documentation for details.
# Default value is enabled=0.
#=======================================================================
gdbstub: enabled=1, port=1234, text_base=0, data_base=0, bss_base=0


megs: 32

0 ответов

Другие вопросы по тегам