This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: questions about gdb sim/mips/*


I received the msg below via private mail, have fwded it to the gdb
list w/ permission, in the hopes that other might be able to answer
some questions that were raised, and/or so that others might be
informed by the answers.


At 05 Mar 2004 16:35:21 +0100, Emmanuel Michon wrote:
> 1. Do you know if there is a connection between this simulator and
> the sde-run run tool found in MIPS software development kit, that seems
> to be a modified gcc/gdb toolchain?

I don't know.  It is possible that they have enhanced the GDB
simulator, but, if so, as far as I'm aware they have never submitted
the changes to the gdb-related mailing lists.


> 2. MIPS usually boots in kernel mode at virtual address 0xbfc00000 after
> coldreset but the simulator always discards the regular boot process by
> overriding PC with the address it gets after reading elf file. Is there
> a reason for doing so?

Well, I didn't write the code, but I can hazard a guess:

In a nutshell, because it's most convenient.

The simulator in GDB is most often used to run code compiled by GCC,
and is typically run with no boot loader or monitor (other than the
monitor stubs that are used by newlib).  Without a monitor, there's no
way *to* get to a loaded program's entry point.

We (Broadcom/SiByte) put a mode into our version of the simulator that
disables the monitor stubs and jumps straight to the boot vector no
matter what is loaded.  We contributed that as part of a large drop of
code a while back, but, well, I've never had time to try to integrate
it into the master sim sources.  It's just not very useful for most
purposes.

(I thought A.C. was going to put a copy of those contributed bits up
in ftp://sources.redhat.com/pub/gdb/contrib/, but it doesn't look like
they made it.  Anyway, http://sibyte.broadcom.com/public/resources/
has some tools sources, which include a version of GDB with lots of
mods.)


> 3. Where could I find synthetic documentation about the supported
> boards jmr3904|jmr3904pal|jmr3904debug|bsp
> and rom monitors idt|pmon|lsipmon|none ?

I don't know the answer to most of that.  I know that there are PMON
sources out there on the web:

        http://www.carmel.com/pmon/index.html

(do not be distracted by PMON/2000 -- it's not got what you want.)


> They seem to define different memory layouts, and I would like to be as
> close as possible to a completely empty map.

Right.  (We implemented a "noboard" option do do that.)


> 4. My purpose is to run mips newlib binaries on this simulator somehow,
> or even boot a linux kernel or other operating system. Is there some
> major blocker against this?

yes, several.

First of all, if you want to run newlib binaries: newlib binaries need
some monitor for I/O.  If you get rid of the rom monitor stubs, have
no hardware devices in your simulator, and/or haven't modified newlib
to use said hardware, you'll have trouble getting the programs'
output.

As for a linux kernel, well, the biggest problem is one of CP0: the
simulator as it currently stands doesn't implement much of CP0.

(In our simulator, as mentioned above, we do have a full CP0
implementation, and simulation for lots of hardware devices -- to the
point that we can boot multiprocessor linux on the simulator, hook the
simulator up to a live network, telnet in, etc.  I'd love to see some
of this -- starting with the the CP0 and FPU improvmements -- ported
to the master sim sources, but have very little time to do it myself.)


chris

At 05 Mar 2004 16:35:21 +0100, Emmanuel Michon wrote:
> Hi,
> 
> I'm using the MIPS simulator found in current gdb for testing
> code of a MIPS R4KEc and I think you may be able to answer some
> questions about it.
> 
> 1. Do you know if there is a connection between this simulator and
> the sde-run run tool found in MIPS software development kit, that seems
> to be a modified gcc/gdb toolchain?
> 
> 2. MIPS usually boots in kernel mode at virtual address 0xbfc00000 after
> coldreset but the simulator always discards the regular boot process by
> overriding PC with the address it gets after reading elf file. Is there
> a reason for doing so?
> 
> 3. Where could I find synthetic documentation about the supported
> boards jmr3904|jmr3904pal|jmr3904debug|bsp
> and rom monitors idt|pmon|lsipmon|none ?
> 
> They seem to define different memory layouts, and I would like to be as
> close as possible to a completely empty map.
> 
> 4. My purpose is to run mips newlib binaries on this simulator somehow,
> or even boot a linux kernel or other operating system. Is there some
> major blocker against this?
> 
> Thanks a lot for your help,
> 
> Sincerely yours,
> 
> E.M.
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]