This is the mail archive of the crossgcc@sourceware.cygnus.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


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

Re: Setting up crt0 and libs for arm-unknown-coff


Richard Earnshaw writes:
> 
> 
> scott@CS.Princeton.EDU said:
> > There are no link errors.  However, I know that my UART code is not in
> > the executable.  When I run the code, I get a "software interrupt". My
> > guess is that the library is making some incorrect assumptions about
> > the underlying environment.  (This software interrupt sounds
> > suspiciously like a system call.)
> 
> > How can I use my simple little polling UART routines for stdio?
> 
> 
> Newlib's libc is written using the "user+OS" mode, where accessing IO 
> devices is considered a privileged operation that has to be performed by 
> the operating system.  The normal method for communicating with the 
> operating system in these circumstances is to call a software interrupt 
> (SWI) that asks the OS to perform the required action.  To make newlib 
> tickle your UART routines you will either have to map the underlying SWI 
> handler to call your code, or you will have to rewrite the OS bits of 
> newlib to call your routines directly.  Take a look in new/libc/sys/arm 
> for details.

Thank you again for another helpful response.  The board I am using has
a loader pulls a coff image into memory and runs it.  The code I will
write will completely take control of the processor.  To make a clean
interface with newlib, it sounds like I should write my own SWI handler.
This way I won't need to make changes to newlib.

The files in newlib/libc/sys/arm seem to implement the "user" side
of the interface.  Before I write my own, is there source available
which implements the "OS" side?  Is there a published interface
document for this?

Thanks,
Scott



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


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