10KB for the OS?
Finally we are getting somewhere.
Huawei has offered up a good look at its Internet of Things strategy, using its Network Congress 2015 to show off a microkernel that will be the bedrock of its future efforts in the field. LiteOS certainly is “micro”: the kernel is 10 kilobytes but nonetheless able to support “zero configuration, auto-discovery, and auto- …
Actually in the embedded world that's already rather large. The more interesting questions are how much RAM it needs under certain conditions, for example with one TLS connection open.
Flash is cheap in embedded devices, RAM is the expensive thing. Your microcontroller may have anything from 256 bytes to 256 kilobytes and anything beyond will need external RAM which makes is so expensive you can just as well add 16 Megabytes with no additional cost and run Linux.
Anyhow in that order of magnitude you can also get an FreeRTOS/OpenRTOS which gives you the advantage of being well designed and documented, plus even the free support via Webforum is _way_ better than anything you can pay for with companies like Mentor Graphics.
Flash is cheap in embedded devices, RAM is the expensive thing. Your microcontroller may have anything from 256 bytes to 256 kilobytes and anything beyond will need external RAM which makes is so expensive you can just as well add 16 Megabytes with no additional cost and run Linux
As far as I can tell, this page gives memory requirements for LiteOS
http://wiki.oiotc.cc/index.php?title=Os%E5%86%85%E5%AD%98%E5%8D%A0%E7%94%A8%E6%83%85%E5%86%B5
Google Translate does not seem to be up to the task of rendering the appropriate table into a reasonable English format, or French for that matter. Would someone who can read Chinese care to take a stab at this? I am also not sure from looking through the Googlized web page whether the network stack is part of the kernel. I hope not as something like that could bring us the IoT PoD (though that does have a nice ring to it).
As far as I can tell, this page gives memory requirements for LiteOShttp://wiki.oiotc.cc/index.php?title=Os%E5%86%85%E5%AD%98%E5%8D%A0%E7%94%A8%E6%83%85%E5%86%B5
I can't read Chinese but that table gives the three different segments: .text, .data and .bss. .data and .bss exist in RAM, .text exists in flash.
The rows from what I can tell give the usage for (in this order):
- The kernel itself
- Mutex objects
- Semaphore objects
- "Swtmr" objects (whatever they are)
- Queue objects
- Task objects.
Presumably for the Queue objects that's the overhead, and queue data will be extra on top of that. There'd be one copy of the .text for each of those included (so if you have two Queues, you'd only include one copy of the .text implementing a Queue), but there'd be a block of memory (360 bytes by the looks of things) per queue used in RAM.
Indeed, RAM usage is a more useful metric… coding for tight flash isn't too bad, but coding for tight RAM is.
I once had to code for a TI MSP430F135 which is a 16-bit proprietary microcontroller with 16kB flash and 512 bytes of RAM. That was tough!
We found we were able to de-solder the original MCU and drop a MSP430F149 in its place, which gave me some much needed breathing room: 2kB RAM and 60kB flash. Not all designs permit this though, and most microcontrollers available to hobbyists are skint in the RAM department.
kernel != OS
Besides, with flash prices being what they are, you can pretty cheaply get 1Gb flash these days, ram is more expensive, but even then, 8 or 16Mb would be more than enough for IoT, and that comes quite cheap.
A tailored Linux kernel would be much better, has much better support, been developed and gone through testing for 20+ years, and, best of all, drivers for chipsets are readily available. Not sure what the RAM requirements for systemd are, <joke>I guess at the least 2Gb</joke> ... but then again, who needs systemd when you do not need gnome.
>"A tailored Linux kernel would be much better"
How so? And how are the Real Time variants of Linux doing these days?
>"has much better support, been developed and gone through testing for 20+ years," applies to some RTOSs more than it does to Linux. For IoT applications, the tried and tested OSs from the fields of Industrial Control and Avionics are a better place to look.