When you actually get down to it, building an operating system is mostly about making sure that apps don't step onto each other and it's quite boring.

I'm gonna spend the day swimming instead. I'm not sure I'm enjoying doing memory management stuff, might make the OS single-tasking, you open a file, you can edit it, it locks up in a way that other apps can't request memory to write on for a while.

It would be a potato.

· · Web · 5 · 3 · 40

Okay, new day, fresh start, let's try that once more from a different angle.

Went into the deep end of the memory allocation pool, and emerged unscathed!

Potato can allocate memory, and then it is freed automatically when it is closed, there will never be fragmented memory.

It's crazy how little memory 64kb is tho.

@cancel @neauoire And now I deeply regret getting rid of my Mac Classic II. ;)

@cancel that was a good read, just what I needed , thank you.

@neauoire it's ok if you don't end up sticking with it :) it's worth a try, though

@cancel I'm already implementing it now, I think just having a second level of reference might be what I was needing here. But I'm trying handles-with-a-twist right now, I'll share what I find :)

Why not tackle it the way pre-MultiFinder MacOS did it? Instead of putting multitasking into the OS, allow special drivers to run alongside your one application, where the driver (DRVR resource, rather than CODE) has to handle cooperating with "the one app"

@neauoire That is basically correct. This is why I like the approach taken by IBM when they released VM/370. The product exists at two levels. The hypervisor itself, and a single tasking, single user OS that assumes it had full control over the mainframe.

So, if I were to summarize, making a good single user OS is, is wager, more important than focusing on multitasking facilities. If you need the latter, you can always run under a hypervisor.

@freakazoid @neauoire in my own systems, If you maintain chunks of memory in a doubly linked list sorted by address, you can incrementally defragment as you allocate and free chunks.

@neauoire I'm so crazy impressed by how you've created an entire cool os from scratch

@June It's been a lot of fun, it really pushes the programming language to its limits I think.

@neauoire page out to host os filesystem as needed if you're doing it all in uxn and the 64k "disk" limit is the memory there? could hot-swap the application sections of memory as they come in/out of focus (as it looks like you're already relocating sections)... or are they all running at once?

"virtual memory" is the term to deep dive on

@maxc I think it's more fun to try and see what I can do with 64kb, than trying to page memory tho

@maxc I mean, I haven't really fully utilised the 64kb yet, the largest application I've ever written is 18kb big.

@neauoire sure, you'll get there pretty quickly with certain types of data (eg handling images that aren't 2bpp like photos, pcm audio in general, non-trivial meshes or skeletal animation) but if you're not keen on touching those (and that's a valid choice) then you're golden for ages.

One of those things where you can do a lot with a little if you're happy to stick with a little, haha.

Main barrier to "use it for everything no big os involved" for you folks sounds like it'd be photos?

@two sure. working with utf8 isn't hard, correctly laying it all out is, but I mean for their personal use

@maxc well, anything that can be streamed like images, drawn once and forgotten, take very little space, for example, drawing a tga takes only 4 bytes of memory at a time. Editing files like a large text file, can fill it pretty fast.

@neauoire in the "stream draw a tga from disk" case you're manually doing the virtual memory stuff yourself though. If you had to interactively edit the tga as well there'd be a lot more seeking and caching and you'd also quickly exhaust 64k

@maxc yeah, tga isn't a very good candidate format for the system :/

@neauoire it's alright, you'll either be happy accepting the low fi limitations or build a 32bit version at some point haha

> It's crazy how little memory 64kb is tho.


@neauoire trying to understand this -- all the functionality has to be written into the OS I assume? ie, no loading other distinct ROMs from within the OS?

@aw well, it will probably be able to load data and apps from the outside world, but handling memory and file types and stuff like that, will be part of the OS yes.

@neauoire Ah, what I mean is like, will I be able to load a standard uxn/varvara rom into this somehow? Or would it have to be specifically written to target the OS?

@aw It can already load varvara roms, but it doesn't preserve anything at the moment, but that's what I'm trying to solve now. Left and Potato apps both share the same app definition(manifest), so in theory, it might be possible to window the apps within potato. I'm pretty sure it's possible :)

@neauoire excited for this! I’m taking a break from side projects while I’m in New York but I have some ideas I wanna try out when I’m back (especially around UF)

@aw best enjoy the rest of the summer, plenty of time to noodle around that stuff in the fall :)

Sign in to participate in the conversation

Revel in the marvels of the universe. We are a collective of forward-thinking individuals who strive to better ourselves and our surroundings through constant creation. We express ourselves through music, art, games, and writing. We also put great value in play. A warm welcome to any like-minded people who feel these ideals resonate with them.