* new board
@ 2004-04-23 16:03 Stefano Martini
[not found] ` <mailpost.1082724164.28332@news-sj1-1>
0 siblings, 1 reply; 6+ messages in thread
From: Stefano Martini @ 2004-04-23 16:03 UTC (permalink / raw)
To: GDB
Hi all
,
I'm writing programs for a specific mips board.
I need to edit the gdb (sim) source files to add this
board.
Is there any document about this topic?
I think I have to specify the memory regions for the board.
Which is the right way to do this?
Thanks
Stefano
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: new board
[not found] ` <mailpost.1082724164.28332@news-sj1-1>
@ 2004-04-23 17:23 ` cgd
2004-04-26 17:57 ` Stefano Martini
[not found] ` <001801c42b64$17649c10$2af21b9d@toti>
0 siblings, 2 replies; 6+ messages in thread
From: cgd @ 2004-04-23 17:23 UTC (permalink / raw)
To: martini; +Cc: GDB
At Fri, 23 Apr 2004 12:42:44 +0000 (UTC), "Stefano Martini" wrote:
> I'm writing programs for a specific mips board.
> I need to edit the gdb (sim) source files to add this
> board.
>
> Is there any document about this topic?
Not really.
> I think I have to specify the memory regions for the board.
> Which is the right way to do this?
See interp.c.
But, my personal favorite method -- not currently supported in
unmodified sources, I don't think 8-) -- is to have a "no board"
option, and specify all of the devices (hardware files, memory
regions, etc.) from the command line.
Given that there can be ... dozens of possible board configurations
that one might want to model, stuffing them into C code in the
simultor is not particularly desirable in my opinion.
cgd
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: new board
2004-04-23 17:23 ` cgd
@ 2004-04-26 17:57 ` Stefano Martini
[not found] ` <001801c42b64$17649c10$2af21b9d@toti>
1 sibling, 0 replies; 6+ messages in thread
From: Stefano Martini @ 2004-04-26 17:57 UTC (permalink / raw)
To: cgd; +Cc: GDB
Thank you for your help.
I have found, in interp.c, the memory layout definition for
some boards.
I have seen two interesting commands:
sim_do_command(sd,"memory region .....")
sim_do_commandf(sd,"memory alias....");
Which are the differences between sim_do_command and
sim_do_commandf ?
And more, which are the differences between memory region
and memory alias?
Thanks in advance
Stefano
----- Original Message -----
From: cgd@broadcom.com
To: martini@sci.univr.it
Cc: GDB
Sent: Friday, April 23, 2004 6:48 PM
Subject: Re: new board
At Fri, 23 Apr 2004 12:42:44 +0000 (UTC), "Stefano Martini" wrote:
> I'm writing programs for a specific mips board.
> I need to edit the gdb (sim) source files to add this
> board.
>
> Is there any document about this topic?
Not really.
> I think I have to specify the memory regions for the board.
> Which is the right way to do this?
See interp.c.
But, my personal favorite method -- not currently supported in
unmodified sources, I don't think 8-) -- is to have a "no board"
option, and specify all of the devices (hardware files, memory
regions, etc.) from the command line.
Given that there can be ... dozens of possible board configurations
that one might want to model, stuffing them into C code in the
simultor is not particularly desirable in my opinion.
cgd
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: new board
[not found] ` <001801c42b64$17649c10$2af21b9d@toti>
@ 2004-04-26 18:12 ` cgd
2004-04-28 13:58 ` Stefano Martini
0 siblings, 1 reply; 6+ messages in thread
From: cgd @ 2004-04-26 18:12 UTC (permalink / raw)
To: Stefano Martini; +Cc: GDB
Unfortunately, as you've discovered, there's not much documentation
related to the simulator(s)...
At Mon, 26 Apr 2004 09:57:12 +0200, Stefano Martini wrote:
> I have seen two interesting commands:
>
> sim_do_command(sd,"memory region .....")
>
> sim_do_commandf(sd,"memory alias....");
>
> Which are the differences between sim_do_command and
> sim_do_commandf ?
looking at the changelogs:
* sim-utils.c (sim_do_commandf): New function, printf version of
sim_do_command.
That difference seems borne out by their usage.
> And more, which are the differences between memory region
> and memory alias?
memory region creates a region of memory to be used by the simulator.
memory alias creates a region in the address space that aliases an
existing region of memory.
As you can see from some of the code already there, this is used to
mock-up kseg1. (This method is, IMO, not ideal.)
chris
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: new board
2004-04-26 18:12 ` cgd
@ 2004-04-28 13:58 ` Stefano Martini
2004-04-29 0:32 ` cgd
0 siblings, 1 reply; 6+ messages in thread
From: Stefano Martini @ 2004-04-28 13:58 UTC (permalink / raw)
To: cgd; +Cc: GDB
Thanks for the help,
I have defined all the memory regions for my board in
the file interp.c:
sim_do_command(sd,"memory region ......")
When I start the run program (mipsel-elf-run --board .....) to execute
a example program I get the following error messages:
mips-core: 1 byte read to unmapped address 0x0 at 0x800ab230
mips-core: 4 byte read to unmapped address 0x0 at 0x0
mips-core: 4 byte read to unmapped address 0x0 at 0x0
mips-core: 4 byte read to unmapped address 0x0 at 0x0
mips-core: 4 byte read to unmapped address 0x0 at 0x0
mips-core: 4 byte read to unmapped address 0x0 at 0x0
I have no address in region 0x0. Is this a problem
related to virtual and physical addresses?
I think "physical address" is an address generated by the
processor to access a memory region.
What is a virtual address?
Thanks in advance.
Stefano
----- Original Message -----
From: cgd@broadcom.com
To: Stefano Martini
Cc: GDB
Sent: Monday, April 26, 2004 7:56 PM
Subject: Re: new board
Unfortunately, as you've discovered, there's not much documentation
related to the simulator(s)...
At Mon, 26 Apr 2004 09:57:12 +0200, Stefano Martini wrote:
> I have seen two interesting commands:
>
> sim_do_command(sd,"memory region .....")
>
> sim_do_commandf(sd,"memory alias....");
>
> Which are the differences between sim_do_command and
> sim_do_commandf ?
looking at the changelogs:
* sim-utils.c (sim_do_commandf): New function, printf version of
sim_do_command.
That difference seems borne out by their usage.
> And more, which are the differences between memory region
> and memory alias?
memory region creates a region of memory to be used by the simulator.
memory alias creates a region in the address space that aliases an
existing region of memory.
As you can see from some of the code already there, this is used to
mock-up kseg1. (This method is, IMO, not ideal.)
chris
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: new board
2004-04-28 13:58 ` Stefano Martini
@ 2004-04-29 0:32 ` cgd
0 siblings, 0 replies; 6+ messages in thread
From: cgd @ 2004-04-29 0:32 UTC (permalink / raw)
To: Stefano Martini; +Cc: GDB
At Wed, 28 Apr 2004 15:30:36 +0200, Stefano Martini wrote:
> When I start the run program (mipsel-elf-run --board .....) to execute
> a example program I get the following error messages:
>
> mips-core: 1 byte read to unmapped address 0x0 at 0x800ab230
> mips-core: 4 byte read to unmapped address 0x0 at 0x0
> mips-core: 4 byte read to unmapped address 0x0 at 0x0
> mips-core: 4 byte read to unmapped address 0x0 at 0x0
> mips-core: 4 byte read to unmapped address 0x0 at 0x0
> mips-core: 4 byte read to unmapped address 0x0 at 0x0
>
> I have no address in region 0x0. Is this a problem
> related to virtual and physical addresses?
I'd say that you're probably trying to read virtual address 0x0, yes,
and it doesn't do what you are expecting, because there's nothing at
that virtual address.
> I think "physical address" is an address generated by the
> processor to access a memory region.
> What is a virtual address?
http://computing-dictionary.thefreedictionary.com/virtual%20memory
For an understanding of the MIPS architecture's handling of virtual
memory and address translation, I'd advise looking that the
MIPS{32,64} Architecture for Programmers manuals available from
www.mips.com.
That documentation is more "reference" than tutuorial though. If you
want more of a tutorial, I'd recommend See MIPS Run by Dominic
Sweetman.
cgd
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-04-28 16:48 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-23 16:03 new board Stefano Martini
[not found] ` <mailpost.1082724164.28332@news-sj1-1>
2004-04-23 17:23 ` cgd
2004-04-26 17:57 ` Stefano Martini
[not found] ` <001801c42b64$17649c10$2af21b9d@toti>
2004-04-26 18:12 ` cgd
2004-04-28 13:58 ` Stefano Martini
2004-04-29 0:32 ` cgd
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox