ansi c library support

we are using cypress fx-2 development
board which has an evaluation version of c-51
compiler (for 8051 microcontroller).

we want to include ansi c library functions like fread, fwrite , malloc etc and compile
the code and port it into the target board.

bcause the above mentioned ansi c library
is not supported by c-51, is there any other
way of acheiving the ansi c library porting?
if so, then please explain how..

also, will it run on the 8051 microcontroller?
Urgent reply is appreciated.

Regards,
mahesh

Parents
  • You have not stated what your "file I/O" requirements are, so I thought I'd throw something else in the mix here.

    On the few projects where it made sense to do so, I have implemented C's file I/O semantics using an RPC model where fopen, fread, fwrite, etc. on the 8051 side are RPC client stubs marshalling the requests over some communication channel to a RPC server process running on a PC. It works a little like this:

    The client application calls a local procedure stub instead of the actual code implementing the procedure. Stubs are compiled and linked with the client application. Instead of containing the actual code that implements the remote procedure, the client stub code:

    1. Retrieves the required parameters from the client address space.
    2. Translates the parameters as needed into an external data representation (XDR) format for transmission over a communications channel.
    3. Calls functions in the RPC client run-time library to send the request and its parameters to the remote server.
    The server performs the following steps to call the remote procedure.
    1. The server RPC run-time library functions accept the request and call the server stub procedure.
    2. The server stub retrieves the parameters from the communications buffer and converts them from the external transmission format to the format the server needs.
    3. The server stub calls the actual procedure on the server.
    The remote procedure then runs, possibly generating output parameters and a return value. When the remote procedure is complete, a similar sequence of steps may return the data to the client.
    1. The remote procedure returns its data (if any) to the server stub.
    2. The server stub converts any output parameters to the format required for transmission over the communication channel and returns them to the RPC server.
    3. The server RPC run-time library functions transmit the data on the communication channel to the client system.
    The client completes the process by accepting the data over the communication channel and returning it to the calling function.
    1. The client RPC run-time library receives the remote-procedure return values and returns them to the client stub.
    2. The client stub converts the data from its external data representation to the format used by the client system. The stub writes data into the client memory and returns the result to the calling program on the client.
    3. The calling procedure unblocks and continues as if the procedure had been called on the same system.
    Now, wasn't that fun?

Reply Children
More questions in this forum