Hacker News new | past | comments | ask | show | jobs | submit login
64-Bit RISC-V with Apache NuttX Real-Time Operating System (codeberg.page)
85 points by lupyuen on June 23, 2023 | hide | past | favorite | 25 comments



(for those who are not RISCV people a 'hartid' is a cpu register unique to each core that identifies it)

(to the implementer) it's worth noting that hartids are not guaranteed to be contiguous - one is guaranteed to be 0 - the rest will all be different, bot not necessarily 0,1,2,3,4,5....

It's to handle things like this: Suppose I have a board with 4 CPU chips on it, each chip has N CPUs on it (N might be variable, sometimes it's 2, 3, 4 - might depend on yield or on which chips you chose to put on the board (the cheap 2 core version or the expensive 8 core one). Each chip has some pins that indicate what some of the upper bits of the hartid, internally the various CPUs within the chip will set some low bits of their hartids. If I'm a chip designer who wants to make 256 core chips I'll reserve 8 bits for the lower bits and route the external chip pins to bits above that.

My point though don't depend on hartids being contiguous


Thanks! I'll take note of this while I'm working on NuttX and RISC-V.


Can anyone here put NuttX in some sort of usage context with other RTOSes?

Put another way: if one were to learn an embeddable RTOS for first hobbyist and then perhaps professional purposes, where is NuttX in the hierarchy of things you would recommend learning?

It looks fascinating and well thought out, but I have no way to assess how much of a backwater, dead end, quirky solution or solid choice it might be.


NuttX seems to have a stronger mandate to be POSIXy than many other RTOSes and includes a shell that's similar to a unix shell. Where the interface and "shell" for other RTOSes is often more unique and doesn't have as much of a unix feel. So it might be a more comfortable transition, though I'm sure that approach has it's drawbacks also.


If you want a POSIX environment in an RTOS, RTEMS has had a fully compliant POSIX C and C++ interface with decades of spaceflight usage. However, it remains somewhat obscure in terrestrial usage.


I also asked myself the same question. There is some useful information at the bottom of this redit thread: https://www.reddit.com/r/embedded/comments/w5cq50/zephyr_vs_...


Interesting, thanks :-)


Random tidbit: there is a developer making an "OS?" With it for pinephone, has a really cool blog (cool illustrations) will post link at desktop

https://lupyuen.github.io/articles/usb2#pinephone--nuttx--fe...

oh lol OP is the same person my bad


Samsung uses a fork of it.

https://github.com/Samsung/TizenRT


Ahhh... now that's the sort of information I was interested in hearing! Thanks.


Zephyr RTOS has a bigger community.


The IoT/home automation world is becoming user hostile with a lot of locked down devices and privacy breaches.

I'd rather use software stacks under GPL 3 instead. It provides some protection.


Can one use QEMU to emulate the 8-bit RISC? What would that even be used for? Is that some embedded device things?


> Can one use QEMU to emulate the 8-bit RISC?

They're arguably not RISC cores, but the docs here are referring to NuttX's support for avr and z80. And, no, qemu doesn't support those archs AFAIK.

> What would that even be used for? Is that some embedded device things?

Yes, as is NuttX usage in general.


qemu certainly supports avr


Oh nice, I missed that it was added during the pandemic.

https://www.qemu.org/2020/08/11/qemu-5-1-0/


Not to mention, qemu creator did write a small risc-v emulator: https://bellard.org/tinyemu/

And there is even a full javascript engine, in plain and simple C!!! Good startin g point for a modern web engine written in plain and simple C.


Many 3D printers used (and still use) 8-bit AVR-based devices.


Where does the NuttX name (and software) come from?


Comes from its creator, Gregory Nutt.


Nutt-ex, seriously? Why not Cum-ex? Who comes up with these names...

"My process just nutted into a kernel function and later spawned a thread"


No matter what name you're going to pick, it's going to have some other meanings in some other language out there. One has to be more professional than that.


In my own multi-decade IT experience: most people working in SW almost never think in these directions (and therefore catch such associations before the public does), because they are dorks, and often lacking any humor. Marketing dudes definitely are more fun and know how to party, AND how to assess possible connotations.

And why would Softies think in those directions - fannies are considered black scary animals down there, i heard.


> because they are dorks, and often lacking any humor. Marketing dudes definitely are more fun and know how to party, AND how to assess possible connotations.

> And why would Softies think in those directions - fannies are considered black scary animals down there, i heard.

I understand that some stereotypes exist for a reason, but in this case the reasons are decades out of date, so you may wish to update your understanding of the world.


It was originally created by Gregory Nutt.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: