Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network support #23

Closed
copy opened this issue Jul 18, 2014 · 16 comments
Closed

Network support #23

copy opened this issue Jul 18, 2014 · 16 comments

Comments

@copy
Copy link
Owner

copy commented Jul 18, 2014

Network support would be a nice feature. The jor1k project is already running this successfully.

The emulated hardware could be ported from jsmodem (which is based on a UART, which we already have) or written from scratch. In the latter case, a network card that is supported by KolibriOS should be emulated.

Some feature ideas:

  • Internet connection using websockets
  • Local connection between two VM instances
  • Connect on demand (i.e., start the websocket as soon as it's needed, not on boot)
  • Rate limit the connection
@copy
Copy link
Owner Author

copy commented Jul 27, 2014

  • Integrate an FTP server (or something more fancy) to allow file exchange between browser (via FileSystem API) and VM

@s-macke
Copy link

s-macke commented Aug 21, 2014

The problem with integrating an standalone FTP server is, that you have to implement a full tcp stack in Javascript first including arp and probably dhcp.I am not sure, how easy that is. There are other options like shell control over uart ("ls", "cd", "dd", "cat", ...), an own Fuse driver, which interacts with the outer world or virtio/9p used in arm-js or jor1k. But all of the "easier" solutions work only under Linux.

@s-macke
Copy link

s-macke commented Aug 21, 2014

QEMU has an user mode udp/tcp/ip stack. You can find it in the directory "slirp" in the source code. 300kB of code. And it includes even an ftp server.

@copy
Copy link
Owner Author

copy commented Aug 30, 2014

You're right of course, building a complete network stack is going to be quite some effort to get working. FTP would have been nice because it works in KolibriOS and virtually any Linux distribution.

I'll probably need to look into the alternatives. Sharing code with other projects is of course always an option, as long as they're compatible with BSD (wink).

I'd prefer something that can be mounted (which is the case for FTP and virtio, but not transfer over UART).

@copy
Copy link
Owner Author

copy commented Dec 2, 2014

There's network support since 2fe66de. The server runs websockproxy, so it's already possible to make rate-limited connections to the internet. The emulated ne2k device works on Linux and KolibriOS.

Adding support for FTP or similar should be unnecessary, since we already have virtio/9p. Using the latter will be much easier if we want to implement file exchange between browser and emulated OS.

@copy copy closed this as completed Dec 2, 2014
@ysangkok
Copy link
Contributor

@copy Are there any plans to add network support to one of the images per default, like jor1k has? I couldn't get network support working with the existing ones.

@copy
Copy link
Owner Author

copy commented Feb 16, 2015

@ysangkok Network support is enabled in the (currently experimental) Archlinux image: http://copy.sh/v86/?profile=archlinux after running dhcpcd -w4

It should also work in KolibriOS, but there seems to be a bug right now. If you're interested, I could also build another small Linux image with some network tools.

@ysangkok
Copy link
Contributor

@copy
I got it to work in the Arch image using ifconfig and route. However, this is cumbersome. Do you know if there is a DHCP client installed? dhclient and udhcpc didn't work.

The ttylinux-5.3 image (kernel 2.6.16) from my other bug (the bug with the slow entropy collection) has busybox and it's embedded udhcpc DHCP client, and it works partially (the card emulation has bugs) in JPC (which emulates the same network card). However, when I launch udhcpc in v86, it doesn't work. SIOCGIFINDEX: No such device seems to suggest the device isn't recognized. I get the same issue in Scientific Linux 3.09 (kernel 2.4), which I have a 1GB harddisk image of. They both show an error in the kernel log: ne2k-pci: no I/O resource at PCI BAR #0. The ne2k-pci driver in Linux has hardly changed, so how come it works in Arch but not in these two others?

It works perfectly using ttylinux-2015.01 though: http://copy.sh/v86/?profile=custom&cdrom.url=http://k%C3%A6n.guru/files/ttylinux-pc_i486-2015.01.iso

@copy
Copy link
Owner Author

copy commented Feb 16, 2015

@ysangkok dhcpcd is a DHCP client (despite its name).

The fact that it doesn't seem to work in older Linuxes is a bug in the emulation of the ne2k card (or maybe in IO handling). I will look into this too.

@honzucha
Copy link

honzucha commented Mar 2, 2015

I can confirm, that it is not even working in latest Buildroot. same error: ne2k-pci: no I/O resource at PCI BAR #0

Kernel: 3.18.6

JAn

@copy
Copy link
Owner Author

copy commented Mar 2, 2015

@honzucha I can't reproduce this in the latest Buildroot. Could you send me the kernel config?

@honzucha
Copy link

honzucha commented Mar 2, 2015

@fabian, I have used default for i386.

https://bivault-my.sharepoint.com/personal/me_honzucha_me/_layouts/15/guestaccess.aspx?guestaccesstoken=eyX8R2e8ni2HyT9I%2brsYsWiMe%2fTZmOaKapHoefRZU0E%3d&docid=05189529e087d43e3a2ced797c93656ea


Od: Fabian [email protected]
Odesláno: 2. bøezna 2015 19:10
Komu: copy/v86
Kopie: Jan Anto¹
Pøedmìt: Re: [v86] Network support (#23)

@honzuchahttps://github.com/honzucha I can't reproduce this in the latest Buildroot. Could you send me the kernel config?

Reply to this email directly or view it on GitHubhttps://github.com//issues/23#issuecomment-76765812.

@honzucha
Copy link

honzucha commented Mar 2, 2015

Buildroot make menuconfig
Kernel -->
Kernel Configuration (Using a defconfig)
(i386) defconfig name

@copy
Copy link
Owner Author

copy commented Mar 2, 2015

I see. The problem is actually related to a recent change in the kernel in PCI bus handling (not network emulation). I'll fix it, thanks!

@magicgoose
Copy link

Sorry for "necroposting", but… Is it realistic to also make networking work in Windows 9x images? I guess it would be a lot of fun to walk around in Internet Explorer 5, for example…

@copy
Copy link
Owner Author

copy commented Jul 5, 2017

@magicgoose Yeah, that's possible. Not high on my priority list though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants