Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7880549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:10:16+00:00 2026-06-03T04:10:16+00:00

I wrote a x86 assembly program for MBR section. I compile it as follows:

  • 0

I wrote a x86 assembly program for MBR section.
I compile it as follows:

nasm hellombr.asm -f bin -o hellombr.img

Then I run it in qemu:

qemu -fda hellombr.img -boot a

The question is how can I debug my program at source level?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T04:10:18+00:00Added an answer on June 3, 2026 at 4:10 am

    You should let nasm create the debugging symbols in an ELF file and then dump this to a flat binary to be used in the MBR. You can then instruct GDB to read the necessary symbols from the ELF file.

    The complete procedure would then become something like this:

    $ nasm hellombr.asm -f elf -g -o hellombr.elf
    $ objcopy -O binary hellombr.elf hellombr.img
    $ qemu -s -S -fda hellombr.img -boot a
    $ gdb
    (gdb) symbol-file hellombr.elf
    (gdb) target remote localhost:1234
    

    For an explanation of the flags I pass to qemu see this answer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I am working on an x86 Assembly program for Linux using NASM. This
I wrote some assembly code for x86, and wanted to assemble it into plain
I have a big problem with a program in assembly x86. I have to
I know x86 Assembly (and have worked with FPGA etc') , Never wrote for
when I write in commandline in windows: C:\Program Files (x86)\Microsoft Office\Office12>winword.exe /mOpenPage c:\Navod ilo.doc
I wrote a program that forks some processes with fork(). I want to kill
Given the following x86-64 AT&T assembly line: cmpl $0x7,0xc(%rsp) This is accessing the 12th
I wrote a multi-threaded app to benchmark the speed of running LOCK CMPXCHG (x86
I am trying to get the current date using assembly (x86) on Linux. I
I am trying to dive into some x86 assembly programming on my Mac, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.