Has anyone successfully built the toolchain in Windows Subsystem for Linux?

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
User avatar
ThePerfectK
Insane DCEmu
Insane DCEmu
Posts: 147
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Thu Apr 27, 2006 10:15 am
Has thanked: 27 times
Been thanked: 35 times

Has anyone successfully built the toolchain in Windows Subsystem for Linux?

Post by ThePerfectK »

I tried my hand at it the other day and ran into all sorts of file permission errors every step of the way. In the end, I was never able to actually compile code this way. I've installed the toolchain in Linux before hundreds of times - both real distros and on virtual machines, and I've also installed the toolchain in cygwin so I'm pretty sure I knew what I was doing but still wasn't able to get anything working. It felt like anytime I needed to edit or make changes to a file, I'd get permission errors and would have to manually go and change the permission of a folder of file to advance. Eventually the permission errors became too numerous and ground me to a halt. Even stuff not necessarily related to the toochain, like installing an X server and xubuntu-desktop over WSFL met me with permission errors.

Did I do something wrong, or has no one else had success with WSFL?
Still Thinking!~~
mrneo240
DCEmu Freak
DCEmu Freak
Posts: 86
Joined: Wed Mar 14, 2018 12:22 am
Has thanked: 16 times
Been thanked: 19 times

Re: Has anyone successfully built the toolchain in Windows Subsystem for Linux?

Post by mrneo240 »

Yes. Also you can utilize docker containers as well in WSL v2 which makes setup a single line and zero setup
nymus
DC Developer
DC Developer
Posts: 968
Joined: Tue Feb 11, 2003 4:12 pm
Location: In a Dream
Has thanked: 5 times
Been thanked: 6 times

Re: Has anyone successfully built the toolchain in Windows Subsystem for Linux?

Post by nymus »

Here's a short guide from our Crabby Overlord as well as the initial effort from someone who succeeded in doing this.

http://gamedev.allusion.net/softprj/kos/setup-wsl.php

https://dcemulation.org/phpBB/viewtopic ... 0#p1054980
These users thanked the author nymus for the post:
BlueCrab
behold the mind
inspired by Dreamcast
User avatar
ThePerfectK
Insane DCEmu
Insane DCEmu
Posts: 147
Joined: Thu Apr 27, 2006 10:15 am
Has thanked: 27 times
Been thanked: 35 times

Re: Has anyone successfully built the toolchain in Windows Subsystem for Linux?

Post by ThePerfectK »

Well I tried again today, but ran into a problem where WSFL doesn't implement the function "memfd_open()" in the windows subsystem for linux kernel, which is what Redream uses to mount and launch certain types of elf files. The entire reason for trying to use WSFL was to get GDB debugging with redream working under linux, so that's a wash until that function is implemented. Bummer!
Still Thinking!~~
mrneo240
DCEmu Freak
DCEmu Freak
Posts: 86
Joined: Wed Mar 14, 2018 12:22 am
Has thanked: 16 times
Been thanked: 19 times

Re: Has anyone successfully built the toolchain in Windows Subsystem for Linux?

Post by mrneo240 »

Does redream work headless?
User avatar
ThePerfectK
Insane DCEmu
Insane DCEmu
Posts: 147
Joined: Thu Apr 27, 2006 10:15 am
Has thanked: 27 times
Been thanked: 35 times

Re: Has anyone successfully built the toolchain in Windows Subsystem for Linux?

Post by ThePerfectK »

mrneo240 wrote: Tue Jul 30, 2019 5:13 pm Does redream work headless?
I don't think there is an option. Even if you launch straight from terminal, it creates an X window by default.
Still Thinking!~~
mrneo240
DCEmu Freak
DCEmu Freak
Posts: 86
Joined: Wed Mar 14, 2018 12:22 am
Has thanked: 16 times
Been thanked: 19 times

Re: Has anyone successfully built the toolchain in Windows Subsystem for Linux?

Post by mrneo240 »

But wsl isn't graphical
User avatar
ThePerfectK
Insane DCEmu
Insane DCEmu
Posts: 147
Joined: Thu Apr 27, 2006 10:15 am
Has thanked: 27 times
Been thanked: 35 times

Re: Has anyone successfully built the toolchain in Windows Subsystem for Linux?

Post by ThePerfectK »

mrneo240 wrote: Tue Jul 30, 2019 11:08 pm But wsl isn't graphical
right, I use VcXsrv in windows to create an X server for WSFL to communicate through.

Image

It's not the gui that's the problem, it's an unimplemented kernel function. I can launch and run redream. I just can't use a specific feature. I just have to wait till WSFL implements that function.
Still Thinking!~~
User avatar
Protofall
DCEmu Freak
DCEmu Freak
Posts: 78
Joined: Sun Jan 14, 2018 8:03 pm
Location: Emu land
Has thanked: 21 times
Been thanked: 18 times
Contact:

Re: Has anyone successfully built the toolchain in Windows Subsystem for Linux?

Post by Protofall »

ThePerfectK wrote: Tue Jul 30, 2019 11:48 pm
mrneo240 wrote: Tue Jul 30, 2019 11:08 pm But wsl isn't graphical
right, I use VcXsrv in windows to create an X server for WSFL to communicate through.

Image

It's not the gui that's the problem, it's an unimplemented kernel function. I can launch and run redream. I just can't use a specific feature. I just have to wait till WSFL implements that function.
You might be able to get this working using the Windows Redream executable. For example my Windows Redream Executable is in downloads so I use "/mnt/c/Users/USER_NAME/Downloads/redream.exe prog.cdi" to run my cdi's, I don't know what command you need for elfs, but it should be simple given this.

NOTE: Make sure your elf/stuff isn't in the "Linux partition" (Everywhere aside from the /mnt/ directories basically). If you try to open a Linux file with a Windows program it will corrupt the file system due to incompatibility issues. So just keep your stuff in the normal Windows space and you should be fine.
Moving Day: A clone of Dr Mario with 8-player support <https://dcemulation.org/phpBB/viewtopic ... 4&t=105389>
A recreation of Minesweeper for the Dreamcast <viewtopic.php?f=34&t=104820>

Twitter <https://twitter.com/ProfessorToffal>
YouTube (Not much there, but there are a few things) <https://www.youtube.com/user/TrueMenfa>
mrneo240
DCEmu Freak
DCEmu Freak
Posts: 86
Joined: Wed Mar 14, 2018 12:22 am
Has thanked: 16 times
Been thanked: 19 times

Re: Has anyone successfully built the toolchain in Windows Subsystem for Linux?

Post by mrneo240 »

In WSL V2 you are supposed to open Linux files in windows programs.

It works flawlessly
User avatar
ThePerfectK
Insane DCEmu
Insane DCEmu
Posts: 147
Joined: Thu Apr 27, 2006 10:15 am
Has thanked: 27 times
Been thanked: 35 times

Re: Has anyone successfully built the toolchain in Windows Subsystem for Linux?

Post by ThePerfectK »

Protofall wrote: Thu Aug 01, 2019 6:23 am
ThePerfectK wrote: Tue Jul 30, 2019 11:48 pm
mrneo240 wrote: Tue Jul 30, 2019 11:08 pm But wsl isn't graphical
right, I use VcXsrv in windows to create an X server for WSFL to communicate through.

Image

It's not the gui that's the problem, it's an unimplemented kernel function. I can launch and run redream. I just can't use a specific feature. I just have to wait till WSFL implements that function.
You might be able to get this working using the Windows Redream executable. For example my Windows Redream Executable is in downloads so I use "/mnt/c/Users/USER_NAME/Downloads/redream.exe prog.cdi" to run my cdi's, I don't know what command you need for elfs, but it should be simple given this.

NOTE: Make sure your elf/stuff isn't in the "Linux partition" (Everywhere aside from the /mnt/ directories basically). If you try to open a Linux file with a Windows program it will corrupt the file system due to incompatibility issues. So just keep your stuff in the normal Windows space and you should be fine.
The main problem, and reason I'm trying to get the linux version of redream working in windows, is that I'm using a linux program called SOCAT to communicate to redream through an emulated serial connection. Although, I just learned that there is apparently a windows build of SOCAT so that might take care of the problem, I'll have to devote some time to toying around with it.
Still Thinking!~~
User avatar
lerabot
Insane DCEmu
Insane DCEmu
Posts: 134
Joined: Sun Nov 01, 2015 8:25 pm
Has thanked: 2 times
Been thanked: 19 times

Re: Has anyone successfully built the toolchain in Windows Subsystem for Linux?

Post by lerabot »

I know the original question is parlt answered, but I want to confim that I built KOS under WSL1 and Debian today.
Post Reply