[HN Gopher] Porting QEMU to RedoxOS
       ___________________________________________________________________
        
       Porting QEMU to RedoxOS
        
       Author : rvz
       Score  : 105 points
       Date   : 2021-07-15 13:29 UTC (9 hours ago)
        
 (HTM) web link (redox-os.org)
 (TXT) w3m dump (redox-os.org)
        
       | nixpulvis wrote:
       | Just curious, because I'd love to run redox for real one day :D,
       | Is the biggest issue around real hardware support the
       | drivers/firmware? Would it make sense / be possible to reuse the
       | Linux code?
        
         | heavyset_go wrote:
         | > _Would it make sense / be possible to reuse the Linux code?_
         | 
         | Linux is GPL-2.0 while RedoxOS is MIT licensed. You can't use
         | Linux driver code without relicensing Redox as GPL-2.0.
         | 
         | What you can do, however, is implement a Linux driver
         | compatibility layer. Linux has NDISwrapper, which enables Linux
         | to take advantage of Windows drivers for networking hardware.
         | FreeBSD has Linux compatibility with linuxkpi and FreeBSD can
         | use some Linux graphics drivers that way.
         | 
         | You can also port the drivers and keep them out of Redox's MIT
         | source tree, too.
         | 
         | If you want to add drivers to Redox, you can do a clean room
         | implementation by documenting how Linux interacts with the
         | hardware it supports, and then writing drivers from those
         | documents.
        
         | dijit wrote:
         | The biggest issue _I_ had as a user was getting redox to
         | compile itself.
         | 
         | It is fun as a toy but developing on it is difficult.
         | 
         | Or I missed something.
        
           | nixpulvis wrote:
           | Well you ignored my question, if that counts as something.
        
           | Macha wrote:
           | Yeah, I looked into it in the past couple of months.
           | Ultimately it wouldn't compile because my system has GCC 11.
           | They have a vendored copy of ring that's about 2 years out of
           | date, and has some issue with array type confusion where a
           | field is defined as a fixed length array in one field and a
           | pointer in the other. Since GCC 11, that's been a warning,
           | and their build system compiles their fork of ring with
           | -Werror, so that new warning in GCC 11 breaks the build.
           | 
           | Sadly their gitlab instance at the time was "email the dev to
           | set up an account", so I just left it there.
        
             | est31 wrote:
             | > Sadly their gitlab instance at the time was "email the
             | dev to set up an account", so I just left it there.
             | 
             | The Gitlab had a "sign in with Github" feature at least
             | since August 2019, which is when I created my account
             | there.
        
       | bonzini wrote:
       | QEMU build system guy here. If you have any questions about the
       | configure and meson scripts, you can catch me on the #qemu
       | channel on OFTC.
       | 
       | Of the features you disabled, the main one to be reinstated seems
       | to be slirp.
       | 
       | --enable-tools builds qemu-img, qemu-nbd and other tools.
       | --enable-coroutine-pool is an optimization that should not be a
       | problem for portability.
        
         | tempodox wrote:
         | If only I understood how to use QEMU in practice. Are there any
         | tutorials that come with all the parts necessary to get
         | something actually running (and explaining it), without me
         | having to go off in search for missing components that I have
         | no idea where to find?
        
           | kashyapc wrote:
           | Along with the other good responses in this thread from
           | _bonzini_ and others, you might want to also check out
           | this[1] response. It talks about useful command-line tools
           | for KVM- and QEMU-based virt.
           | 
           | [1] https://news.ycombinator.com/item?id=26993381
        
           | wyldfire wrote:
           | A remarkably simpler use case is if you want to run Linux
           | programs built for a different architecture (instead of using
           | QEMU to boot into a system). QEMU can do this on its linux-
           | userspace configuration. The only knob you really have to
           | know about is QEMU_LD_PREFIX environment variable if your
           | executable has dynamic dependencies (C library, e.g.).
        
           | bonzini wrote:
           | QEMU is complicated. You're probably better off using virt-
           | manager, it provides a GUI front-end and also improves on
           | security by using libvirt (with support for SELinux or
           | AppArmor).
        
           | btdmaster wrote:
           | Drew DeVault has a nice introduction[1]. ArchWiki has
           | coverage on the many options not mentioned[2].
           | 
           | [1] https://drewdevault.com/2018/09/10/Getting-started-with-
           | qemu...
           | 
           | [2] https://wiki.archlinux.org/title/QEMU
        
           | stefanha wrote:
           | It depends what you want to do. When QEMU is used for
           | virtualization it's typically a component in a larger stack
           | like GNOME Boxes or virt-manager, two UIs that rely on
           | libvirt to run QEMU.
           | 
           | When QEMU is used for emulating ARM boards or retro computing
           | you can launch it from the command-line specifying just a few
           | things like the path to a disk image file or the amount of
           | RAM. There are a lot of command-line options and it can be
           | overwhelming, but luckily they are usually not needed for
           | these use cases.
           | 
           | Documentation is here but it's easier to start with a QEMU
           | command-line recommended by the software (e.g. exotic OSes)
           | you want to try out: https://qemu-project.gitlab.io/qemu/
        
         | stefanha wrote:
         | Yes, email qemu-devel@nongnu.org or discuss with developers on
         | the #qemu IRC channel on chat.oftc.net if you hit issues.
         | 
         | QEMU builds on a number of host operating systems, not all of
         | them POSIX. We'd be happy to help!
        
       | FunnyLookinHat wrote:
       | What an awesome Summer of Code project! I wish opportunities had
       | been around when I was learning to program. I remember constantly
       | looking for open source projects to contribute to, but each had
       | such a high bar for entry that there was no low-hanging-fruit
       | that I could cherry-pick (sic) to get involved.
       | 
       | While it's certainly useful to learn by rolling projects from the
       | ground up, you can learn a whole lot more by contributing to an
       | established project and experiencing how their code standards,
       | review process, etc. all feel in comparison to other projects.
       | One big thing I lacked was simply having someone say "We write
       | static functions LIKE THIS because they have THAT ROLE within the
       | scope of this project."
        
       ___________________________________________________________________
       (page generated 2021-07-15 23:01 UTC)