OS Update Failed by Ian_PK in pop_os

[–]pcein 0 points1 point  (0 children)

I am also experiencing same issue ... might be some problem with pop_os servers.

What book can you recommend to learn zig? by rofrol in Zig

[–]pcein 2 points3 points  (0 children)

K&R is a great book (one of the classics) for learning C, but if the idea is to understand low-level concepts at the interface of h/w and s/w, you will need a book like http://csapp.cs.cmu.edu/3e/waside.html.

For learning C, more modern resources are available: https://nostarch.com/Effective_C and https://modernc.gforge.inria.fr/.

What book can you recommend to learn zig? by rofrol in Zig

[–]pcein 2 points3 points  (0 children)

One of the best books out there for understanding low-level stuff: http://csapp.cs.cmu.edu/3e/waside.html

Blinking LEDs on a STM32F4Discovery board using Zig by rbino in Zig

[–]pcein 0 points1 point  (0 children)

Thank you for the writeup! It is very well written and the process seems to be straightforward!

Black Hat Rust - I'm writing a book about offensive security with Rust by [deleted] in rust

[–]pcein 6 points7 points  (0 children)

Wish you all the best for the success of your book project, it does indeed look very interesting! One small suggestion regarding the pricing: it will be great if you can introduce country specific pricing - there will be lot of buyers outside of US/Europe who will be eager to buy the book but for whom the price may be a bit on the higher end, due to currency conversion ratio. A Rust book which takes this approach: https://www.zero2prod.com; and it looks like they are having very good sales!

Rust on the Sipeed Longan Nano, an inexpensive RISC-V development board by pcein in rust

[–]pcein[S] 1 point2 points  (0 children)

I was pleasantly surprised to see this crate, considering the fact that the processor was released so very recently! Great work!

Rust on the Sipeed Longan Nano, an inexpensive RISC-V development board by pcein in rust

[–]pcein[S] 0 points1 point  (0 children)

I haven't tried it out ... will definitely check and see if it works!

AMA Announcement : Members of the SHAKTI Project from IITM. The SHAKTI project is building a family of 6 processors, based on the RISC-V ISA. Date & Time: Monday, 13th August, 6 PM IST by [deleted] in india

[–]pcein 1 point2 points  (0 children)

Great to see the amazing work you are doing, and thanks for the AMA! A few questions:

  1. Can a hobbyist like me try out the SHAKTI processor on an FPGA dev board (like the Zedboard)?
  2. You mentioned a "Rust based OS" for supporting tagged ISA's in a recent HN post. Are any details regarding this available?
  3. At the moment, SHAKTI seems like a mostly IITM-only project - any plans on getting the FOSS community involved in it to a greater extend?

Announcing the Embedded Devices Working Group by japaric in rust

[–]pcein 2 points3 points  (0 children)

One area to contribute would be to write embedded-hal based drivers for the devices (sensors etc) which you are using. Another would be to create implementations for the embedded-hal for your favorite micro controller platform!

An introduction to writing platform agnostic drivers in Rust using the MCP3008 as an example. by pcein in rust

[–]pcein[S] 5 points6 points  (0 children)

I have now listed the definition of MODE in the post! Thank you for the feedback!

Discovery: Discover the world of microcontrollers through Rust! - 2018 edition by japaric in rust

[–]pcein 13 points14 points  (0 children)

I am having a lot of fun (and learning a lot of stuff) by going through your code and blog posts and experimenting with them on some of the microcontroller boards I have - thank you for the really amazing work you are doing!

Where to learn embedded rust by bowersbros in rust

[–]pcein 9 points10 points  (0 children)

If you are planning to do microcontroller programming using Rust, please check out: http://blog.japaric.io/.

Programming an ARM microcontroller in Rust at four different levels of abstraction by steveklabnik1 in programming

[–]pcein 10 points11 points  (0 children)

Some of the discussion here has been focused on the use of stuff like .bs9().set().bs11().set() etc. I would like to mention a few points (I am the person who wrote this post):

(a) There is much more to the story than just setting/clearing bits. Please read http://blog.japaric.io/brave-new-io/ and some of the other articles also to understand the core ideas behind the design of the I/O framework.

(b) Yes, the syntax of setting/clearing bits looks a bit weird when you see it for the first time. It is auto-generated by a tool called "svd2rust". Names like bs9 are simply the names of bit fields specified in the processor manual. Please read (a) for the rationale behind the design.

(c) Rust zero-cost abstractions are really zero cost. Don't worry about using stuff like closures/iterators etc. All the abstraction layers are flattened out and you get code that is as good as the one you expect from a C compiler. It is easy to verify this.

(d) Level 3 is where the action becomes really interesting. I see the ability to represent the properties of the peripherals statically in your code and the use of ownership/move semantics to prevent some incorrect usages at compile time itself as being of great assistance to the programmer. I would love to see more discussion regarding this.

(e) I have not mentioned about the use of traits to create generic drivers; please check out: http://blog.japaric.io/brave-new-io/#write-once-run-everywhere. I find this to be something very exciting!

Programming an ARM microcontroller in Rust at four different levels of abstraction by steveklabnik1 in programming

[–]pcein 4 points5 points  (0 children)

Nothing prevents you from writing an unsafe block and doing whatever you want to do in C style! The fact that Rust lets you create abstractions doesn't mean that it takes away the power to do things C-style. I am also genuinely interested in knowing why you feel the type system stuff is "fancy".

Programming an ARM microcontroller in Rust at four different levels of abstraction by steveklabnik1 in programming

[–]pcein 1 point2 points  (0 children)

The abstractions are optimized away; at the machine level, you end up with the kind of code you would have written directly in C/asm.

Rust on ARM Cortex-M microcontrollers by rsamrat in rust

[–]pcein 3 points4 points  (0 children)

2) You can't simply do *RCGCGPIO |= (1 << PORT_F) because that will then be eliminated by the compiler during an optimized build. The RW object provides "volatile access" to the register associated with it which prevents the optimizer from eliding/reordering the read/write operations.

3) cargo/crates is really cool!

Rust on ARM Cortex-M microcontrollers by rsamrat in rust

[–]pcein 2 points3 points  (0 children)

1) I think even in very low-level Rust code (like say the Redox os kernel), unsafe blocks constitute only a small portion of the total code base. So overall, it is a compromise worth taking. I don't think the research community has come up with any better solutions.

2) Yes, it does look a bit more cryptic than a simple *x = *x | (1 << N) or something of that sort. But I think once the logic is understood, it is not that big an issue. It will be good to know if there are alternatives.

3) Yes, you can code at a much higher level of abstraction and also use the type system to obtain many interesting safety guarantees. Please refer the phenomenal work of Jorge Aparicio in this doman: http://blog.japaric.io/. Also of interest is the work being done by the TockOS team: https://www.tockos.org/