thehackerwithin/berkeley

Hacking OSes: Unixification and GNU-ization (a.k.a. OS cross-breeding?)

ickc opened this issue · 0 comments

ickc commented

As a digression from #108. Warning: just a brainstorm here, the idea may be too crazy.

One obstacle in hacker-within is that people joining the sessions are often having vastly different environments, experiences, and even OSes. And unavoidably, experiences on some topics might not be uniform across different OSes (e.g. bash, make, docker, CI, etc.) In some situations it is also unavoidable for beginners to find themselves needing to migrate to the UNIX world in certain fields. So the idea of this topic is to help these people to turn their OS into a UNIX/GNU machine (more on GNU later.)

Ideas:

  • Windows
    • Cygwin (native but limited)
    • Windows Subsystem for Linux (64-bit only, has system call overhead)
    • Install Ubuntu using Hyper-V (64-bit and the "Pro-variants" of Windows only, lowest overhead.)
    • Other VM solutions (may cost $, more overhead)
      • may also mention hacking VMWare to run macOS in a virtual machine
  • macOS
    • macOS is already UNIX, but point out differences (e.g. BSD variant, GPLv2 limitations, etc.)
    • GNU-ize : because of the limitation of GPLv2, macOS shipped with older GNU tools (e.g. sed, make, bash) or replace them with non GNU tools (fake gcc, etc.), fortunately through brew (or macports), newest GNU tools can be installed. The goal is to minimize the difference between macOS and Linux, and hence people can develop on macOS but deploy on Linux (majority of the clouds and virtually all supercomputers)
    • other tricks is to not keeping the OS being the latest release to be able to use some tools (e.g. valgrind, Intel's tools) that aren't updated immediately after an OS launched.
    • in brew, override default compilers to use the GNU's variants (rather than clang)
    • VMs could be mentioned too
    • Hackintosh: this is mentioned because beginners might not have a Mac. Migrating to Linux means they are going to lose most of the propriety tools they need. macOS can be a sweet spot of being UNIX but with many commerical appications avaiable. But it can't run on their existing hardware so hackintosh is needed if they don't want to buy a new machine, or just want to get a taste of it first. Making it working can be challenging or impossible though, depending on the hardwares.
    • Darwine and friends: for those who need to migrate from Windows to macOS, Darwine could be helpful. See below for Wine.
  • docker: it is an alternative way to run UNIX/Linux applications on Windows and Mac. They uses hypervisor technology to minimize overhead. This is the ultimate way to done away the differences between Windows, macOS and Linux, not to mention very useful on Linux as well.
  • Linux
    • Wine: while Linux being Linux, there's no need to modify it to get the UNIX/GNU experience, Wine could be helpful for those needing to migrate from Windows to Linux. It is a compatibility layer to translate the system calls of an Windows application to make them run natively on a Linux host (WSL steal this idea to run Linux application natively on Windows.) It ain't perfect though, and there's a long list showing which Windows applications might be run using Wine.
    • VM solution also avaiables here to install Windows and macOS
  • Other interesting cross-breeding:
    • running Linux alongside Chrome OS (meaning one could buy a cheap Chrome OS mahcine if they want to buy a Linux machine.)
    • Ubuntu Phone: there's a limited no. of Android phones/tablets that can install Ubuntu. Also a good candidate for cheap Linux machine.