[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] Problems with MiniOS and lwIP (daytime server)

Hello, I want to start by saying that I'm really new with the platform (like 3 days of research), but i stumbled upon a problem i can't fix. I hope this won't be considered spam :)

Anyway, my problem is pretty simple probably. I'm trying to access the daytime server, which is ran default when compiling with lwIPÂ

I looked inside the source of daytime.c and I saw that the setting up of an IP address is disabled with an "if(0) { ... }" construct, so I changed that and set my ip to: like this:


  if (1) {
    struct ip_addr ipaddr = { htonl(0x0a00020A) };
    struct ip_addr netmask = { htonl(0xffffff00) };
    struct ip_addr gw = { 0 };
    networking_set_addr(&ipaddr, &netmask, &gw);

The compiling is fine (though I also have something to say about this, but in the footer of the mail).

I start the VM, with xl create domain_config, which looks like this:
kernel = "mini-os.gz"
memory = 32
name = "Mini-OS"

I go into the console, and it all seems fine:

mac is 00:16:3e:70:4a:02
[server] IP 0 netmask 0 gateway 0.
[server] TCP/IP bringup begins.
Thread "tcpip_thread": pointer: 0x00000000000ca738, stack: 0x0000000000220000
[tcpip_thread] TCP/IP bringup ends.
[server] Network is ready.
[server] Opening connection
[server] Connection at 0000000000042820

This is where I'm lost a little. I try to ping and it works!

root@ubuntuZen:/home/mihai/xen/extras/mini-os# ping
PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=255 time=0.546 ms
64 bytes from icmp_seq=2 ttl=255 time=0.189 ms
64 bytes from icmp_seq=3 ttl=255 time=0.142 ms
64 bytes from icmp_seq=4 ttl=255 time=0.247 ms

But when I try to connect to nothing happens.
My netcat just hangs, but it hangs on all ports, not just 13. I have to ctrl+c it so it dies, so it's not like the connection is rejected. But, on the console, nothing is printed. I even put a little print code after theÂ

session = netconn_accept(listener);Â

part, so it shows me when that function has returned a "session", thus the connection is understood, but it never gets there, the function just blocks and never returns.

Here's the entire code, if you think I've done something wrong:Âhttp://pastebin.com/riuh5n0w

I tried to look with nmap, and all ports are closed.

Alright, besides that I also have a few other issues.

1. First of all, I couldn't compile mini-os outside of /home/user/xen/extras/mini-os directory. If I want to put my mini-os in /home/user/mini-os and use the enviorment variable XEN_ROOT=/home/user/xen I get compiling problems when trying to use LWIP. I can compile just fine without it, but when setting the LWIPDIR variable, I get the this:

/home/mihai/mini-os/include/netfront.h:4:31: fatal error: lwip/netif/etharp.h: No such file or directory
Â#include <lwip/netif/etharp.h>

If I compile from inside xen/extras/mini-os directory, it works just fine. I'm haven't investigated a lot, but since mini-os is now a separate project from Xen, and this is probably some hardcoded pathing thing, it probably should work to compile, without solving the dependenices on your own, out of the box, from anywhere.

2. I saw that Mini-OS supports lwip1.3.2, but the last version is 1.4.1. I tried using that, but some function headers have been changed, specificallyÂ

- struct netconn *netconn_accept (struct netconn *) to err_t netconn_accept(struct netconn*, struct netconn**);

When I change it in daytime.c, I also get thisÂ

/home/mihai/lwip-1.4.1//src/core/dhcp.c: In function âdhcp_cleanupâ:
/home/mihai/lwip-1.4.1//src/core/dhcp.c:611:5: error: implicit declaration of function âfreeâ [-Werror=implicit-function-declaration]

I tried to see why in version 1.3.2 caling mem_free is okay, but here calling it calls free, which is "undeclared". Anyway, this isn't really a problem, but I though as a rule of thumb that if you use a library, you should update your code accordingly to the library's updates and it seems like pretty trivial changes for someone who's already a developer for the project.

Sorry if the question is 'stupid' or the suggestions are bad, I'm new to both projects (mini os and lwip) and I'm just trying to learn.Â

Minios-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.