22

Redox OS: Open Source Application of the Week - Week of 2017-10-02

Submitted by sudo moderator in freeAsInFreedom

Last week's thread (non-onion link).

This week's Open Source Application of the Week is Redox OS, an operating system written entirely in the Rust programming language. The latest version at the time of writing is 0.3.3, so that is the one I tested.

First, I tried booting this system by copying the ISO to a flash drive, then booting from that. But, after letting me select the screen resolution, it got stuck at "Starting Arch". So, I decided to use a virtual machine instead.

Booting with QEMU, it started pretty quickly. After asking you what screen resolution you want, it shows you the login screen. It took me a while to find out the default usernames and passwords: the default username is user with no password, or root with a password of password. After logging in as the normal user, I got to see the default display manager, called Orbital. I must say, it looks very good. Here is a screenshot of Orbital, without any windows open. Here is what it looks like with the default text editor open.

So, while it looks pretty good, there really isn't that much here yet. It has a web browser, a terminal, a text editor, a file browser, an image viewer, a simple calculator, and a font viewer. As far as I can tell, that's it, as far as the GUI applications go. For the web browser, I couldn't connect to the internet (probably because I set up my VM's network stuff incorrectly), and I didn't want to spend a long time making that work, so I skipped this one. The terminal is interesting - it has a lot of the normal linux terminal commands, like cat (though this one doesn't seem to work), ls, rm, cd, echo, and others. It also has autocomplete, of sorts - it remembers all the commands you typed in, and if the command you're currently typing matches one you previously typed, it will display the rest of your previously typed command in yellow, and if you press the right arrow key, it will complete the command for you. That's useful.

The file browser is pretty basic - it displays files and directories, and lets you open the file or enter the directory you're hovering over by single clicking it. There is no right click functionality for the file browser (or anywhere else, as far as I can tell), so if you want to copy or move a file, you'll have to use the terminal. The editor is also very simple (in fact, I think it's actually a terminal window in disguise). You can type some plaintext, save it, open another file, and that's about it. There's no copying and pasting - I don't think the operating system even has a clipboard yet. The image viewer is also quite basic - it only displays the image you asked it to. When you start it from the taskbar, it displays the default wallpaper. The calculator program just does basic arithmetic, and the font viewer (called "Character Map") just shows you the default font.

So, there's not much to talk about in the way of GUI programs. Also, I believe I found a bug with one of them - if you start the image viewer from the terminal, then switch back to the terminal and send Ctrl+C, it will print "ion: process ended by signal: 2", but the window will not disappear. It can still be dragged around with the mouse, but it won't respond to a click on the X button. But, there's plenty more to talk about, in the way of the terminal. The default shell for Redox is called Ion, and the syntax just looks nice. Here's an ion script that prints the first 200 numbers in the Fibonacci sequence. It gives you a nice overview of the syntax.

#!/bin/ion

fn fib n
    if test $n -le 1
        echo $n
    else
        let output = 1
        let previous = 1
        for _ in 2..$n
            let temp = $output
            let output += $previous
            let previous = $temp
        end
        echo $output
    end
end

for i in 1..200
    fib $i
end

Doesn't that just look nice? Compare it to the same script in bash, and tell me which one is more pleasant to look at.

#!/bin/bash

fib () {
    if test $1 -le 1; then
    echo $1
    else
    output=1
    previous=1
    for ((x = 2; x < $1; x++)); do
        temp=$output
        ((output += previous))
        previous=$temp
    done
    echo $output
    fi
}

for ((i = 1; i < 200; i++)); do
    fib $i
done

Ion's syntax looks so much more like a scripting language should - leave the brackets and parentheses to C. Also, according to this (which is where I got the Fibonacci code from), ion runs the Fibonacci program almost six times faster than bash! I didn't play around with ion all that much, but I get the feeling it'd be much more pleasant to write scripts in than bash.

So, that is it for my review of Redox OS. It's a really cool OS, but right now it's just a tinker toy. But, I think it will be a really cool desktop OS, once it gets more applications. If you want to play around with it, you can grab the iso here, then spin it up in QEMU.


And that's it for this week's Open Source Application of the Week. What should I review next week? Let me know in the voting thread (non-onion link). Thanks for reading, and I'll see you all next Monday!

Comments

You must log in or register to comment.

4

surreal wrote

i try to read the codebase from time to time, they actually care for code quality and they rewrite parts to improve them, combine that with Rust and it may actually kick ass one day. They even have a file system inspired by ZFS with so many features that make my ext4 seem obsolete. Mind that redox is a microkernel that means that even drivers run on userspace!

you need to set up a tap interface for QEMU to get on the net. must specify it on the command line also.

4

jadedctrl wrote

I'm supportive of any up-and-coming OS project not using C.
C was a good choice, you know, when it was the best. We have more modern answers, now, that are just as fast and more secure (less prone to dev fuck-ups) than C.
An OS written in Lisp (or Scheme) would be best, but, you know, Rust is pretty great, too.
I wonder, what will replace UNIX and GNU/Linux? What will it be written in?

4

zorblax wrote

lisp/scheme are hard to write fast compiled code for because they're very dynamic in nature. That's why OS projects like Mezzano are so slow.

3

jadedctrl wrote

Yea, that's a good point. Mezzano is kind of painful.
A balance of Lisp/Scheme and a compiled language (maybe C, but preferably something more modern) with Lisp/Scheme used whenever possible (without sacrificing speed too much) would be better than pure Lisp/Scheme, probably.

3

[deleted] wrote (edited )

3

surreal wrote

what python did for me for every other language

4

zorblax wrote

clearly you've never tried scheme.

3

surreal wrote

so many parens :(((

3

josefStallman wrote (edited )

It looks like the GUI is based on Qt, is this the case?

Also great job as always, good to know it's far behind what I was hoping.

5

sudo wrote

I can't find anything in the source code that mentions Qt. The whole thing is written in Rust, anyways - I don't think there are any Rust bindings for Qt.

2

_ziq_ wrote

What hardware were you running it on when it hanged?

3

sudo wrote (edited )

*Hung

The processor was an i5, the graphics card was a GeForce GTX 460, and there were 4GB of memory.