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.
  • (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]
    Starting Score:    1  point
    Moderation   +1  
       Interesting=1, Total=1
    Extra 'Interesting' Modifier   0  
    Karma-Bonus Modifier   +1  

    Total Score:   3  
  • (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.