When it comes to domestic operating systems, many students may think there is no such thing. However, in fact, there are many excellent domestic operating systems in China. Although some of them are not for ordinary consumers, they all have their own characteristics, and some of them have been highly used in their professional segments. Today’s recommended LuatOS is such an Internet of things operating system.

Project name: LuatOS

Project Author: Wendal

Open Source License: MIT

LuatOS is a real-time operating system that runs on embedded hardware and requires only a small amount of flash space to run. Users can write Lua code to perform various functions.

  1. Based on the Lua 5.3.5
  2. Low memory requirements, minimum 32KB, 96KB flash space
  3. The hardware abstraction layer is compatible with M3, ARM, RISC-V, etc
  4. Testable, simulable (QEMU)
  5. Online upgrade
  6. It can be clipped and expanded

The overall architecture

Code Sample Excerpt

local sys = require("sys")


sys.subscribe("WLAN_READY".function(a)print("!!! wlan ready event !!!"Socket. NtpSync () end) disp.init()"ssd1306")
display_str("Booting ..."Subscribe () -- network callback sys.subscribe("WLAN_PW_RE".function(ssid, password)
    if ssid then
        log.info(TAG, "airkiss GOT", ssid, password)
        local conf = {ssid=ssid,password=password}
        json.encodeFile(conf, "/wlan.json")
    else
        log.info(TAG, "airkiss fail") -- business process that sends temperature data to server sys.taskInit(function(a)while 1 do
        if wlan.ready() == 1 then
            sys.wait(1000)
            local temp = (sensor.ds18b20(28) or "")
            display_str("Temp: ". temp .." rssi:". tostring(wlan.rssi()))local t = {"GET /api/w60x/report/ds18b20? mac=", wlan.get_mac(), "&temp=", temp, "HTTP / 1.0 \ r \ n"."Host: site0.cn\r\n"."The user-agent: LuatOS / 0.1.0 from \ r \ n"."\r\n"}
            socket.tsend("site0.cn", 80, table.concat(t))
            log.info("network"."tsend complete, sleep 5s")
            sys.wait(5000)
        else
            log.warn("main"."wlan is not ready yet")
            sys.waitUntil("WLAN_READY"-- primary loop, must add sys.Copy the code

Project address: gitee.com/wendal/Luat…

If you want to know more about domestic open source operating system, you can click on the following link: gitee.com/explore/os