3 ms·
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
by nine_k 2y 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.
- abelsson 2y agoIt’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 2y 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.
- teejmya 2y agohttps://axio.ms/projects/2024/06/16/MicroMac.html https://axio.ms/projects/2024/06/16/MicroMac.html
- rvense 2y agoThe 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 2y agoThe 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.
- crest 2y agoThe RP2040 has a single QSPI controller channel, but with clever hacks you can multiplex that to boot from SPI and switch over to some other (Q)SPI peripheral, but iirc you can't write directly (can be emulated via MPU+DMA). What's also quite neat is that you can use the external flash cache as 16kiB SRAM tiled repeatedly over a 16MiB memory window. By abusing the MPU you can allow/trap accesses down to 256 byte granularity and implement virtual memory (allow only one alias address at a time, treat the 16kiB SRAM as a direct mapped cache, and demand page from QSPI, other SRAM banks, or whatever you can come up with).
- lproven 2y ago> The Pico doesn't have an external memory bus I may be misunderstanding what you are saying here but if I read this correctly, you are wrong. The project to run Transputer code on the Pi Pico uses a memory expansion for the original Pi Pico. I described it here: https://www.theregister.com/2022/05/06/pi_pico_transputer_code/ https://www.theregister.com/2022/05/06/pi_pico_transputer_co...
- rvense 2y agoImpressive work! Of course you can access external RAM, but it comes with some compromises re: speed and usability. Other ARM microcontrollers have a full SDRAM controller on board in its normal address space with very little overhead compared to the internal memory. I'd imagine the SPI RAM here is an order of magnitude slower than the internal RAM, if not two? edit - that is one WILD codebase... it has both pi pico support but also (remnants of)... Mac OS 9 support!? `#ifdef __MWERKS__`??
- lproven 2y agoOh, yes, it's a crazy project overall. I would love to see it continue -- I think the Transputer and its OS HeliOS, which is FOSS now -- still has much to teach. But he got it working, so I can also see why not stop digging if you hit the bottom. P.S. I wrote about HeliOS too: https://www.theregister.com/2021/12/06/heliosng/ https://www.theregister.com/2021/12/06/heliosng/
- crest 2y agoWell the RP2040 has a QSPI controller but it has only a single channel that is normally the "boot device". If you bootstrap via SWD (or USB) this device could be at least a QSPI RAM, but writes would have to trapped and implemented in the HardFault handler which is of course very slow compared to internal SRAM. The RP2350 adds a second QSPI channel with QSPI bus (just an additional chip select pin).
- lproven 2y agoTBH I don't know the details of how it works. I am not at all an electronics person. But did you read the article? All I'm saying is that it is possible to add more RAM to a Pi Pico. That, to me, seems to falsify the statement that it can't.
- vardump 2y agoNot everything needs to run directly from RAM.
- kergonath 2y agoThat’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 2y 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 2y agoA scheduler is part of a OS, but a scheduler alone does not make a OS.
- TickleSteve 2y 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.
- crest 2y agoEven those implement communication primitives e.g. locks, semaphores, mailboxes, etc. as part of the OS. Some of the larger ones also define a driver model of sorts (which often just codifies the structure of the first driver for that type of peripheral e.g. USB, Ethernet, CAN, I2C, SPI, GPIO).
- vrighter 2y agoAnd 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?
- whobre 2y agoBy your definition, CP/M and DOS are not operating systems either
- benj111 2y agoI don't think that makes the definition wrong. We like to conceptualise OSes as programs, but at the low end they start to resemble libraries. if your FS is just a library, process switching is timers and interrupts, and memory protection is provided by the processor, what is the OS? Where is the OS?