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

See the CrossGCC FAQ for lots more information.


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: Re: gcc on an OS less system


"Viswanathan Sankararam" <vishu27@cox.net> wrote:

> Is there any way I can confirm if this is working. When I run an object
> created with the -specs=redboot.specs option with the arm simulator
> xscale-elf-run, It hangs saying 
> 
> sim: unknown SWI encountered - 0 - ignoring

 You should learn to experiment with your tools!  A very common habit
is to try the '--help' option with every GNU tool, it should work almost
always, if not then something useful might appear :

---------------------------- clip -----------------------------------------------------------
$ arm-elf-run-5.3 --help
run-arm-elf-5.3: invalid option -- -
Usage: run-arm-elf-5.3 [options] program [program args]
Options:
-a args         Pass `args' to simulator.
-m size         Set memory size of simulator, in bytes.
-t              Perform instruction tracing.
                Note: Very few simulators support tracing.
-v              Verbose output.

program args    Arguments to pass to simulated program.
                Note: Very few simulators support this.

Target specific options:
--swi-support=<list>  Comma seperated list of SWI protocols to supoport.
                This list can contain: NONE, DEMON, ANGEL, REDBOOT and/or ALL.
---------------------------- clip -----------------------------------------------------------

 With RedBoot you maybe must use the '--swi-support=REDBOOT' in order to
get the RedBoot SWIs to be simulated. Must try by myself too...

 So the sim only simulates these environments, so if you produce executables for
your own environment, they will not work there. Demon is not supported with XScale
(say the sim sources...)

 In order to change this behaviour, you should modify the 'armos.c' and
implement your own environment there. How hard this will be, is unclear,
anyhow the Angel/Demon, RedBoot etc. SWI-handling should be easily
found there:

---------------------------- clip -----------------------------------------------------------
/* The emulator calls this routine when a SWI instruction is encuntered.
   The parameter passed is the SWI number (lower 24 bits of the instruction).  *
/

unsigned
ARMul_OSHandleSWI (ARMul_State * state, ARMword number)
{
  struct OSblock * OSptr = (struct OSblock *) state->OSptr;
  int              unhandled = FALSE;

  switch (number)
    {
    case SWI_Read:
      if (swi_mask & SWI_MASK_DEMON)
        SWIread (state, state->Reg[0], state->Reg[1], state->Reg[2]);
      else
        unhandled = TRUE;
      break;

    case SWI_Write:
      if (swi_mask & SWI_MASK_DEMON)
        SWIwrite (state, state->Reg[0], state->Reg[1], state->Reg[2]);
      else
        unhandled = TRUE;
      break;

    case SWI_Open:
---------------------------- clip -----------------------------------------------------------

 BTW, the ' encuntered' probably should be 'encountered' or my "bad
English" is wrong (the bad dual-personality allways noticing all errors
like this and "cunt" is something very naughty, but my vocabulary didn't
tell what this "encunt" means...  Maybe the Demon, not the Angel uses
words like this :-)

Cheers, Kai
 

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


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