bsimpson 9 hours ago

> Since the Internet seems to be full of people with way too much time on their hands, I would just like to kindly shoo away any C/C++ pedants out there. Yes, I am sure there are a million different ways to achieve many of the same results. Yes, I am sure there are some fine points of language semantics that could be argued about. Yes, I am sure you have a more efficient way of writing some of the functions.

> To be honest, I am not interested.

I respect this so much.

  • andai 4 hours ago

    >Piccolo OS [...] is designed primarily as a teaching tool.

    This means you must carefully balance teaching the right thing (a realistic system implemented skillfully) against teaching the right way (simplification for didactic purposes).

jollerina 7 hours ago

  struct {
    // ...
  } typedef piccolo_os_internals_t;

  int typedef Int; // also works.
You always learn some new quirk of C. I guess typedef works like const, can put it on the left or the right.
  • formerly_proven 2 hours ago

    TIL and looked it up, typedef is indeed just a specifier like any other in a declaration.

pkphilip 3 hours ago

This is cool! works well as a way of understanding how to get an OS going on Pico

nine_k 9 hours ago

In short: it's a toy OS built primarily for teaching, and it's a cooperative multitasking OS, without process isolation. So it's more like Node.js (or win16, or macOS classic) than like what we usually call an OS.

  • kergonath 8 hours ago

    That’s a weird comment. Node.js is a stack that works on top of an OS. If you could just plop it on a SD card and boot a computer with it, it would be a OS. Things like DOS or MacOS 9 were definitely operating systems. There is no reason to restrict the term to those with preemptive multitasking.

    • TickleSteve 7 hours ago

      "OS" in this context means "scheduler", i.e the code that coordinates your application tasks. That description can also apply to VMs such as JS, hence the comparison.

      You could consider this type of library OS even more tightly bound to the application than your typical JS app as its actually linked to the user code.

      • msh 5 hours ago

        A scheduler is part of a OS, but a scheduler alone does not make a OS.

        • TickleSteve 2 hours ago

          "Operating Systems" for microcontrollers such as this are frequently just schedulers as the Application typically contains drivers and hits the hardware itself. e.g. FreeRTOS.

      • vrighter 2 hours ago

        And the scheduler decides which thread gets to run next. On a cooperative multitasking system, guess what the OS code you jump to when you yield from a thread does, and what it's called?

        • TickleSteve 2 hours ago

          That was my point.

          • vrighter 2 hours ago

            replied to the wrong coment, sorry

  • whobre 35 minutes ago

    By your definition, CP/M and DOS are not operating systems either

  • abelsson 8 hours ago

    It’s also running on a microcontroller with a few hundred kb of memory so even win16 or macOS classic would be a bit heavy.

    • Someone 6 hours ago

      > so even win16 or macOS classic would be a bit heavy.

      Speed-wise, both would run exceptionally well on that hardware.

      The first Mac had 128kB memory, about 32 of which were taken by its video and audio buffers. It ran at about 8MHz.

      The first version of Windows ran on similar hardware, requiring a 8088 and 256kB of memory.

      The pico has at least that amount of memory, at top speed 16 times the clock frequency, and two cores.

    • rvense 6 hours ago

      The Pico doesn't have an external memory bus, but something like MacOS Classic for an STM32 with a chunk of SDRAM and VGAish video would be fun.

      • drrotmos 5 hours ago

        The Pico 1 (i.e. the RP2040) doesn't. The Pico 2 (RP2350) does, albeit a fair bit slower (since it's QSPI PSRAM) than the internal SRAM.

    • vardump 5 hours ago

      Not everything needs to run directly from RAM.