SLIP Support Request

Kernel, Main, Utilities & Applications, Miscellaneous Devices.
User avatar
thera34
Posts: 132
Joined: Fri Sep 11, 2020 7:51 am
Has thanked: 96 times
Been thanked: 89 times

SLIP Support Request

Unread post by thera34 »

Hello,

Long story short:
SLIP/CSLIP (pre-PPP connections) can be used by some older OSes to connect to Internet and I am wandering if it would be possible to get this option among the PPP/modem/console ones in the OSD for cores who support UART (C64/Minimig/ao486/ST etc) ? And what else would it take except the Linux image and /sbin/uartmode script modifications ?


What I did to get SLIP/CSLIP support (again, thank you @BinaryBond007) :

Linux side - modified /arch/arm/configs/MiSTer_defconfig to include:

Code: Select all

CONFIG_SLIP=y
CONFIG_SLIP_COMPRESSED=y
CONFIG_SLIP_SMART=y
CONFIG_SLIP_MODE_SLIP6=y
After compilation and replacement of Linux image, SSH-ed into MiSTer, and did a trick like "echo 115200 > /tmp/SLIP" then modified the /sbin/uartmode to start slattach instead of pppd

Code: Select all

slip_speed=$(cat /tmp/SLIP)
taskset 1 slattach -p slip -s $slip_speed /dev/ttyS1  
ifconfig sl0 $localip pointopoint $remoteip                    
echo "Starting slip @ $slip_speed BPS..."
On FPGA side, fired up a0486 core, ran ELKS (a minix/Unix variant) and established SLIP connection with the Linux side without issues using its embedded ktcp client.

Now, I know this is a niche stuff for networking supporting cores, but I would like to see it as an option if possible :)
Malor
Top Contributor
Posts: 860
Joined: Wed Feb 09, 2022 11:50 pm
Has thanked: 64 times
Been thanked: 194 times

Re: SLIP Support Request

Unread post by Malor »

IIRC, SLIP was supplanted fairly quickly by PPP. Are there OSes that have SLIP clients but can't talk PPP at all? Pretty much anything that runs SLIP should be physically capable of PPP, if a software client was written.
bbond007
Top Contributor
Posts: 531
Joined: Tue May 26, 2020 5:06 am
Has thanked: 87 times
Been thanked: 211 times

Re: SLIP Support Request

Unread post by bbond007 »

Malor wrote: Wed Aug 31, 2022 8:32 pm IIRC, SLIP was supplanted fairly quickly by PPP. Are there OSes that have SLIP clients but can't talk PPP at all? Pretty much anything that runs SLIP should be physically capable of PPP, if a software client was written.
I know of at least OS/2 2.0 which is the only version that runs (on ao486) with both caches enabled.
thera34 wrote: Wed Aug 31, 2022 5:46 pm And what else would it take except the Linux image and /sbin/uartmode script modifications ?
In addition Main_MiSTer would need to be updated to add a SLIP option for it to appear in the UART OSD along with the other options. That is something I could do if there is interest.
throAU
Posts: 181
Joined: Fri Sep 11, 2020 1:06 am
Has thanked: 233 times
Been thanked: 27 times

Re: SLIP Support Request

Unread post by throAU »

bbond007 wrote: Wed Aug 31, 2022 9:48 pm
Malor wrote: Wed Aug 31, 2022 8:32 pm IIRC, SLIP was supplanted fairly quickly by PPP. Are there OSes that have SLIP clients but can't talk PPP at all? Pretty much anything that runs SLIP should be physically capable of PPP, if a software client was written.
I know of at least OS/2 2.0 which is the only version that runs (on ao486) with both caches enabled.
thera34 wrote: Wed Aug 31, 2022 5:46 pm And what else would it take except the Linux image and /sbin/uartmode script modifications ?
In addition Main_MiSTer would need to be updated to add a SLIP option for it to appear in the UART OSD along with the other options. That is something I could do if there is interest.
Wouldn't OS/2 be better served by adding a network adapter to AO486?

edit:
thinking a bridge to the physical adapter on the DE10. no idea how feasible that is, but most OS that support networking/internet for PC support ethernet? Ethernet you can use for accessing local resources on the LAN, too, and get better speed than SLIP/PPP?
kconger
Posts: 100
Joined: Sun Sep 12, 2021 2:58 am
Has thanked: 134 times
Been thanked: 91 times

Re: SLIP Support Request

Unread post by kconger »

thera34 wrote: Wed Aug 31, 2022 5:46 pm Hello,

Long story short:
SLIP/CSLIP (pre-PPP connections) can be used by some older OSes to connect to Internet and I am wandering if it would be possible to get this option among the PPP/modem/console ones in the OSD for cores who support UART (C64/Minimig/ao486/ST etc) ? And what else would it take except the Linux image and /sbin/uartmode script modifications ?


What I did to get SLIP/CSLIP support (again, thank you @BinaryBond007) :

Linux side - modified /arch/arm/configs/MiSTer_defconfig to include:

Code: Select all

CONFIG_SLIP=y
CONFIG_SLIP_COMPRESSED=y
CONFIG_SLIP_SMART=y
CONFIG_SLIP_MODE_SLIP6=y
After compilation and replacement of Linux image, SSH-ed into MiSTer, and did a trick like "echo 115200 > /tmp/SLIP" then modified the /sbin/uartmode to start slattach instead of pppd

Code: Select all

slip_speed=$(cat /tmp/SLIP)
taskset 1 slattach -p slip -s $slip_speed /dev/ttyS1  
ifconfig sl0 $localip pointopoint $remoteip                    
echo "Starting slip @ $slip_speed BPS..."
On FPGA side, fired up a0486 core, ran ELKS (a minix/Unix variant) and established SLIP connection with the Linux side without issues using its embedded ktcp client.

Now, I know this is a niche stuff for networking supporting cores, but I would like to see it as an option if possible :)
I can help with a PR for this as I would also like to see SLIP support.

https://github.com/kconger/Linux-Kernel ... /tree/SLIP
https://github.com/kconger/Main_MiSTer/tree/SLIP
https://github.com/kconger/MidiLink_MiSTer/tree/SLIP

Can others confirm this works? Attached is a new MiSTer binary, kernel, and uartmode script.
Attachments
SLIP-MiSTer.zip
(6.26 MiB) Downloaded 135 times
User avatar
thera34
Posts: 132
Joined: Fri Sep 11, 2020 7:51 am
Has thanked: 96 times
Been thanked: 89 times

Re: SLIP Support Request

Unread post by thera34 »

kconger wrote: Thu Sep 01, 2022 2:10 am I can help with a PR for this as I would also like to see SLIP support.

https://github.com/kconger/Linux-Kernel ... /tree/SLIP
https://github.com/kconger/Main_MiSTer/tree/SLIP
https://github.com/kconger/MidiLink_MiSTer/tree/SLIP

I haven't built a kernel to test but these changes appear to work. Can others confirm this works? Attached is a new MiSTer binary and uartmode script.
SLIP-MiSTer.zip
Thank you mate, I will try it after work hours :)
I am attaching also here the Linux image I compiled yesterday for SLIP/CSLIP support:
zImage_dtb.zip
(5.62 MiB) Downloaded 124 times
throAU wrote: Thu Sep 01, 2022 1:52 am Wouldn't OS/2 be better served by adding a network adapter to AO486?
Yeah, network adapter would be a nice addition to Minimig/Ao486 cores for sure, but someone has to write it and I am not sure it will fit , as I understood there's no more FPGA space left..
rampa
Posts: 29
Joined: Sat Jun 06, 2020 5:25 pm
Has thanked: 6 times
Been thanked: 43 times

Re: SLIP Support Request

Unread post by rampa »

Thank you for this patch. I'm finishing a port from pdp2011 (PDP 11) and I need slip for networking on bsd2.11
rampa
Posts: 29
Joined: Sat Jun 06, 2020 5:25 pm
Has thanked: 6 times
Been thanked: 43 times

Re: SLIP Support Request

Unread post by rampa »

Tested and works but.....

1-You are configuring SLIP as a point to point between the mister ethernet IP and the router... So when you connect you loose the default route on the mister... changed in uamode the ifconfig line to :

ifconfig sl0 192.168.4.1 pointopoint 192.168.4.2 up

and it worked... (i can ping and ftp from the fpga bsd box to the mister)

2- There is no nat on the mister kernel. so cannot ping outside of the mister. :(

One possible approach is to compile SLIRP for the ARM and change uartmode to use slirp instead of pppd and slattach. I used this on the 90's (on a medium size isp and it worked like a charm. It is userspace and provides slip and ppp doing interrnal nat.

https://github.com/kost/slirp
User avatar
thera34
Posts: 132
Joined: Fri Sep 11, 2020 7:51 am
Has thanked: 96 times
Been thanked: 89 times

Re: SLIP Support Request

Unread post by thera34 »

rampa wrote: Sun Nov 27, 2022 10:00 am Tested and works but.....

1-You are configuring SLIP as a point to point between the mister ethernet IP and the router... So when you connect you loose the default route on the mister... changed in uamode the ifconfig line to :

ifconfig sl0 192.168.4.1 pointopoint 192.168.4.2 up
No, we configured SLIP as point to point between MiSTer's eth IP ($localip, for example mine is hardcoded .25) and core's IP ( $remoteip, normally .254 if not set otherwise on /media/fat/linux/ppp_options)

See below code:

Code: Select all

	if [ ! -f /tmp/uartmode5 ]; then
		kill_all
		echo "1" >/tmp/uartmode5
		(
			while true
			do
				echo In while
				localip=$(ifconfig 2>/dev/null | sed -En 's/127.0.0.1//;s/169.254.*//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p')
				remoteip=$(ifconfig 2>/dev/null | sed -En 's/127.0.0.1//;s/169.254.*//;s/.*inet (addr:)?(([0-9]*\.){2}[0-9]*).*/\2/p').254

				if [ -z $localip ]; then
					echo cannot get local IP for SLIP link.
					localip=0.0.0.0
					remoteip=0.0.0.0
				else
					echo "SLIP link: $localip->$remoteip @$conn_speed"
				fi
				taskset 1 slattach -p slip -s $conn_speed /dev/ttyS1 &
				ifconfig sl0 $localip pointopoint $remoteip                    
				wait $!
				[ ! -f /tmp/uartmode5 ] && exit 0

				echo respawn slattach
				sleep 1
			done
		) &
    fi
rampa
Posts: 29
Joined: Sat Jun 06, 2020 5:25 pm
Has thanked: 6 times
Been thanked: 43 times

Re: SLIP Support Request

Unread post by rampa »

ah, ok.... 254 is my router.... :-)

For point to point links, better use another class as they are only useful for routing.
rampa
Posts: 29
Joined: Sat Jun 06, 2020 5:25 pm
Has thanked: 6 times
Been thanked: 43 times

Re: SLIP Support Request

Unread post by rampa »

got routing....

changed the .254 to another IP.
added a static arp to the ip and the mac address from mister : arp -s 10.72.69.166 02:03:04:05:06:07
and permited routing on mister: sysctl net.ipv4.ip_forward=1
kconger
Posts: 100
Joined: Sun Sep 12, 2021 2:58 am
Has thanked: 134 times
Been thanked: 91 times

Re: SLIP Support Request

Unread post by kconger »

rampa wrote: Sun Nov 27, 2022 7:55 pm

got routing....

changed the .254 to another IP.
added a static arp to the ip and the mac address from mister : arp -s 10.72.69.166 02:03:04:05:06:07
and permited routing on mister: sysctl net.ipv4.ip_forward=1

@rampa Congrats on the pdp2011 release! Maybe it's time to try to submit my PR. Did you need to make any additional changes to what we worked out? I've only tested with ELKS operating system on AO486.

rampa
Posts: 29
Joined: Sat Jun 06, 2020 5:25 pm
Has thanked: 6 times
Been thanked: 43 times

Re: SLIP Support Request

Unread post by rampa »

can browse the internet with AO486 "as-is"?

i needed some changes, but may be my old idea of slip.

PPP is doing "proxyarp" so the machine is announcing the slip IP with the arp address of the ethernet. so i changed two things on the script. The 254 address (as it was my router) and added a static arp entry with the slip machine IP and the mister ethernet address.

If you can browse the internet without this. should be OK (and i have to investigate)

Thank you very much!

rampa
Posts: 29
Joined: Sat Jun 06, 2020 5:25 pm
Has thanked: 6 times
Been thanked: 43 times

Re: SLIP Support Request

Unread post by rampa »

Code: Select all

# Add an entry to this system's ARP [Address Resolution Protocol]
# table with the IP address of the peer and the Ethernet address of this
# system.
proxyarp

excerpt of /media/fat/linux/ppp-options

Post Reply