Live data from Hacker News

Redox – A Unix-Like Operating System Written in Rust

redox-os.org

51–60 of 215 posts

Re: Redox – A Unix-Like Operating System Written in Rust

#51
post #18

Earlier quoted context omitted.

Operating systems aren't that big, and if you know your stuff, I'm sure it's not too hard to pull off. Here's an example I borrowed from StackExchange: According to cloc run against 3.13, Linux is about 12 million lines of code. 7 million LOC in drivers/, 2 million LOC in arch/, and only 139 thousand LOC in kernel/. ( http://unix.stackexchange.com/a/223753 ) Edit: Would be nice to have the numbers for the latest Mini…

Warning: I have no idea about systems programming. I understand that the amount of lines of driver code comes from the variety of devices. But still, it looks completely unbalanced, when compared to the kernel code itself. So I have some questions here: 1) Shouldn't there be common interfaces / abstractions for most of the devices? 2) If they exist, could they be improved somehow? 3) A bit unrelated, but how fun / in…

1/2. Yes there are. Network devices, file systems... most of the things that could be abstracted are done. However, take into account that every device has its special quirks and configurations. Only very generic devices can have generic drivers. But once you get to specific devices, you need specific drivers that can deal with special features and non-standard communications. See for example the number of vendors of ethernet drivers (https://github.com/torvalds/linux/tree/master/drivers/net/et...). And that is just a small part of the code.

3. Interesting? A lot. You get to learn how do low-level parts of your system work, deal with complex structures and interactions between kernel/hardware/userspace and.

But the most interesting thing is the programming ability you need. You have to really understand the code, be able mentally follow the execution paths (which are not simple, believe me) and write as few bugs as possible. Why? Because you don't have many tools. No debuggers, no unit tests... My main debugging tool is a set of debug macros that print to the kernel log. Debugging is a real pain in the ass and crashes can lead to a system restart, so I have to try to get it right as soon as possible.

I hope that also answers the "fun" part ;)

Re: Redox – A Unix-Like Operating System Written in Rust

#53
It is a shame that OS development is so dependant on toolchains that whatever focus an OS may have, it excludes other areas of development. For example, I very much like Genode. But to redo Genode in Rust would probably be harder than making a Unix-clone. Safe language or safe API's, it seems like you have to choose one.

Re: Redox – A Unix-Like Operating System Written in Rust

#54
post #18

Earlier quoted context omitted.

Operating systems aren't that big, and if you know your stuff, I'm sure it's not too hard to pull off. Here's an example I borrowed from StackExchange: According to cloc run against 3.13, Linux is about 12 million lines of code. 7 million LOC in drivers/, 2 million LOC in arch/, and only 139 thousand LOC in kernel/. ( http://unix.stackexchange.com/a/223753 ) Edit: Would be nice to have the numbers for the latest Mini…

Warning: I have no idea about systems programming. I understand that the amount of lines of driver code comes from the variety of devices. But still, it looks completely unbalanced, when compared to the kernel code itself. So I have some questions here: 1) Shouldn't there be common interfaces / abstractions for most of the devices? 2) If they exist, could they be improved somehow? 3) A bit unrelated, but how fun / in…

1) They do,

2) ... but the meat of a driver is putting the right values in the right registers of some chip, and sometimes work around bugs in said chip, or sometimes take into account that popular variant that's almost the same that the original but not quite... It takes a lot of boilerplate code.

3) It depends on your definition of fun. A driver by definition is a middle man between the OS and the hardware; so programming there is a lot about doing what you're told (and sometimes get punished harshly because you misunderstood something), either by the kernel documentation or by the datasheet of the chip you talk to.

Re: Redox – A Unix-Like Operating System Written in Rust

#58
post #9

I'm pretty impressed that 37 people are capable of writing an entire OS with a gui in under a year. Looks really cool.

Ours didn't have a GUI. It took us less than a year to write and the team was never larger than 6 people. It's less complicated than it seems at first sight.

There are a lot of things about machines that you need to understand, but the technology itself is relatively well-understood and sane practices are encouraged.

It blows my mind that less than twenty people can string up something non-trivial with Node.js et co.. Operating systems are trivial in comparison.

Re: Redox – A Unix-Like Operating System Written in Rust

#60

Oh man if we could get hard realtime scheduling in early, large, critical embedded systems like medical would benefit greatly!!!$$$

there are many, many RTOSes out there, most very well battle-tested. There really isn't a need for any more.
Post reply on HN