On Nov 18, 2013 5:34 AM, "Sebastian Schuler" <mail.sebast...@gmail.com> wrote:
> but needs some minor changes (?). Unfortunately 5l doesn't support windows (http://golang.org/cmd/ld/), but I don't know what the problem is/was.
i don't expect much changes to cmd/5l, as most of the pe code is portable and in cnd/ld.
> Plus the runtime shouldn't need any changes at all, the available libraries are mainly the same and Windows RT
this is incorrect. the two major parts of work to port Go to another platform are linker and runtime/syscall work.
> shares the kernel with Windows 8. It should be easily possible to port the runtime, see a list of ported application here: http://forum.xda-developers.com/showthread.php?t=2092348
>
> I have no a chance to provide changes to the linker, since I understand way way to little from those things and have barely the time to work me into it. But what about using the linker provided by Visual Studio? Why reinvent something what is already there?
because we don't want to rely on closed source components, and besides, not everybody wants VS just for Go (similarly, some people don't want to install mingw, but that is not required for binary distribution users).
On Nov 19, 2013 8:17 AM, "Sebastian Schuler" <mail.sebast...@gmail.com> wrote:
> windows/arm is more than what probably most people think about it, there is Windows RT and Windows CE (a little bit Windows Mobile but let's forget about that one). Windows CE is used quite often in embedded devices and has a significant/relevant market share so having a linker for windows{rt/ce}/{arm,386} would be really nice!
i think if we support windows/arm at all, we should target windows rt or 8 only.
> I've done a comparison about the currently used syscalls of the windows/386 port and the available ones in Windows CE (>= 5.0). You can find it here: https://docs.google.com/spreadsheet/ccc?key=0AnfAL9wNxT7XdHFBZUx5Y1hmOXdnVk5VdmwweEJMZ2c&usp=sharing There are a bunch of APIs missing, it would be great if someone who has the experience could comment on the critical parts!? As I said Windows RT should be much closer to Windows 8, unfortunately there are deployment difficulties and not many devices out in the wild.
the deployment problem feels like that of iOS port. If we cannot setup builder for windows/arm, the port won't be accepted.
some of the missing apis are very crucial so i think we can't have a fully function port to ce.
On Tuesday, 26 November 2013 07:57:31 UTC+11, Sebastian Schuler wrote:> ... facing issues with the hdd space on my virtual machine so I couldn't run all tests. ...Strange. Generally standard package tests do not use much disk space. I would be more concerned about your memory usage.
> ... Testing with cross compiled binaries is also a little cumbersome, since these are big binaries, sometime try to get external files etc... so having the complete tools working on windowsce would make testing much easier.Sure. Some test expects all tools to be there. You can try and get everything built from source, I guess. Is there mingw available for that platform? If it is, you should be able to proceed with small adjustments in src/cmd/*. Looks like you are using 386 cpu, so all windows/386 code should work - you will need to add your new GOOS handling, but just grep for "windows" and do the same for your new GOOS. Same with src/cmd/dist. I am not sure how powerful your computer is - perhaps it will be too much for it.> ... Nevertheless many of the failed tests failed since they were trying to access pipes to redirect stdio, stdout and stderr which isn't supported on windowsce.Yes. "go" cmd executes external commands a lot (platform independent code is in os/exec.Command). Given what I see about Windows CE CreateProcess implementation, it does not look promising. No CreatePipe, no new "current directory", no new environment, no psiStartInfo support (how are you going to redirect new process stdin/stdout/stderr). You can look at the code in os/exec.Command and try and rewrite it with what APIs you have. You might end up with some missing features. But it means, you won't be able to build "go" command. So you back to cross-compiling on another computer. But, depending on what your goal is, it could be enough.
> ... So I tried to fix this first but I'm unsure how to do so. Possible replacements for pipes would be message queue, memory mapped files or sockets. The last two would possibly have some security issues. Does someone have suggestion for this problem?I don't see how you can redirect stdin/stdout/stderr with CreateProcess on Windows CE. If not that, then you can communicate with the child in any way you like - whatever your new process supports.> ... Is it currently possible to transmit the pipe handles to the child process during a fork, or is this a basic requirement?It looks to me that fInheritHandles parameter of CreateProcess is not supported too. Perhaps, you can use some form of communication and inter-process version of DuplicateHandle.Alex
On Wednesday, 27 November 2013 19:31:25 UTC+11, Sebastian Schuler wrote:> ... Would using such a "device driver" make the port not comply with any restrictions for an official port? I would really like to have windowsce/{arm,386} getting upstream!
I wouldn't see a "device driver" as a show stopper. Besides you wouldn't need to use it unless you call CreateProcess (and a lot of programs don't).
But to make your port official is a different fish altogether. Here is a recent discussion about removing some existing platforms: https://groups.google.com/d/topic/golang-dev/QW4zUbMHMBM/discussion. You should read it to understand what is required. Especially this https://code.google.com/p/go-wiki/wiki/PortingPolicy doco by rsc.Alex
That is a lot of errors. You can disable some tests for your platform. But it is too many, as it stands now. I don't know what these problems are - perhaps it is something that is easy enough to fix, perhaps they are show stoppers. You have to understand what they are and decide what to do about it. It looks like your Go tools are mostly working, so you should be able to debug your problems.
On Wednesday, 4 December 2013 05:26:39 UTC+11, Sebastian Schuler wrote:> Much better now with working path:Excellent. I would have given up myself by now :-)
> ... The biggest part which is not working is network I/O since WinCE doesn't have io completion ports. Is there a chance to get it working with the generic select without a complete rewrite of the network part?I looked back in history https://codereview.appspot.com/1600041, and, it seems, we never had anything but "completion ports" version. So that is no go for you.Perhaps you should go with Dave's suggestion. Look at new Solaris port https://groups.google.com/d/topic/golang-dev/rK6JcsWbJ6s/discussion. You should look at netpoll_select.c file in https://codereview.appspot.com/35990043 CL. Perhaps you could use some of that code. You might also use existing code from netpoll_windows.c for syscall access.Alex
On Sunday, 8 December 2013 01:58:46 UTC+11, Sebastian Schuler wrote:> What's missing:> - net (!)You can also try to implement net without any special "use single os thread for many net connection" treatment. Just use connect/read/write/close (whatever they are) Windows API. This is not acceptable for large servers with many connections, but, I guess, you are not targeting these. You might have to drop some features, like deadlines and maybe others, but that is a price to pay. Even current net windows version does not implement everything that linux does, no unix sockets, ...
- tools (!)What do you mean by "tools"?
- environment variablesThat is important for "go" tool and compilers.
Like I said at the start, perhaps you can cross-compile on another OS. But if you want your port to be part of Go repo, then you would need to support all these things.Alex
Okay, so this might be an weird post, but I'm trying to wrap my head around the problems with porting the golang runtime to other systems and I'm only a dumb noob. My searches through the various aspects about the runtime are (and please correct me if I'm wrong):- Small specific runtime code mainly written in C and some parts in assembler.- Wrappers around OS calls which access the kernel(s) directly.-> To port the runtime to a different OS running on an proven to work architecture like eg. linux/amd64 to freebsd/amd64 you need to implement the needed OS calls and it should be working!?The catch about other architectures is that the linker needs to support it (for windows -> PE executeables) *and* it needs to support segmented stacks? As far as I understood mingw(-64) for windows does not support windows/arm.So I'm thinking about LLVM. Well yeah it might not be as fast as the default go compiler but, meh... whatever works... Wouldn't it be possible to use a LLVM frontend for go and use the LLVM byte code with an ARM backend and a native linker like the one in Visual Studio (does it support segmented stacks?) or at least with the LLVM interpreter?Is anybody working on something similar or on other ports for windows/arm?Please enlighten me, thanks!