Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Operating Systems

Redox OS 0.6 Released With Many Fixes, Rewritten Kernel Memory Manager (phoronix.com) 63

Redox OS, the micro-kernel based Rust-written operating system, is out with a new Christmas release. From a report: Redox OS 0.6 was released on Christmas Eve with many bug fixes and new features. Redox OS 0.6 features a complete rewrite of its RMM kernel memory manager, improvements to its Relibc C library implementation, Pkgar as a new package format, and Rust code compatibility updates. It's been the better part of two years since Redox 0.5 was released but moving forward they hope to start releasing new updates more often.
This discussion has been archived. No new comments can be posted.

Redox OS 0.6 Released With Many Fixes, Rewritten Kernel Memory Manager

Comments Filter:
  • Quick question? (Score:4, Interesting)

    by frank_adrian314159 ( 469671 ) on Friday December 25, 2020 @12:50PM (#60865370) Homepage

    How does Rust's memory model, which is so much better (supposedly) than C's require a memory manager rewrite because of all of the "memory leaks" (direct quote from project home page)? I thought that Rust's ownership model was supposed to take care of that sort of thing. Are we just replacing one memory bug-ridden implementation language with another?

    • Re:Quick question? (Score:5, Interesting)

      by Halo1 ( 136547 ) on Friday December 25, 2020 @01:18PM (#60865438)

      The Redox OS memory manager in question is for hardware memory management [redox-os.org]. Presumably that doesn't map 1-to-1 onto the user-level memory management that's built into Rust (just a guess; I've never used Rust).

      • Re:Quick question? (Score:4, Informative)

        by Waffle Iron ( 339739 ) on Friday December 25, 2020 @06:23PM (#60865982)

        It presumably won't map at all. Hardware memory managers deal with setting up the CPU's page tables and virtual addresses, and allocating them to processes, DMA buffers and the like. The whole thing is highly complex, and by definition would involve using the "unsafe" Rust keyword to allow them to poke directly into the CPU's page table structures at fixed physical addresses.

        That has nothing to do with the standard software memory management inside user processes, which simply dole out blobs of user-space memory from the heap using malloc() and free(). The standard "safe" Rust memory model encapsulates all calls to malloc and free behind RAII-like constructs that make it very difficult to ever access invalid memory or create other bugs like double-frees.

        • So what's the difference between this and a STL auto_ptr?
          • There are countless differences. One of the most significant is that Rust will not allow you to create aliases to its references unless there is no possibility of mutating the references.

            In C++, you can just copy the value address in the auto pointer to some other variable, then delete the auto pointer. Now you have a dangling reference.

            Maybe you say "well, just don't do that". But there are indirect ways to do this that aren't obvious to spot. In a similar vein, if you create an iterator on a C++ vector, t

          • by alexo ( 9335 )

            For one, auto_ptr was deprecated since C++11 and removed from the standard in C++17

    • Re:Quick question? (Score:4, Informative)

      by DamnOregonian ( 963763 ) on Friday December 25, 2020 @02:37PM (#60865576)
      First off- Rust doesn't have a "memory model" in any reasonable sense of that word, outside of what C or C++ has.
      What it has is memory management.

      Memory models are really (in the context of native languages) more dictated by the operating system than the language runtime.

      You've got constants loaded in with your executable image, you ask the OS for some heap, move initialized variables over there, and you've got stack.
      Outside of that, you're free to ask the OS for more heap space, or for free anonymous (or mapped) pages.

      Rust tries to put it in the place that makes the most sense, but there's nothing inherently safer about any of these areas outside of the classes of mistakes one can make in each, which Rust generally disallows anyway, and which you use is more about speed (are you using direct or indirect addressing modes, and is there a cost on your architecture?) and reasonableness (heap can be easily extended, anonymously mapped pages may get moved if you try), stack is of course really limited to the frame you're working in (unless you like to live dangerously)

      As someone below you mentioned, this is actually the slab allocator for the kernel, for managing virtual memory, so Rust doesn't even factor in.
      In fact, if you check the allocator, you'll notice that every single function in it is marked unsafe; which of course is one of the jokes often made about Redox- what's the point of writing an OS in a language with built in training wheels if you have to explicitly move them to do anything OS related.

      I mean sure, the object for a VirtualAddress may be safe code, but that's not really the problem with C, now is it?
      Oh well, language fads come and go. The guy who does this knows what he's doing (And writing your own allocator is literally year 1 of CompSci) so perhaps the mistakes that were made are "why we need Rust"
      • by Bengie ( 1121981 )
        Some code is "unsafe", the other 98% is "safe". Unlike C/C++, where 100% of the code is "unsafe". What we really need is bugs per loc to make a better apples-to-apples comparison.
        • Some code is "unsafe", the other 98% is "safe". Unlike C/C++, where 100% of the code is "unsafe".

          In the context of Redox though, this is flatly false.
          To which I say, use the right tool for the job.
          If you have to use purely unsafe mechanisms in your safety enforcing language, you're using the wrong tool for the job.
          You can write crt0 in C if you like, but that's the wrong tool for the job.
          I would argue that if you're resorting to the wrong tool for the job, you're probably more likely to make the basic mistakes that Rust would have saved you from if you hadn't disabled its safety features.

          • by Bengie ( 1121981 )

            If you have to use purely unsafe mechanisms in your safety enforcing language

            Where? The best I was able to find was Redox only has about 2% unsafe code back around 2016-2017. Some areas of code heavier than others, but overall only 2%. And I'm not sure what the constitute as "the kernel". Maybe they were leaving out drivers. But this about falls in line with what I've ready about Rust implementations. Something around 5% of the code was unsafe for many projects. Worse for projects that dealt with lower level issues.

            But even "unsafe" doesn't disable all safety mechanisms. You still

            • Where? The best I was able to find was Redox only has about 2% unsafe code back around 2016-2017.

              I'm not really sure where you get that number from. You can check it out from git.
              The kernel is positively rife with unsafe blocks. This isn't a bad thing- nor should it be unexpected. It's what must be.
              It would be very difficult to come up with a "LOC" metric for safe vs. unsafe without unwinding unsafe blocks. Maybe someone with sufficient emacs skillz could do. Or a quick perl script, but I'm too lazy for that.
              What I can tell you, is that every expected interface within Redox's kernel is unsafe. The a

              • by Bengie ( 1121981 )
                You have made me question what I "remember". I shall watch this project with a more critical eye. Thanks for your responses, regardless of anything else, they made me think.
      • And writing your own allocator is literally year 1 of CompSci
        No it is not. Was not even covered in my 10 years of school and university education.

        (Does not mean it is difficult, only means: you are an idiot).

        • Yes, it is.
          At least at the UW.
          Maybe the University of Kentucky failed you?
        • Forgive me- you're European.
          You guys have rather subpar CS education programs. I'll give exceptions for Cambridge or Oxford, but I think we both know you didn't go to either of those.
          10 years and never had to write an allocator though- that's pretty fucking bad. Shame on them for giving you a degree.
          • You are just an idiot.

            No one teaches something so simple as a malloc/free library in an university or school.

            If you had that as a class topic in your university, that school must have greatly sucked.

            Good luck with drawing in "big names".

            Shame on them for giving you a degree.
            And why actually would that be the case? Moron?

            • I mean, US Universities are objectively better than European universities on the topic of CompSci, and what I said regarding allocators being taught is true, so I mean, you're quite clearly the odd one out here.
              It's ok. Don't take it so personally. If you move here, go back to school (and possible rescue your woeful CS education), maybe you could make as much as us.

              I doubt it though.
              Back to school with you, you sad little insecure man. [mit.edu]
              • US universities are not better.

                Considering if there were not student exchange programs an US student could not even study in Europe. Because your education standard are to low.

                If you move here,

                Why the funk would I move to a third world country?
                * no internet - at least not fat
                * no health care
                * absurd housing prices
                * pollution
                * high crime rate
                * people can even wear guns
                * electricity problems
                * in most cities you can not drink tap water

                Seriously? Why would I go to a fucked up country like yours?

                maybe you could

                • You must learn to lose with more grace.

                  Why the funk would I move to a third world country?

                  Oh god. You dumb motherfucker.
                  Last I checked, we had the largest GDP in the world, and one of the largest GDPs per capita.
                  Do this country have its problems (particularly given the economic disparities between the coasts and middle)? sure. Doesn't change the facts.

                  And why would I want to do that? I make about 50k - 100k working 2 - 3 month a a year. No one needs 400k in LA or SF if he has to spend 200k on the house alone ...

                  A 200k mortgage is pennies to someone making 400k. Do you still live with your parents or something?
                  Hell, I make half that and can afford a house around 16x that price. I don't need to of course, because du

                • Considering if there were not student exchange programs an US student could not even study in Europe. Because your education standard are to low.

                  Forgot to address this bizarre claim.
                  I was specifically speaking to US CS programs, not our "education" in general, and given that our top CS program are run by private universities, it is even more nonsensical of a claim; so I'm not sure how that claim was relevant at all, really.
                  You can google for lists based on various metrics. You go ahead and get back to me when you find one with a European school at the top.
                  You won't though, because it simply isn't the case.

                  I am in a position these days where I a

                  • Sorry, the best CS educations are:
                    Aachen, Karlsruhe, Stuttgart, Munich - all German
                    Grenoble - France
                    Zürich - Switzerland
                    (in no particular order)

                    US might have better or quicker or better funded Phd programs - and thats it.

                    I never met an american Bachelor or Master who had any clue about CS. Might be because they needed to waste their time writing "memory allocators" :D

                    • Sorry, the best CS educations are:
                      Aachen, Karlsruhe, Stuttgart, Munich - all German
                      Grenoble - France
                      Zürich - Switzerland
                      (in no particular order)

                      Give me one external opinion corroborating that claim, and I will at least assign your opinion some value.
                      Mine will be more valuable of course, since I will be able to provide several opinions of organizations of significant standing worldwide (including Europe) backing up my claim (I didn't make it in a vacuum of evidence, afterall)

                      US might have better or quicker or better funded Phd programs - and thats it.

                      Of course better funded. We have enormously more money than you guys do. It's not a personal dig, it's just a fucking fact.

                      I never met an american Bachelor or Master who had any clue about CS. Might be because they needed to waste their time writing "memory allocators" :D

                      Oh spare me.
                      90% of the code running every piece of

                    • 90% of the code running every piece of hardware you're using to talk shit to me right now was written by an American.
                      Double wrong, I don't talk shit and this device only has a few parts from america, and that is the intel processor and half of the android source code, the other half comes from other people ... you are so silly it is unbelievable. And a big deal of my apps are from europeans, rofl. Telegram from Russians if you want to nitpick ... lol.

                    • Double wrong, I don't talk shit and this device only has a few parts from america,

                      Good retort. No, seriously. Your argumentative skills are fucking legendary.
                      I can see they left that out of your education too. Be more wrong. Please- keep going.
                      It's no fucking wonder the EU has a smaller per-capita GDP than Canada.

                    • GPD is meaningless.

                      If the EU simple doubles all prices and all wages, the GPD doubles, without any change in anything.

                      So much to your education.

                      Perhaps you want to check how the EU us composed, then you would realize, that some members have a relatively low GDP and others a quite high one. Comparing an average of 20+ countries with a single small one: makes no sense.

                    • GPD is meaningless.

                      This is perhaps one of the stupidest things I have ever read.

                      If the EU simple doubles all prices and all wages, the GPD doubles, without any change in anything.

                      How very simplistic of you.
                      Of course, the value of the currency of said market would immediately halve, and since one generally uses a real currency value, not nominal (US dollars fixed at a date is popular) - your claim is directly false.

                      So much to your education.

                      See above. That's basic market economics. So very fucking basic.

                      Perhaps you want to check how the EU us composed, then you would realize, that some members have a relatively low GDP and others a quite high one. Comparing an average of 20+ countries with a single small one: makes no sense.

                      One could argue the same for the United States, as they're both single markets with various levels of traded sovereignty with their federal entity.

                    • Sorry, the one with lack of education is you.

                      Look at Switzerland. Prime example for a country with artificial high prices and wages, and thus a high GPD which is based by nothing, just like the US GPD is basically based by nothing but purely on the value of companies at the stock markets.

                      Ooops ... no idea how one can be so stupid to use GPD for anything except a rough comparison.

                      Obviously a country like Greece has a low GPD for a reason, and if you compare it with with San Marino it looks "bad". Nevertheles

                    • Nevertheless it is close to meaningless.

                      No, it is not. And I explained why.

                      You don't know the difference between real and nominal. That's understandable. You've made it quite clear you received a shit education.

                      But hey, what's the point of arguing? I mean, you seem to know something that no other economist in the world knows, so fuck, who am I to argue with a paragon of economic knowledge?

                      Seriously dude, you're one dumb motherfucker. You deny basic fucking truths that are known throughout the world. I could provide citations until the sky f

                    • You know what a Big Mac Index is?

                      Why does a Big Mac in Switzerland cost more than in USA?

                      Hm?

                      Good luck with your pseudo economic knowledge. Lucky you do not need it for daily live decisions :P

                    • So much facepalm.
                      A Big Mac Index is a metric for PPP.
                      Since I already discussed PPP above, it's clear you're just searching for shit you don't understand now.
                      Try harder.
                      Hint: I actually went to college, unlike your dumb ass.
                    • Pfft ...
                      I went to university.

                      And studied SCIENCE.

                      You did not. It seems you studied "economics" ... that is why you bully me with your nonsense :P

                      Point is: if a country simply doubles all prices it has doubled its GPD. You want to deny that: and that makes you an idiot :P so much to studying "economics".

                  • mY coUnTrY hAs GoOd uNivErsItiEs aNd iT mAkEs mE bEtTer@EvErYthIng. This fucking neckbeard posterchild has a PhD @ Arrogance. Reading the shit you write makes me root for the legalization of murder.
                    • Reading the shit you write makes me root for the legalization of murder.

                      And looking at this abortion of a comment makes me question socialism. In a less sophisticated society, you'd have died off by now.
                      Go make me a burger, you Dunning-Kruger fuckstick.

                    • How ironic, the guy who flies commercial asked me to "Cook him a burger". And at the same time, the same sophisticated society you're trying to infer is keeping me alive - is what allowed genetic waste like you to survive, not me. In the brutal chain of ascension, you are nothing. Your attempt to label my response as being part of the Dunning-Kruger effect is ironic since you are the neckbeard who told David Kaeli 'he was clueless', about a subject he basically invented, this was a couple of weeks ago in
                    • Let's break down this wall of text written by someone who clearly just barely possesses the structural thought capabilities of a 5 year old.

                      How ironic, the guy who flies commercial asked me to "Cook him a burger".

                      If you're implying that you do not, give me a fucking break.

                      And at the same time, the same sophisticated society you're trying to infer is keeping me alive - is what allowed genetic waste like you to survive, not me.

                      There are probably many metrics by which someone can judge someone else to be "Genetic Waste", but just judging the 2 books in front of us by their respective covers, my money is on me not being the one occupying that particular category. Your writing is fucking brain diarrhea. So I think it's gonna be a bit ha

                    • If I ask you what 'level' you consider yourself to be, you would probably rate yourself above nature.

                      I do have an EB-5 for as far as I can remember, since my parents sink money into Miami since the early 1980's, real estate, a drop ship company a couple Brazilian style restaurants, and Nelore Beef import from our own farms. You're claiming that I do not have something I have - this is absurd!

                      Your ego gymnastics won't reverse history, it will not warp time/space and change my reality - you wish you coul

                    • If I ask you what 'level' you consider yourself to be, you would probably rate yourself above nature.

                      Above nature? What the fuck does this even mean?

                      I do have an EB-5 for as far as I can remember, since my parents sink money into Miami since the early 1980's, real estate, a drop ship company a couple Brazilian style restaurants, and Nelore Beef import from our own farms. You're claiming that I do not have something I have - this is absurd!

                      LOL. Ya.
                      You literally made this account just to fuck with me. You don't have shit, kid.

                      The original concept of a Brutal Chain of Ascension does not come from SC, but from Albert Pike letters dating back to 1870's, which you obviously didn't read, since you pointed out the first 'pop culture' reference to the phrase. There are many things you don't know.

                      Pike wrote of many chains. Ascension wasn't one of them ;)
                      Go back to school, kid.

                      Reading the shit you write makes me realize how fortune I am, I could be you, in your shoes, and I am glad that I am not.

                      Yes, and reading what you write makes me wish we had basic literacy tests before internet access was allowed. Alas, I don't think either of us are going to have our way.

                      Regarding the talk at hand, here's my sincere opinion regarding the profane obsession with these institutions, fuck them, fuck Europe and fuck you too, you annoying cuck.

                      Lose harder, little man. Lose harder.

                    • You're saying that Pike didn't write something he wrote.

                      You're saying I don't have something I objectively have.

                      Waste of time.

                    • You're saying that Pike didn't write something he wrote.

                      No, I'm calling you a liar.
                      Feel free to provide a citation, and I'll apologize. But I suspect my theory below is what's really going on here.

                      You're saying I don't have something I objectively have.

                      Of course I am. But there's more nuance. What I am saying, is that here, we can claim whatever we like, and only what we can show matters.
                      Since you cannot show that, it isn't relevant, and for the sake of this argument, does not exist.

                      You called me a "cuck", cited Albert Pike (incorrectly, until you prove otherwise), used a term that comes from a video game, in a w

                • US universities are not better.

                  They are absolutely unquestionably better. Go ahead try to find a university ranking that puts an EU university in the top 10, because all of the well known ones I've seen them rank them quite poorly indeed. The best schools are in the US and the UK. I mean jesus, Harvard University by itself has racked up more noble prizes than all of Germany. Even little countries like Canada and Switzerland usually dominate the EU in university rankings. EU schools are generally substandard, which is why international st

                  • You must be an idiot :P

                    You seem to compare private schools with public schools.

                    And you forget: the rankings in the US are made by .... Ta ta ta: previous alumni of those schools. There is no independent ranking of american schools. Americans can usually only study in Europe via special exchange programs: because they do not have the knowledge required as prerequisite. Sad, that you do not know that :P

                    There is basically not a single highschool in the USA that prepares its graduatess to pass entry requiremen

                    • You must be an idiot :P

                      Very classy.

                      You seem to compare private schools with public schools.

                      Well why wouldn't I? A university is a university public or private makes no difference. You're only objecting to including private schools because the EU doesn't have any good private schools.

                      And you forget: the rankings in the US are made by .... Ta ta ta: previous alumni of those schools. There is no independent ranking of american schools.

                      I'm not talking about American rankings of American schools, I'm talking about international rankings of the worlds schools. I don't know why you'd claim there is no independent ranking of American schools when one of the most widely cited university rankings [qschina.cn] comes from China. Although given that the Chine

                    • A university is a university public or private makes no difference.
                      As you see: you are an idiot.

                      Private schools are extremely rare in Europe. Obviously, if you really want: you can always found a private school and make it "the best school"

                      Indeed according to the Chinese the best school in the whole of the EU is Technical University of Munich which only comes in at number 50.
                      Usually you include a topic. E.g. computer science. In that case Munich is amoung the top 4 of Germany and probably amoung the top te

                    • Private schools are extremely rare in Europe. Obviously, if you really want: you can always found a private school and make it "the best school"

                      Private schools are actually very common in Europe, in the UK specifically. Which no doubt in part explains why their schools are the best in Europe. But if creating quality private schools is so easy as you claim, why do the EU countries continue to settle for the mediocre ones they have now? You should write a letter to Brussels about your easy solution to their educational woes.

                      Usually you include a topic.

                      No you don't. Schools are usually rated generally based on their overall academic achievements. That's why the general ranking i

                    • Private schools are actually very common in Europe, in the UK specifically.
                      That is kind of an oximoron, right?

                      No: outside of the UK, private schools are very uncommon. Sorry.

                      Indeed, and an even greater shame for the whole of the EU, with over 10 times Canada's population, to have only 1!. I'm glad to see that you are finally coming around to my view.
                      According to your criterias perhaps. Not to ours. Sorry, I don't know countries outside of Europe that have schools or universities consistently on a higher le

    • Re:Quick question? (Score:4, Interesting)

      by Jeremi ( 14640 ) on Friday December 25, 2020 @03:38PM (#60865700) Homepage

      How does Rust's memory model, which is so much better (supposedly) than C's require a memory manager rewrite because of all of the "memory leaks" (direct quote from project home page)? I thought that Rust's ownership model was supposed to take care of that sort of thing.

      If you thought that, you were mistaken [rust-lang.org]. Rust completely prevents a number of memory-related programming errors, but memory leaks are not one of them (although Rust does make it easier to avoid leaking memory than some other languages do).

      Are we just replacing one memory bug-ridden implementation language with another?

      Of course -- every implementation of anything has bugs. But it's pointless to think in absolutes -- the goal of the exercise here is to replace a more-bug-ridden language with a less-bug-ridden language, and thereby asymptotically approach a 100% bug-free system that we will admittedly never quite get to, but with time and effort we can get arbitrarily close to.

    • So decades ago I inherited a driver that kept a cache of things. The problem was it really wasn't a cache - but a list of all things that the driver had seen before... So the driver would put things into the cache - and leave them there... No there were no "memory leaks", but the system would run out of memory as things accumulated in the cache. This is the magic of memory management - if you don't manage your memory correctly... knowing when to allocate memory - and when you can delete it, there is no mag
    • by Bengie ( 1121981 )
      Same way you can leak resource in any managed memory language, not referencing the resource.

      The main benefit of Rust's ownership model is it can prove at compile time when memory will be deference and ready to be cleaned up without runtime GC. The ownership model also allows to prove certain race-conditions for multithreaded memory access.
    • An implementation of a memory safe language either has to be implemented in a memory unsafe language somewhere down the line, since the processor and memory are not themselves memory safe. If Rust were memory safe it would be useless for implementing a micro kernel, since most of the code would have to be implemented in another language which could handle the memory unsafety of the memory and process.

      What rust actually does is reason allow you to reason about large parts of the program preventing lots of me

  • There's already a plan to close the source?
  • will it get rustier?
  • Micro kernels were invented to make the system fault tolerant for bugs in each subsystem, implemented as separate "servers" having their own memory space. But it takes a few percent out of the systems performance because operations have to be send to various servers to be completed, where a monolithic kernel can do with on system call.

    But Rust removes many of the typical errors you do in C. Therefore the need of the micro kernel architecture is somewhat eliminated.

    • So what, pray tell, is the philosophical difference between a micro-kernel OS and an monolithic OS running on top of a hypervisor using virtualization? It's accomplishing the same goal (running on shared hardware with their own memory space), though obviously through different means? I guess the hard work is making sure the hypervisor is fault tolerant. I think the day is here that we admit that the philosophy of micro kernel has won, just in the roundabout. Now we just have to take the time to remove the c
      • The purpose of a micro kernel is not to have separate systems running on the same hardware, which is the purpose of a hypervisor. The aim of a micro kernel is to separate the file system from the network stack from the scheduler etc in different memory spaces to avoid them crashing each other, and being able to restart a subsystem on errors.

        It is a long stretch to call a hypervisor a micro kernel. A hypervisor is a hardware simulator, which is a complete different beast. Each client is most likely a macr

        • I know what a micro kernel is...and I completely understand what it does. What I was getting at is the philosophy behind the desire to create a micro kernel OS. I'm not calling a hypervisor/VM architecture a micro kernel, but it is accomplishing the same or similar tasks philosophically, just through a roundabout means.

I judge a religion as being good or bad based on whether its adherents become better people as a result of practicing it. - Joe Mullally, computer salesman

Working...