Stories
Slash Boxes
Comments

SoylentNews is people

posted by Fnord666 on Saturday September 15 2018, @10:42PM   Printer-friendly
from the rusty-news dept.

Submitted via IRC for TheMightyBuzzard

Programming languages tend to polarize, and Rust is by far no exception. Whether it will stick around and grow as an alternative for the lower levels or not — time will tell. In the meantime, if you're curious about the language and its low-level abilities yourself, [phil-opp] has written a series of blog posts on building your own little bare metal kernel in Rust.

Starting from the basics, [phil-opp] describes in detail the set-up and build process to create a standalone executable that won't be linked against the Rust standard library. From here he proceeds to build a simple operating system kernel that prints a good old Hello World via VGA output — QEMU emulation included. And of course, there is a GitHub repository with all of the source code.

Source: https://hackaday.com/2018/09/08/pun-intended-bare-metal-attracts-rust/


Original Submission

This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
(1)
  • (Score: 3, Interesting) by Apparition on Saturday September 15 2018, @10:49PM (2 children)

    by Apparition (6835) on Saturday September 15 2018, @10:49PM (#735450) Journal

    I am far from a programmer (Commodore BASIC in the '80s and '90s and TCL in the '90s and early '00s as a hobbyist was about the extent of it), but didn't Redox OS [redox-os.org] already write an operating system kernel in Rust?

    • (Score: 1, Interesting) by Anonymous Coward on Saturday September 15 2018, @10:58PM

      by Anonymous Coward on Saturday September 15 2018, @10:58PM (#735456)

      They felt ready. [radox.co.uk]

    • (Score: 1, Insightful) by Anonymous Coward on Sunday September 16 2018, @08:41AM

      by Anonymous Coward on Sunday September 16 2018, @08:41AM (#735581)

      What a useless description of the OS!

      "Redox is a Unix-like Operating System written in Rust, aiming to bring the innovations of Rust to a modern microkernel and full set of applications."

      At least if you don't know what "the innovations of Rust" might be.

  • (Score: 0) by Anonymous Coward on Saturday September 15 2018, @11:03PM (13 children)

    by Anonymous Coward on Saturday September 15 2018, @11:03PM (#735461)

    TMB trying to convert us into Programmers! If you haven't had your programming shot, consider it now!

    • (Score: 4, Informative) by c0lo on Saturday September 15 2018, @11:20PM (5 children)

      by c0lo (156) Subscriber Badge on Saturday September 15 2018, @11:20PM (#735465) Journal

      Living with chronic programming is not that bad.
      I'm having it for more than half of my life, it's easier and cheaper to manage than, e.g., smoking.
      Well managed and it even allows you to go fishing without the worry of the next day finances.

      --
      https://www.youtube.com/watch?v=aoFiw2jMy-0 https://soylentnews.org/~MichaelDavidCrawford
      • (Score: 2) by takyon on Saturday September 15 2018, @11:35PM (4 children)

        by takyon (881) <takyonNO@SPAMsoylentnews.org> on Saturday September 15 2018, @11:35PM (#735480) Journal

        Chronic programming = chronic sitting = death!

        --
        [SIG] 10/28/2017: Soylent Upgrade v14 [soylentnews.org]
        • (Score: 0) by Anonymous Coward on Saturday September 15 2018, @11:39PM (2 children)

          by Anonymous Coward on Saturday September 15 2018, @11:39PM (#735483)

          Chronic programming = not getting paid = poverty = starvation = death.

          I program on the floor because I can't afford a chair.

          • (Score: 0) by Anonymous Coward on Sunday September 16 2018, @08:36AM (1 child)

            by Anonymous Coward on Sunday September 16 2018, @08:36AM (#735580)

            That just means you're bad at

            1) programming
            2) marketing your skills
            3) both of above

            • (Score: 0) by Anonymous Coward on Sunday September 16 2018, @02:18PM

              by Anonymous Coward on Sunday September 16 2018, @02:18PM (#735652)

              You forgot

              4) too old

        • (Score: 2) by c0lo on Sunday September 16 2018, @12:25AM

          by c0lo (156) Subscriber Badge on Sunday September 16 2018, @12:25AM (#735491) Journal

          I'm on my "death bed" then. 'Cause I find it more comfortable to program than a chair.
          (True, I still need to use a chair at the office :( )

          Other than that, couple it with smoking and you are good: each hour you take a stroll to the smoking place, no longer sitting.

          --
          https://www.youtube.com/watch?v=aoFiw2jMy-0 https://soylentnews.org/~MichaelDavidCrawford
    • (Score: 2) by The Mighty Buzzard on Sunday September 16 2018, @12:51AM (6 children)

      by The Mighty Buzzard (18) Subscriber Badge <themightybuzzard@proton.me> on Sunday September 16 2018, @12:51AM (#735500) Homepage Journal

      Damn, busted. I figure if more people think logically by default, more people will be worth talking to.

      --
      My rights don't end where your fear begins.
      • (Score: 3, Funny) by Anonymous Coward on Sunday September 16 2018, @01:31AM (1 child)

        by Anonymous Coward on Sunday September 16 2018, @01:31AM (#735512)

        What a strange spectacle it would be,
        to have a buzzard speaks so absolutely.
        Parroting away songs and hymns,
        to his fellow logical friends online.

        Oh Alexa! How I love you so!
        Your cadence, acute yet soft,
        Your product advice it truly a must.

        Ahoy Cortana! What utility you bring!
        Who else could I ask,
        "Reboot away from this ocean-blue screen!"

        Hey Siri, I adore you all the more!
        Who else will tell me the time,
        without me having to lift a single finger of mine!

        OK Google I saved the best for last!
        Who else could I trust,
        to find me API specs on this newfangled abomination called Rust!

        And so the buzzard continues on,
        talking to his machines offline and on.
        Where it would take him, only Waze knows.
        For this mighty buzzard, likes circling about, digging in toes.

      • (Score: 0) by Anonymous Coward on Sunday September 16 2018, @12:43PM (3 children)

        by Anonymous Coward on Sunday September 16 2018, @12:43PM (#735636)

        Physician, heal thyself.

        • (Score: 2) by The Mighty Buzzard on Sunday September 16 2018, @02:02PM (2 children)

          by The Mighty Buzzard (18) Subscriber Badge <themightybuzzard@proton.me> on Sunday September 16 2018, @02:02PM (#735650) Homepage Journal

          Bitch, please. I can out-logic anyone here in offline matters. It takes the whole damned site to provide any useful debugging of my positions.

          --
          My rights don't end where your fear begins.
          • (Score: 1, Touché) by Anonymous Coward on Sunday September 16 2018, @03:21PM (1 child)

            by Anonymous Coward on Sunday September 16 2018, @03:21PM (#735666)

            Grindr tracks positions, you know. might make it easier than virtually engaging in them here.

  • (Score: 3, Interesting) by MichaelDavidCrawford on Saturday September 15 2018, @11:27PM (5 children)

    by MichaelDavidCrawford (2339) Subscriber Badge <mdcrawford@gmail.com> on Saturday September 15 2018, @11:27PM (#735471) Homepage Journal

    Like the ARM7TDMI. I used to do Thumb firmware for the Oxford Semiconductor line of Firewire/USB to IDE bridge chips.

    The first instruction always selected the endianness. There were a few other setup instructions that I don't recall, then it entered an infinite loop written in C at first then later C++.

    All I/O was done by polling. There was no heap allocation - just stack and globals.

    Those particular target boards are no longer made, but Atmel sells a wide variety of target boards.

    My Oxford boards could receive firmware through a proprietary mechanism that could not be erased. The only "debugger" was a bank of eight LEDs that I could turn on and off individually.

    I eventually clued in to the use of "while ( true ) ;" as the losing part of assertions. The watchdog reset quickly caught this, then my eight LEDs boogied for a little bit, eventually to trip the assert, the LEDs would stop boogieing then the watchdog would reset again.

    --
    Yes I Have No Bananas. [gofundme.com]
    • (Score: 1, Interesting) by Anonymous Coward on Saturday September 15 2018, @11:47PM (2 children)

      by Anonymous Coward on Saturday September 15 2018, @11:47PM (#735485)

      "while ( true ) ;"

      I prefer to write "for (;;)" which I read as "forever".

      • (Score: 1, Informative) by Anonymous Coward on Saturday September 15 2018, @11:57PM

        by Anonymous Coward on Saturday September 15 2018, @11:57PM (#735489)


        #define forever for (;;)
        forever {
        }

      • (Score: 1) by istartedi on Sunday September 16 2018, @08:45AM

        by istartedi (123) on Sunday September 16 2018, @08:45AM (#735582) Journal

        I was taught that

        for (;;)

        is the preferred idiom because the parser recognizes it as a unique situation. The while-loop looks like any other while-loop in the parse tree. Of course any compiler that didn't ultimately optimize them to the same code is an awful compiler.

        --
        Appended to the end of comments you post. Max: 120 chars.
    • (Score: 2) by The Mighty Buzzard on Sunday September 16 2018, @12:52AM (1 child)

      by The Mighty Buzzard (18) Subscriber Badge <themightybuzzard@proton.me> on Sunday September 16 2018, @12:52AM (#735502) Homepage Journal

      They're nothing special, really. The documentation is just shittier.

      --
      My rights don't end where your fear begins.
(1)