Using dcload-ip with Windows Subsystem for Linux

From dreamcast.wiki
Revision as of 18:13, 27 February 2020 by Neo (talk | contribs) (Created page with "{{MARKDOWN}} # WSL v2 : using dcload-ip with the BBA from WSL and Windows This tutorial has been tested on Windows 10 Insider Preview and Windows Subsystem for Linux (WSL) v2....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

WSL v2 : using dcload-ip with the BBA from WSL and Windows

This tutorial has been tested on Windows 10 Insider Preview and Windows Subsystem for Linux (WSL) v2. My Dreamcast is connected directly to a router that is also connected to my computer, the router is not plugged into anything else, and does not having greater network access, and using dcload-ip with a hardcoded static IP address.

Dreamcast side

Get a selfbooting version of dc-load-ip (in the "Releases" section). I've burned this with imgburn without any problem.

Next, boot dc-load-ip in your Dreamcast and make sure your BBA is connected in order to get your BBA mac address.

Once the green/blue screen appears (depending on version, moop: green, standard: blue), note down your MAC address. It should look something like : 10:04:5d:2b:0f:4d

Computer side (not necessary if using pre-built DHCP version)

We'll use the arp function to get your computer to "give" an IP address to your Dreamcast based on its mac address.

Under a Windows Terminal

First we need Administrator access to add an arp entry

Start-Process PowerShell –Verb RunAs

After you have this PowerShell instance open we will add our entry

New-NetNeighbor -InterfaceAlias "Ethernet" -IPAddress "[local IP address]" -LinkLayerAddress "[MAC address]"

  • If using Wifi, the interface alias is likely "Wi-Fi"

This is the command I use

New-NetNeighbor -InterfaceAlias "Ethernet" -IPAddress "192.168.2.200" -LinkLayerAddress "00-D0-F1-02-5E-8F"

This should be fairly straightword to modify for your needs and network setup. This will be a permanent addition which will persist across restarts and shutdowns.

Expected Output:

PS C:\WINDOWS\system32> New-NetNeighbor -InterfaceAlias "Ethernet"  -IPAddress "192.168.2.200" -LinkLayerAddress "00-D0-F1-02-5E-8F"

ifIndex IPAddress         LinkLayerAddress      State       PolicyStore
------- ---------         ----------------      -----       -----------
18      192.168.2.200     00-D0-F1-02-5E-8F     Permanent   ActiveStore
18      192.168.2.200     00-D0-F1-02-5E-8F     Permanent   PersistentStore

Notes

[local IP address] is any valid IP address that you want to assign to your Dreamcast

[MAC address] is your dreamcast's MAC address, look at step 2.

the local IP address should be in the same range as your network. In my setup, my ethernet port is set on port 192.168.5.100 and my [local IP address] is 192.168.5.99. If you don't know your network range, you can use ifconfig in a terminal to find out. I wont cover this here.

The following can be executed from within Windows or WSL (Linux)

At this point, you should be able to see if your Dreamcast is connected.

A simple ping command should do the job.

ping [local IP address]

you should get a message like : 64 byte from [local IP address] .... blabla ... time=xx ms

Testing your code

You can now use the dc-tool-ip program to send your file to the DC. Make sure your Dreamcast is running dc-load-ip.

dc-tool-ip -t [local IP address] -x /path/to/your/.bin/or/.elf/file

You can always run dc-tool-ip without any command to get some info on how to run it. The -c option is useful if you need to use files that are located on your pc. You can use them with the /pc path.

Notes (for non-DHCP use)

Adding a host name (Linux)

Also, you can add a line to your host file in order to replace [local IP address] to a more friendly name.

sudo nano /etc/hosts then adding the line : dreamcast [local IP address]

Adding a host name (Windows)

  1. Press the Windows key.
  2. Type Notepad in the search field.
  3. In the search results, right-click Notepad and select Run as administrator.
  4. From Notepad, open the following file:

c:\Windows\System32\Drivers\etc\hosts

  1. Add a new entry to the file.
  2. eg. dreamcast [local IP address] on a newline
  3. Select File > Save to save your changes.

You can now refer do dreamcast instead of your usual [local IP adress]

Other info at CubicVR