using PPP on sparc / erc32 simulator

Tiemen Schut T.Schut at sron.nl
Wed Mar 31 10:04:22 UTC 2010


Dear list,

I'm trying to use the erc32 simulator provided in gdb to simulate my images. This is all going very well, setting up and using the simulator was surprisingly easy.

However, on my real target I also use an ethernet interface, which the simulator does not have. At first I though about implementing my own simulated ethernet device, but that looks like it's going to be a *lot* of work.

Fortunately, the simulator does support up to two uarts. So, I though to use PPP on one of the simulated uarts and then somehow make this uart connect to a tty device on my Linux pc. Please note that all this PPP stuff is very new for me, so it's quite possible that I'm doing some or more things fundamentally wrong. If so, please correct me :)

I was thinking that it would be possible to use the rtems PPP driver as if it were an ethernet driver. So, when building for the real target I have something like:

static struct rtems_bsdnet_ifconfig gNetdriverConfig = { 
    (char *)"gr_eth1",              // name 
    RTEMS_BSP_NETWORK_DRIVER_ATTACH,// attach 
    NULL,
    (char *)DEFAULT_IP_ADDR,        // ip_address 
    (char *)DEFAULT_IP_NETMASK,     // ip_netmask 
};

And when building for the simulator I have (based on the pppd example, don't know if it's even close to correct):

extern "C" int rtems_ppp_driver_attach(struct rtems_bsdnet_ifconfig *config, int attaching);
static struct rtems_bsdnet_ifconfig gNetdriverConfig = { 
    (char *)"ppp0",                 /* name */
    rtems_ppp_driver_attach,        /* attach function */
    NULL,                           /* link to next interface */
    NULL,                           /* ip_address */
    NULL,                           /* ip_netmask */
    NULL,
    0
};

This seems to do *something*. However, as the interface doesn't have an IP address whatsoever I don't seem to be able to bind a socket to it, so I don't get how that would be supposed to work. If I do provide an IP address in the above struct, rtems will tell me:

Can't set default route: Network is unreachable

as soon as I call rtems_bsdnet_initialize_network().

I'm kinda lost here, any help or hints would be appreciated.

Thanks,

Tiemen





More information about the users mailing list