9 ms·
MinC Is Not Cygwin
- acyou 1y agoLooks great. What do learners do using this OS (besides opening a web browser)? What other teaching resources do you use?
- thingfish 1y agoI wrote an entire 3-year (dutch) course around it [0]. My predecessor started his course making them do endless exercises with user rights and vim, which is very boring for 16-year olds. I start them on Apache webserver. This generates immediate interest, and at the same time tricks them into learning about user rights and using vim. [0] http://commandlinerevolution.nl/Huiswerk/ http://commandlinerevolution.nl/Huiswerk/
- dev_l1x_be 1y ago> MinC is a Unix emulator for Windows, based on the OpenBSD operating system If anybody wondering.
- damnitbuilds 1y ago"MinC is a Unix emulator for Windows, based on the OpenBSD operating system. MinC was written to help children at vocational education learn Linux" ?
- serbuvlad 1y agoAt my University I heard things like "Linux is derived Unix, BSD variants are something else entirely". I think education people are confused in general about this topic.
- blueflow 1y agoThe operating system interface that Unix, BSD and Linux share is called POSIX. The term POSIX is not widely known, so people sometimes make up for it by using "Linux" in-place because it is the most popular implementation. This explains people who argue that Android is not Linux, despite it featuring a Linux kernel and self-identifying as so: They are intending to say that Android is not POSIX. We need to make POSIX (as concept/word) more popular.
- oblio 1y agoIt's never going to happen. POSIX has been around for 4 decades now. The longer something is not popular, the lower its chances to ever become popular.
- m2f2 1y agoEspecially to package writers that assume bash is available everywhere, hope that bin/sh is the same as bin/ksh...sed -i... not on unices, grep missing a ton of options.... Time to ask an AI ?
- thesuitonym 1y agoThat's hilarious. It sounds like you know, but for anyone who doesn't, it's actually the opposite. BSD variants are derived from Unix--that's where the BSD comes from, it was the Berkley Software Distribution of Unix tools, that later implemented the rest of Unix so universities could use the same software without having to worry about licensing from Bell Labs. Linux is something else entirely, a student's project to make a MINIX compatible kernel, usually packaged with the GNU operating system, which like BSD aimed to be Unix compatible, but notably is not Unix (It's right there in the name: GNU's Not Unix).
- charcircuit 1y ago>usually packaged with the GNU operating system It's usually packaged as a part of the Android operating system. GNU hasn't been the popular userspace for a long time.
- bornfreddy 1y agoExcept in datacenters.
- ryao 1y agoIf you can get the exact quotes, please send them to Computer Stupidities: http://rinkworks.com/stupid/ http://rinkworks.com/stupid/ As an obligatory warning, if you have never seen Computer Stupidities previously, expect to lose a day reading it.
- arka2147483647 1y agoSeems to me, that to some Linux has come to mean all things Unix-ly
- pasc1878 1y agoYes it seems to be misused that wat - now just try to rerun scripts on macOS or BSD when the author thinks Linux is all there is.
- Maken 1y agoThat's usually caused by assuming that everything is bash, which is not true even for Linux.
- mdaniel 1y agoWhile that may certainly arise if someone is lazy about #!/bin/sh when they didn't really mean /bin/sh I'd bet it's /bin/sed and similar friends that are different between the GNU versions and the BSD versions. So much make-macro-trickery out there when one is trying to use -i without a backup suffix, and I have no idea why GNU tried to be a trailblazer with their parsing :(
- pasc1878 1y agoYes - I come from an era when I used multiple Unixes and for several of them default shell was (t)csh. Don't assume anything in shells except POSIX sh. Unfortunately there are people who think Linux is the only way.
- actionfromafar 1y agoIf you want to communicate to people wanting to learn "the linux" that this (to a close approximation) does this, with very few words, you could do worse. After all, if you learned to do "linux" on OpenBSD you'd be pretty much at home on Linux, too. It's a clever bit of SEO, too, mashing in Cygwin, Linux and OpenBSD in the copy.
- technothrasher 1y agoI learned to do "linux" on SunOS 4.1, and I feel less at home on Linux and more like a guest in my grandchildren's house.
- boutell 1y agoHuh. This was my entry point as well, but I find Linux very aligned with my feelings about the 4.1 experience, as opposed to Solaris which felt clunky and overbuilt. Of course this is purely subjective emotional stuff I'm talking about.
- technothrasher 1y agoYes, the switch to Solaris was definitely abrupt. But the current BSDs feel more like SunOS 4 to me than Linux does. Though to be honest, I do use Linux more than any of the BSDs these days.
- DonHopkins 1y agoSpeaking of Cygnus: The Worst Job in the World, from Michael Tiemann <tiemann@cygnus.com>: https://www.donhopkins.com/home/catalog/unix-haters/slowlaris/worst-job.html https://www.donhopkins.com/home/catalog/unix-haters/slowlari... PS: Fuck Trump supporting anti-vaxer Scott "You have zero privacy, get over it" McNealy. May he run Solaris in hell. Scott McNealy has long been one of Trump’s few friends in Silicon Valley: https://www.sfchronicle.com/politics/article/Scott-McNealy-has-long-been-one-of-Trump-s-few-14447197.php https://www.sfchronicle.com/politics/article/Scott-McNealy-h... Former Sun Micro CEO Scott McNealy, known for his provocative quotes, says Trump is doing a 'spectacular job' amid the coronavirus crisis. That's not how many tech experts see it: https://www.businessinsider.com/scott-mcnealy-praises-trumps-handling-of-coronavirus-crisis-2020-3?international=true&r=US&IR=T https://www.businessinsider.com/scott-mcnealy-praises-trumps... Sun on Privacy: "Get Over It": https://www.wired.com/1999/01/sun-on-privacy-get-over-it/ https://www.wired.com/1999/01/sun-on-privacy-get-over-it/
- thingfish 1y agoYes. Teaching anything to children is to start simple. So I start with bare-bone UNIX. In their second year we move to Linux (all flavours). For their final exam in the third year, they must be able to use Suze Linux.
- roelschroeven 1y agoWouldn't it be easier to use WSL? Microsoft has done al the hard work in getting native Linux code to run on Windows. I don't know how bare-bones you want it to be, but if you install Debian in WSL without extra packages, that seems pretty bare-bone to me. And it seems to me you avoid unnecessary friction from switching from OpenBSD to Linux later on. WSL requires Windows 10 or 11 though.
- cess11 1y agoInstalling WSL was much harder than 'download and double click EXE' when I last did it. The 'app' shop installed something botched I now can't easily get rid of and then I had to do a few Powershell incantations to actually get an install that boots a Linux-like terminal. If I had to use Linux under Windows more than a few hours per year I'd Hyper-V it instead. I'd also guess 'telemetry' pumps out all one does in WSL, while this might leak less of what the kids are doing.
- ryao 1y agoI doubt that, since telemetry slows things down and it has been found that software runs faster under WSL than native Windows. A quick search found this, which shows a substantial performance difference for the same thing between native Windows and WSL: https://www.reddit.com/r/rust/comments/vtc0fy/wsl2_faster_than_windows/ https://www.reddit.com/r/rust/comments/vtc0fy/wsl2_faster_th... There have been others who observed the same in the past (and with WSL1), although I do not have a list. I recall reading libc telemetry hooks on Windows that are absent as being claimed to be the cause, but I cannot find the page where I read that. The Reddit post has the alternative suggestion that process creation speed is the cause.
- nasretdinov 1y agoI think there used to be a similar project for Linux, called CoLinux. However using a BSD kernel probably is a more sustainable choice if anything because it's much smaller and simpler
- zoobab 1y agoI used CoLinux back in the days, it was bluffing: http://zoobab.wikidot.com/openwrt-and-user-mode-linux http://zoobab.wikidot.com/openwrt-and-user-mode-linux
- ryao 1y agoThat is user mode linux. Cooperative Linux is something else: https://en.wikipedia.org/wiki/Cooperative_Linux https://en.wikipedia.org/wiki/Cooperative_Linux Interestingly, Wikipedia claims that User-mode Linux inspired Cooperative Linux.
- zoobab 1y ago"Under Windows Vista, I have installed Pubuntu, which is a distribution based on Ubuntu Hardy with a CoLinux kernel. Now I run User Mode Linux on top of CoLinux on top of Vista" Maybe UML can run on top of MinC? Does MinC accepts ELF linux binaries?
- ryao 1y ago> It runs on all versions of Windows, except Win95 and Win98. For some reason, I suspect it does not run on Windows 1.0 to 3.11 either. I also find it strange to think it would run on both Windows ME and Windows NT 3.5, while excluding Windows 95 and Windows 98. Windows NT 3.5 and Windows ME are nearly a decade apart. The Windows subsystem’s software support in Windows NT 3.5 would be a subset of Windows 95/98.
- thingfish 1y agoYou're right. I'll change it to "Windows XP or later".
- bandrami 1y agoIDK, I wouldn't be surprised if it ran on Windows 2000 (still the best OS Microsoft ever made)
- heavensteeth 1y agoright, I suspect "NT" is the category they're looking for.
- guerrilla 1y agoWhat's wrong with 2003?
- actionfromafar 1y agoA bit bloated. I think NT 3.51 is the coolest, extremely stable.
- chuckadams 1y agoThe NT 3.x series might have had stricter userspace separation than 4.x did where they moved things like GDI into kernel space, but it still fell over hard at even the faintest whiff of fuzz-testing the native API. It wasn't until 5.x (Win2K) that they started taking that sort of thing seriously.
- quietbritishjim 1y agoSounds very interesting but it's quite short on details. If it's not Cygwin, then what is it? > MinC is a tiny kernel which runs on Windows. The rest of the software was taken verbatim from OpenBSD, version 6.1. This means that by installing MinC, you run OpenBSD on your Windows machine at native speed. How does it run this kernel? Presumably (?) it's running in user space, so how do these other tools communicate with it? Are they native(ish) Windows binaries like those built for Cygwin? I suspect this could be an ingenious technical achievement but it's just hard to tell what exactly it is.
- delta_p_delta_x 1y ago> If it's not Cygwin, then what is it? Looking at the source code[1], it appears to be analogous to MinGW in the MinGW:GNU/Linux:Windows relationship, but replace with MinC:BSD:Windows. In other words, a minimal user-mode layer that presents BSD headers (and therefore BSD symbols, macros, and types), libraries, and core utils to end-users, thus abstracting over MSVC†. EDIT: replace 'MinGW' with 'Cygwin' above. So it is Cygwin. I'd say calling it a 'kernel' is quite a stretch—there is not much that runs in kernel-mode, and everything runs atop the NT kernel which does the actual 'kernel'y stuff. [1]: https://github.com/dboland/minc https://github.com/dboland/minc †: Until one wants to use very recent and very nice Microsoft libraries[2][3], and these fail spectacularly because MinGW doesn't know about nice MSVC-specific stuff like SAL annotations[4]. [2]: https://github.com/microsoft/wil https://github.com/microsoft/wil [3]: https://github.com/Azure/azure-sdk-for-cpp https://github.com/Azure/azure-sdk-for-cpp [4]: https://learn.microsoft.com/en-gb/cpp/c-runtime-library/sal-annotations?view=msvc-170 https://learn.microsoft.com/en-gb/cpp/c-runtime-library/sal-...
- quietbritishjim 1y ago> Looking at the source code[1], it appears to be analogous to MinGW in the MinGW:GNU/Linux:Windows relationship, but replace with MinC:BSD:Windows. In other words, a minimal user-mode layer that presents BSD headers (and therefore BSD symbols, macros, and types), libraries, and core utils to end-users, thus abstracting over MSVC†. Are you getting MinGW mixed up with Cygwin? MinGW does not emulate Unix-style APIs on Windows. (Actually I think there are exceptions but that is not its general purpose.) Instead, it is a port of tools aimed at Unix-like OSs (e.g., Make, GCC) to Windows so that they can be used to build source code that is already targetted at Windows. For example, source code compiled with MinGW might include a call to the Win32 API CreateProcess(), but cannot include a call to the Posix API fork(). Cygwin, on the other hand, allows compiling source code intended for *nix to native Windows binaries. For example, it compile code that calls fork(), getuid(), stat(), etc. It has that user-mode emulation that you mentioned (e.g. mapping between Unix-style UIDs and Windows SIDs), which happens in cygwin1.dll.
- oblio 1y agoReally cool, I guess this is meant for kernel hacking and also as a hobby project? Cygwin itself is really easy to install, you can just copy the folder around, you don't need the installer.
- SpaghettiCthulu 1y agoThe System Boot demo video on the screenshots page won't play for me. Seems the format isn't supported by Firefox on Android.
- thingfish 1y agoIt is a .webm file. It won't play in my BlueStacks Android emulator either. Do I need to add an .mp4 file?
- blueflow 1y agoYes, webm support on mobile is horrible.
- Cthulhu_ 1y agoWeird that a video format that's been around since 2010 still doesn't have wide support. But, that takes me back to the codec problems from around that time.
- thingfish 1y agoI added an .mp4 source. Still not playing in BlueStacks Android. Does it work in a real Andriod?
- blueflow 1y agoPay attention to the the codecs, mp4 is a container format that may contain a codec that Android doesn't support. This is a rabbit hole.
- mdaniel 1y agoAccording to ffprobe: Duration: 00:00:21.20, start: 0.000000, bitrate: 307 kb/s Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 960x672, 306 kb/s, 10 fps, 10 tbr, 10240 tbn (default) so maybe in a comically ancient version of Android, or perhaps a "hardened" distro that eschews modern stuff? Merely as another datum, I did URL surgery to get the prior .webm flavor and it's blank for my FF 137 on macOS so there was obviously something else going on (by blank I mean it had 21 seconds worth of black pixels, not that it didn't play)
- dbacar 1y agoWith all respect, why would anyone bother to use these tools when you have a full-blown linux distro at your command with WSL/2?
- blueflow 1y agoBetter manual pages?
- thunder-blue-3 1y agowow, TIL. Can't believe I've done nearly 40 circles around our sun and never knew about WSL/2.
- orra 1y agoTo be fair, WSL/2 didn't exist for most of those circles.
- i_am_proteus 1y agoOne reason would be if anyone does not want to, or is not able to, enable virtualization (WSL requires this).
- robohoe 1y agoMany orgs’ security policies don’t permit WSL/2.
- nottorp 1y agoYes, set up a VM and then add 3 levels of nested containers inside the VM just to be sure. Incidentally next week I have to debug one of our tester's laptop - he installed vmware which stopped WSL from running somehow and now neither option works.
- skinner927 1y agoThis is pretty common. They turned off hyper-v.
- max_ 1y agoIts such great recursive acronym. [1] [1]: https://en.m.wikipedia.org/wiki/Recursive_acronym https://en.m.wikipedia.org/wiki/Recursive_acronym
- hatly22 1y agoI wish they'd include a datestamp in these intro pages. This looks like it could be from any era.
- emmelaich 1y agoAgree. Looking at github, the most recent commit is yesterday and some are two years old.
- dredmorbius 1y agoGenerally agreeing with you (date your work, peeps), checking the Wayback Machine often helps. First capture from 23 April 2025, which would be today: <https://web.archive.org/web/20250423103309/https://minc.commandlinerevolution.nl/english/home.html https://web.archive.org/web/20250423103309/https://minc.comm...> There was a January 2024 HN submission requesting feedback by thingfish suggesting early work at roughly that time: <https://news.ycombinator.com/item?id=38951099 https://news.ycombinator.com/item?id=38951099> Thingfish: Adding creation / last modified dates would be helpful.
- thingfish 1y agoI understand your point, but I'm intrigued. Could you elaborate with some kind of example why it is disappointing that people don't date their web-pages? Is this a generic problem or is it with specific web-sites only?
- dredmorbius 1y agoTime matters. A recently-released project may be intriguing but something risk-averse entities (individual/organisations) might prefer to hold back on for fear of, let's call it "infant death syndrome". An old project with no active development is generally perceived as "dead", with risks that security- or bug-fixes could remain unaddressed for long times, or that there may be current zero-day exploits possible. An old project with a healthy activity stream counters both points: the project has exhibited staying power and addressing ongoing maintenance concerns. Even active projects might give caution (say: feature creap or enshittification), but that's beyond the scope of merely giving initial / latest activity timestamps. NB: I've well over 30 years of professional IT experience in shops ranging from small operations to multi-billion-dollar firms. Advocating for, or against, various technologies and solutions is a large part of that role. It's also something that carries into my choices for my own personal systems. I'd be unlikely to do much with MinC myself as I don't use MS Windows, though it fits in with a long tradition of similar tools I have used, often with fond memories, including Cygwin, David Korn's UWIN, MKS Toolkit (Mortice Kern Systems, licenced by Microsoft for early versions of WSU, precursor to WSL, I've just learned), VMWare, Xen, qemu, Virtualbox, Parallels, etc. These have different architectures but all basically address the problem of "run programs from OS X on OS Y", which turns out to be a fairly-frequently-encountered challenge. I might well recommend MinC to those with such needs.
- huksley 1y agoDoes it support unicode and internationalization?
- thingfish 1y agoYes.
- jdndndb 1y agoI don't get the negativity in this thread. Looks like a cool project, keep up the good work
- mrweasel 1y agoIt might be because it's a teaching tool, but the introduction contains a lot of fundament misunderstandings and factual mistakes. Take networking, one of the screenshots shows the output of ifconfig. That teaches you almost nothing about Linux networking, because ifconfig in Linux and OpenBSD are two very different tools, and you'd probably not teach people to use ifconfig on a modern Linux distro. Same for the boot process... rc and systemd are not the same, not even close. It is a very cool project but almost all references to Linux is wrong.
- skrebbel 1y ago> almost all references to Linux The word "Linux" only occurs on the page once.
- smcameron 1y agoWhich is weird, because the stated purpose of MinC is: "MinC was written to help children at vocational education learn Linux without the hassle of virtualization." And it does this by running OpenBSD on Windows? That's really strange. Why not just run linux if the goal is to teach/learn linux? Perhaps the actual goal is not well stated, or I misinterpret what is really meant by those words.
- skrebbel 1y agoSure, it's confusing. But the suggestion here is that this single word implies a "lot of fundament misunderstandings and factual mistakes" (sic), and therefore the many negative comments in this thread about that word are warranted, and frankly that's just ridiculous. Notably, from a teaching "Unix tools 101" perspective, the difference is super unimportant. If the author's goal is to get students to open a terminal for the first time in their lives (on their Windows laptops!) and type some ls commands and maybe pipe stuff into sed once or twice, they can learn this on a BSD and apply it in any Linux (or the reverse) just fine. I think the author means it literally. His goal is to teach students some Linux basics, and his method is to put a BSD into their Windows. It's kinda nuts, but you gotta agree it's kinda "mad genuis" nuts.
- berlinbrowndev 1y agoIt is interesting and there so many options. Mingw WSL seems to be new now Cygwin And this one.
- berlinbrowndev 1y agoYea, options now.
- michaelsbradley 1y agoMSYS2 ties it together for the best experience imo: https://www.msys2.org/ https://www.msys2.org/
- heftig 1y agoMSYS2 is basically Cygwin with Pacman for package management, plus several other environments with either GCC or Clang and different Windows-Native C and C++ runtimes. It's nice, but not perfect. It inherits a lot of problems from Cygwin. File access is still slow (as mentioned in other threads) and symlinks don't behave right (by default making a symlink creates a deep copy of the target, and even NTFS symlinks need to know whether the target is a file or a directory; either way you cannot create a symlink when the target is missing, and this causes rsync to fail, for example.) MSYS2's strength is as an environment for compiling cross-platform apps for Windows, and I would recommend WSL2 for anything else.
- michaelsbradley 1y agoAgreed that it's good for building native Windows software and there are better options for other use cases. When recommending–praising MSYS2 I sometimes forget that the only time I use Windows is to build software for use by other folks who actively run Windows as their desktop/laptop OS. Re: "Cygwin…plus several other environments[+]", the second paragraph of MSYS2's home page summarizes it pretty well: Despite some of these central parts [Bash and cli tools] being based on Cygwin, the main focus of MSYS2 is to provide a build environment for native Windows software and the Cygwin-using parts are kept at a minimum. [+] https://www.msys2.org/docs/environments/ https://www.msys2.org/docs/environments/
- self_awareness 1y agoOpenBSD userland used to teach Linux? Wouldn't it be better to either teach BSD with current toolset, or to use GNU tools to teach Linux?
- Hasik 1y ago[flagged]
- Hasik 1y ago[flagged]
- add-sub-mul-div 1y ago> without the hassle of virtualization It's so easy to run a Linux VM under Windows, I don't understand avoiding it. There's a little to learn, yes, but then you have real Linux as opposed to dealing with the inevitable differences between Linux and any of: Cygwin, MinC, WSL2, or MacOS.
- nunez 1y agoHonestly, I hate that the de facto terminal on Windows is the MinTTY that ships with Git, i.e. "Git Bash." I don't remember them right now, but there are weird quirks with that terminal that are mostly solved by the "new" Windows Terminal.
- bornfreddy 1y agoOne of them is that typing your password shows each character briefly before it disappears. Maybe the same thing happens in other terminals too, but they are too fast to notice - but here I could actually read my SSH key password as I typed it. Not cool.
- techlatest_net 1y ago[dead]
- int_19h 1y agoGiven that this has build tools, can it run pkgsrc?
- thingfish 1y agoOpenBSD has pkg_add and friends. Which I can't release yet. They need Perl which I can't release yet either. Although stable already, there still is one vital thing I need implemented in MinC.
- m2f2 1y agoHow long will cygwin lifetime be? A proud cygwin user myself, with cygwin in the PATH since the 2000s, I recently sideloaded Ubuntu under wsl. Right now, wsl is my primary terminal app, I've mounted C:\ as /c, added a symlink to bypass the ugly Onedrive default name, and... I'm happy. Slowly, I removed 90% of the mixed BAT scripts, converted to bash the rest, and I now enjoy it. As the old timer that I am, I limp around powershell, so no luck with that. Cygwin on the other hand seems to be slowly dying, as more and more packages are now unsupported/unmaintained, with Redhat apparently willing to smother it at the first viable moment. Any thought?
- colordrops 1y agoI'm using the nixos wsl image and a majority of my linux workstation setup was just installed with almost zero effort. happy and impressed. Using the Ameliorated.io debloater plus nixos wsl makes Windows almost tolerable.
- dist-epoch 1y agogit-for-windows (the default Windows git client) includes a bash.exe and a selection of gnu utils. it's based on MSYS2, so it's native. maybe you should check this one out.
- mananaysiempre 1y agoGfW is remarkably hostile to installing any additional components (e.g. I’ve needed to get ahold of rsync), especially compared to normal MSYS2, which is as flexible as any Linux distro.
- ormax3 1y agoit seems possible to install GfW into an existing MSYS2: https://gitforwindows.org/install-inside-msys2-proper https://gitforwindows.org/install-inside-msys2-proper
- mananaysiempre 1y ago
- mootptr 1y ago[dead]
- yuskii 1y ago[dead]
- gkfasdfasdf 1y agoOk so it's not Cygwin, how is it better (or worse) than Cygwin?
- ktm5j 1y agoI think the name is just a pun. Like how GNU is short for "GNU's not Unix". Presumably MinC is short for "MinC is not Cygwin".
- GIVEMEGO 1y ago[dead]
- kazinator 1y agoCygwin is based on something called Newlib, also of BSD origins.
- ConanRus 1y ago>based on the OpenBSD operating system. MinC was written to help children at >. vocational education learn Linux WAT? Linux == OpenBSD now?
- rnd0 1y agoThe irc client (not naming it) is an interesting choice for a secure-by-default OS. My understanding was that it has several security concerns?
- thingfish 1y agoMy choice for this particular IRC client (not naming it) came from the Mr.Robot series (S04E04 at 59:38:00). I am teaching 16 year olds. They like that kind of thing.
- waffletower 1y agoMinC a bit close to an existing MinC https://rtcmix.org/reference/scorefile/Minc.html https://rtcmix.org/reference/scorefile/Minc.html (Minc is not C)
- cryptonector 1y agoIf you were wondering, this is how fork() is implemented: as threads: https://github.com/dboland/minc/blob/8fe124625d2262b5bd83e0abf96df5cab791443a/libposix/vfs/process/process_sched.c#L48 https://github.com/dboland/minc/blob/8fe124625d2262b5bd83e0a...
- thingfish 1y agoCool. You found out why MinC is not Cygwin. To fork(), Cygwin starts a second copy of the entire executable. CreateThread() is much closer to what UNIX does. Any thoughts? BTW, there's another "easteregg".
- cryptonector 1y agoNot sure I'll look for the other "easteregg", though I noticed that you set the new thread's impersonation token, which is presumably how you implement setuid() and friends [yes, that is how you implement them] -- is that the other easteregg? I also see that you use the last RID of SIDs as the UID/GID, and that you have hardcoded passwd(4)/group(4) entries, so you only support local users (which is fine). Oh, ah, _task_copy(). You swap stacks... I think because of course. Your execve() is real though, since you use CreateProcessAsUser(), which is good. The compromise you made is pretty neat, though obviously some things might not work well. Though I'm guessing this is working quite well for you. Your file names are weird; they often tell me nothing about what to expect to find in them. I looked for fork() because that's the difficult one to implement on WIN32. What Cygwin does is some crazy gymnastics that sometimes fails. You might know that I think fork() is "evil" [0], or if you hadn't, you do now, and I guess you're likely to agree with that take, but I'd love to hear your thoughts on that, because clearly you've thought about fork(). I've to say that you've clearly thought a lot about this, and though I've not tried it (and probably won't) you seem to have done an excellent job. [0] https://gist.github.com/nicowilliams/a8a07b0fc75df05f684c23c18d7db234 https://gist.github.com/nicowilliams/a8a07b0fc75df05f684c23c...
- thingfish 1y ago> I've to say that you've clearly thought a lot about this, and though I've not tried it (and probably won't) you seem to have done an excellent job. Thank you. I needed that. I started the project in 2016 and have been obsessed with it since then. The weird thing is that I never had to use workarounds or hacks that are mentioned by the Cygwin team [0]. For instance, the select() call does map cleanly on top of the Win32 API. I just needed to use WSAWaitForMultipleEvents() instead of WaitForMultipleEvents() (the other "easteregg"). Why the Cygwin people didn't figure this out baffles me. I guess their current code base doesn't allow the rewrite. My big breakthrough was when I realized that the "inconsistent interfaces" [1] in Win32 file handles can be implemented as virtual file systems. One for each handle type (char, disk, pipe, etc). That was my "throwing away 1000 lines of code" [2] moment. As to the weird file names, I use the file names OpenBSD uses. My rule is to always use the file name of the header (.h) file where the system call is declared in OpenBSD. I also use their struct and constant names, prefixed with "WIN_". The "fork is evil" thing is discussed a lot in the programmers community. I myself find it quite clever. Threads are highly volatile and are very hard to program without running into race conditions. The solution is to make a copy of everything the child will be using: duplicate file descriptors, the stack, globals (rss). The kernel does all this for you in one system call. I often wonder how the people who complain about the absence of real concurrency in their programming languages [3] actually would use this feature. In my opinion the best way to use concurrency is to string individual programs into a pipeline. This will never go "evil" on you. [0] https://cygwin.com/cygwin-ug-net/highlights.html https://cygwin.com/cygwin-ug-net/highlights.html [1] https://www.usenix.org/legacy/publications/library/proceedings/usenix-nt97/full_papers/korn/korn.pdf https://www.usenix.org/legacy/publications/library/proceedin... [2] https://skeptics.stackexchange.com/questions/43800/did-the-creator-of-unix-say-one-of-my-most-productive-days-was-throwing-away-10 https://skeptics.stackexchange.com/questions/43800/did-the-c... [3] https://news.ycombinator.com/item?id=32408577 https://news.ycombinator.com/item?id=32408577