News for hackers. Stuff that matters.
Re:Piccolo OS, a Small Multitasking OS for the Raspberry Pi ... by nine_k on Thursday December 19, 2024 @12:25AM (#42458660)
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.
Re:Piccolo OS, a Small Multitasking OS for the Raspberry Pi ... by kergonath on Thursday December 19, 2024 @01:52AM (#42459081)
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.
Re:Piccolo OS, a Small Multitasking OS for the Raspberry Pi ... by TickleSteve on Thursday December 19, 2024 @02:33AM (#42459289)
"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.

Re:Piccolo OS, a Small Multitasking OS for the Raspberry Pi ... by msh on Thursday December 19, 2024 @04:18AM (#42459785)
A scheduler is part of a OS, but a scheduler alone does not make a OS.
Re:Piccolo OS, a Small Multitasking OS for the Raspberry Pi ... by TickleSteve on Thursday December 19, 2024 @07:48AM (#42460937)
"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.
Re:Piccolo OS, a Small Multitasking OS for the Raspberry Pi ... by crest on Thursday December 19, 2024 @02:40PM (#42464994)
Even 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).
Re:Piccolo OS, a Small Multitasking OS for the Raspberry Pi ... by vrighter on Thursday December 19, 2024 @07:41AM (#42460895)
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?
Re:Piccolo OS, a Small Multitasking OS for the Raspberry Pi ... by TickleSteve on Thursday December 19, 2024 @07:50AM (#42460948)
That was my point.
Re:Piccolo OS, a Small Multitasking OS for the Raspberry Pi ... by vrighter on Thursday December 19, 2024 @08:09AM (#42461075)
replied to the wrong coment, sorry
Re:Piccolo OS, a Small Multitasking OS for the Raspberry Pi ... by MisterTea on Thursday December 19, 2024 @11:13AM (#42462862)
What context are we talking about here?
Re:Piccolo OS, a Small Multitasking OS for the Raspberry Pi ... by kergonath on Thursday December 19, 2024 @11:40AM (#42463173)
> "OS" in this context means "scheduler", i.e the code that coordinates your application tasks

If you define the context to mean it and then assume that everyone agrees with your implicit context, then maybe. In reality, OS and schedulers are not the same thing.

It’s also a leap from the “MacOS 9 was not an OS” GP position.

Re:Piccolo OS, a Small Multitasking OS for the Raspberry Pi ... by rvense on Thursday December 19, 2024 @03:33PM (#42465434)
> It’s also a leap from the “MacOS 9 was not an OS” GP position.

That wouldn't be the first time I've heard that statement, even among classic Mac enthusiasts.

Re:Piccolo OS, a Small Multitasking OS for the Raspberry Pi ... by kergonath on Thursday December 19, 2024 @06:12PM (#42466712)
Then surely there are instances of people saying that it is “not an OS”. And I don’t mean hyperbole.

Here are 3 definitions from 3 different sources: https://www.wordnik.com/words/operating%20system . Not a single one even mentions process scheduling or anything to exclude MULTICS, CP/M, DOS, or any version of MacOS or Windows. I know that some people think that being contrarian on HN is cool, but this is beyond ridiculous.

Re:Piccolo OS, a Small Multitasking OS for the Raspberry Pi ... by 0x457 on Thursday December 19, 2024 @02:28PM (#42464880)
> "OS" in this context means "scheduler",

That's essentially what OS is: some bootstrap, scheduler and some APIs for developers and some drivers.

Re:Piccolo OS, a Small Multitasking OS for the Raspberry Pi ... by abelsson on Thursday December 19, 2024 @01:49AM (#42459062)
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.
Re:Piccolo OS, a Small Multitasking OS for the Raspberry Pi ... by rvense on Thursday December 19, 2024 @04:07AM (#42459718)
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.
Re:Piccolo OS, a Small Multitasking OS for the Raspberry Pi ... by drrotmos on Thursday December 19, 2024 @04:58AM (#42460032)
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.
Re:Piccolo OS, a Small Multitasking OS for the Raspberry Pi ... by crest on Thursday December 19, 2024 @02:45PM (#42465026)
The 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).
Re:Piccolo OS, a Small Multitasking OS for the Raspberry Pi ... by lproven on Thursday December 19, 2024 @06:52AM (#42460592)
> 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_co...

Re:Piccolo OS, a Small Multitasking OS for the Raspberry Pi ... by rvense on Thursday December 19, 2024 @12:56PM (#42464009)
Impressive 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__`??

Re:Piccolo OS, a Small Multitasking OS for the Raspberry Pi ... by lproven on Friday December 20, 2024 @06:15AM (#42470152)
Oh, 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/

Re:Piccolo OS, a Small Multitasking OS for the Raspberry Pi ... by crest on Thursday December 19, 2024 @02:50PM (#42465063)
Well 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).
Re:Piccolo OS, a Small Multitasking OS for the Raspberry Pi ... by lproven on Friday December 20, 2024 @06:14AM (#42470140)
TBH 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.
Re:Piccolo OS, a Small Multitasking OS for the Raspberry Pi ... by Someone on Thursday December 19, 2024 @03:49AM (#42459624)
> 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.

Re:Piccolo OS, a Small Multitasking OS for the Raspberry Pi ... by teejmya on Thursday December 19, 2024 @11:32AM (#42463078)
Re:Piccolo OS, a Small Multitasking OS for the Raspberry Pi ... by vardump on Thursday December 19, 2024 @04:42AM (#42459939)
Not everything needs to run directly from RAM.
Re:Piccolo OS, a Small Multitasking OS for the Raspberry Pi ... by whobre on Thursday December 19, 2024 @09:05AM (#42461476)
By your definition, CP/M and DOS are not operating systems either
Re:Piccolo OS, a Small Multitasking OS for the Raspberry Pi ... by benj111 on Friday December 20, 2024 @05:39AM (#42469918)
I 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?