Open Azure-stars opened 1 month ago
Starry 已经支持和同局域网下的其他主机通信,但是目前不支持和所在的主机(IP 为 10.0.2.2)通信。
hello_world测例运行方式:
hello_world
在主机上运行:
$ netcat -l -p 6142
在 QEMU 中将 Starry 执行指令修改为:./hello_world,并且运行如下指令:
./hello_world
```sh $ make A=apps/monolithic_userboot LOG=info FEATURES=img,sched_rr ACCEL=n APP_FEATURES=batch run NET_DUMP=y ``` 这里的`hello_world`是修改了源码,将目标地址从`127.0.0.1:6142`改为了`10.0.2.2:6142`,从而能够让 QEMU 访问主机上某一个端口。(原理是 QEMU 自己建立了一个子网,10.0.2.15是它的地址,10.0.2.2 是网关(本机)的地址) 在当前的 Starry,他会在第一次 connect 返回 EINPROGRESS 之后进入 Futex,但是始终不会解锁。分析 Linux 上该程序的表现发现虽然也是返回 EINPROGRESS,但是 Futex 不久之后就会解锁,从而完成链接。这里关键是解决 Futex 为何不解锁的问题。
另外还有一个测例:echo_outside,运行方式为:
echo_outside
$ ./connect 127.0.0.1:8080
在 QEMU 中将 Starry 执行指令修改为:./echo_outside,并且运行如下指令:
./echo_outside
$ make A=apps/monolithic_userboot LOG=info FEATURES=img,sched_rr ACCEL=n APP_FEATURES=batch run NET_DUMP=y
其中echo_outside是将 echo.rs 的源码的目标地址从 127.0.0.1 修改为 10.0.2.2 之后编译成的可执行文件。在主机上进行输入,期望能够在按下回车之后将输入内容重新输出。但 Starry 目前无法完成链接。
echo.rs
原来的实现,先进行本地回环的poll,再进行以太网卡的poll。有些包会被本地回环先取走,但是如果不是 127.0.0.1 的包,取走了是无法处理的,导致丢包。两个poll 的顺序对调,目的就是让 eth 先取,但是这样也会有相同的丢包问题,能暂时性通过测例。不能从根本解决问题。
涉及PR
Starry 已经支持和同局域网下的其他主机通信,但是目前不支持和所在的主机(IP 为 10.0.2.2)通信。
hello_world
测例运行方式:在主机上运行:
在 QEMU 中将 Starry 执行指令修改为:
./hello_world
,并且运行如下指令:另外还有一个测例:
echo_outside
,运行方式为:在主机上运行:
在 QEMU 中将 Starry 执行指令修改为:
./echo_outside
,并且运行如下指令:其中
echo_outside
是将echo.rs
的源码的目标地址从 127.0.0.1 修改为 10.0.2.2 之后编译成的可执行文件。在主机上进行输入,期望能够在按下回车之后将输入内容重新输出。但 Starry 目前无法完成链接。