News for hackers. Stuff that matters.
Re:Redox: A Rust Operating System by noja on Tuesday September 29, 2015 @09:24AM (#10296045)
"Redox is not correct, secure, or documented. It does a lot of things in a cavalier, leave it up to the application, manner. Applications can malloc and forget to free, Redox will not clean this up. Applications can access missing memory or kernel memory, Redox does not care. All applications run in Ring 0, and have all permissions. Some syscalls use vtables that rely on exactly the same struct defintions in userspace as kernel space. Syscalls cannot return values, except by writing them into a passed pointer. Memory allocation is done in the application, and uses a global memory allocation table that applications directly modify. None of its functionality is documented, outside of example source files." -- https://redox-os.org/

Yikes!!!

Re:Redox: A Rust Operating System by poelzi on Tuesday September 29, 2015 @09:39AM (#10296162)
OS development takes time and he clearly states this will change, criticizing such a young project with halfquotes is unfair and discouraging for the developers. shame on you.

I'm waiting for OS development to start up in rust as it is clearly the better choice then C/C++ for a kernel.

Re:Redox: A Rust Operating System by d9fb698e010974b on Tuesday September 29, 2015 @09:49AM (#10296244)
How easy is it to deal with raw memory in rust? That's the main reason for using C in my opinion.
Re:Redox: A Rust Operating System by zokier on Tuesday September 29, 2015 @12:15PM (#10297343)
I don't know what you mean by "deal with raw memory" but rust allows you to do silly things like:

    let foo = unsafe { std::slice::from_raw_parts_mut(0xdeadbeef as *mut u8, 42) };

That gets you a slice (pointer+length that can be used as an array) that points to 0xdeadbeef. Bit more verbose than the c equivalent

    char* foo = 0xdeadbeef;
but arguably this is pretty rare usecase even for handling raw memory
Re:Redox: A Rust Operating System by steveklabnik on Tuesday September 29, 2015 @09:53AM (#10296267)
You have to use `unsafe`, but you can do anything you can do in C. Raw pointers are the primary mechanism, same as C pointers http://doc.rust-lang.org/stable/book/raw-pointers.html
Re:Redox: A Rust Operating System by Jhsto on Tuesday September 29, 2015 @09:56AM (#10296286)
Not sure is it like this anymore, but might be worth giving a read:

> But allocating memory seemed like a fun exercise. To allocate something on the heap in Rust, you can do

> let a = ~2

> This creates a pointer to a 2 on the heap.

http://jvns.ca/blog/2014/03/12/the-rust-os-story/

Re:Redox: A Rust Operating System by zcdziura on Tuesday September 29, 2015 @10:03AM (#10296340)
That syntax has been changed, actually. Now, to allocated an owned pointer allocated on the heap, you use the Box type:

> let a = Box::new(2);

I believe it's an unstable feature currently to use the "box" keyword to heap-allocate a value, which can also be used in pattern matching. I saw somewhere that "box" will be made into an overloadable operator, such that you can easily create reference-counted and atomically reference-counted types.

Re:Redox: A Rust Operating System by steveklabnik on Tuesday September 29, 2015 @10:18AM (#10296438)
Yes, that's generally correct. We still haven't fully decided on the exact syntax. If anyone wants to get involved, this RFC was the one that got merged, but hasn't been made stable yet: https://github.com/rust-lang/rfcs/blob/master/text/0809-box-...

And this is the active, in-final-comment-period one which modifies it: https://github.com/rust-lang/rfcs/pull/1228

Re:Redox: A Rust Operating System by a-priori on Tuesday September 29, 2015 @10:10AM (#10296382)
Read this like Linus Torvald's comment about how Linux "won't be big and professional like gnu" comment from its early days.

I'm not saying Redox is the next Linux. But big things come from small beginnings, and good engineers are intensely aware of the limitations of their creations.

Re:Redox: A Rust Operating System by wldcordeiro on Tuesday September 29, 2015 @01:01PM (#10297659)
Which is immediately followed by.

"I do, however, have a plan. I will make all applications run in Ring 3. I will do malloc and free through syscalls. I will move significant pieces of functionality into userspace libraries (a new libredox). I will use file numbers to identify file descriptors, and create read/write/seek/close syscalls. I will document the syscalls interface, provide more example programs, including programs that test the correctness of the implementation."

So the creator is aware of and wants correct those issues.

Re:Redox: A Rust Operating System by d9fb698e010974b on Tuesday September 29, 2015 @09:35AM (#10296130)
Sounds a lot like a Commodore 64 or TempleOS, but in those this was/is considered an advantage.
Re:Redox: A Rust Operating System by clessg on Tuesday September 29, 2015 @09:32AM (#10296104)