From: Gautam Bhat <mindentropy@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Richard Henderson <richard.henderson@linaro.org>,
QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: Point where target instructions are read
Date: Thu, 11 Apr 2024 02:45:43 +0530 [thread overview]
Message-ID: <CAM2a4uxYKyVJN6GjN8c2fz21eCJxoLh4r3hzqqRMALCHKxt1Uw@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA-CDgR2r7uNh=PQaQfVspa5tnNTwiK7Dbor7faxY25V=w@mail.gmail.com>
On Tue, Apr 9, 2024 at 2:23 PM Peter Maydell <peter.maydell@linaro.org> wrote:
> That sounds like a problem with your binary. If the reset vector
> needs to be at 0xFFFE then it needs to be there, and you
> should arrange for it to be built correctly. It doesn't matter
> whether it's an ELF file or a raw binary file, the data has
> to be in the right place. (Generally when objcopy creates a raw
> binary from an ELF file it doesn't change the address where
> the data is, assuming you load the resulting raw binary to the
> right starting address.)
>
> -- PMM
It was a problem with me loading it to the right address. Went through
the manual again and I found that the ROM address starts at 0xC000.
Hence I was supposed to load at that address. Loading at that address
places the reset vector interrupt in the right location. Now I get the
right program counter value which is 0xC000 which is the code in the
ROM.
I went ahead to check if I now get the right opcode but I am still
getting zeroes. Digging through the code when I do the following for
translate:
static void translate(DisasContext *ctx)
{
uint32_t opcode;
opcode = cpu_lduw_code(ctx->msp430_cpu_state,
ctx->base.pc_next);
qemu_fprintf(stderr, "Opcode: 0x%x\n", opcode);
}
cpu_lduw_code calls mmu_index callback. In my callback I have
static int msp430_cpu_mmu_index(CPUState *cp, bool ifetch)
{
return MMU_CODE_DATA_IDX;
}
Here I have just set the MMU_CODE_DATA_IDX to 1 which I know does not
make sense. I am not sure how this index is supposed to be computed.
Any idea on what to look at to understand it?
-Gautam.
next prev parent reply other threads:[~2024-04-10 21:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-01 19:50 Point where target instructions are read Gautam Bhat
2024-04-01 20:31 ` Richard Henderson
2024-04-03 18:15 ` Gautam Bhat
2024-04-03 22:35 ` BALATON Zoltan
2024-04-03 22:40 ` Richard Henderson
2024-04-04 8:53 ` Peter Maydell
2024-04-08 19:25 ` Gautam Bhat
2024-04-09 8:53 ` Peter Maydell
2024-04-10 21:15 ` Gautam Bhat [this message]
2024-04-13 20:51 ` Gautam Bhat
2024-05-18 6:59 ` Gautam Bhat
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAM2a4uxYKyVJN6GjN8c2fz21eCJxoLh4r3hzqqRMALCHKxt1Uw@mail.gmail.com \
--to=mindentropy@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).