emacstheviking

emacstheviking

It’s more than entertaining, it’s enticing!
Having written OS-s for standalone embedded systems many years ago I think “BEAMOS” sounds awesome. My initial thoughts would be things like writing an ETS term-store to manage EEPROM for example . The BIOS events could post to system processes that manage a piece of hardware; keyboard!{} sort of thing. Where would be draw the line between Elixir and underlying driver code that would just have to be written in C/Assembly as well??

Given the nature of supervision trees and OTP this could be a very very resilient OS indeed!

:slight_smile:

4
Post #11
leifericf

leifericf OP

Cool! Yeah, I also imagine it could be a great OS for IoT devices and heterogeneous nodes in the context of edge computing. I don’t have sufficient skills to make it a reality, though (yet).

1
Post #12
emacstheviking

emacstheviking

Well…there’s enough of us out there…I guess the first thing would be to create a bootable image, I’ve seen a few articles on how to do this but they all ended with “Don’t!” as it’s utterly pointless! LOL

But… I was a big fan fan of Squeak Smalltalk many years ago and they had SqueakOS, a similar idea.

I mean, taking it one step at a time, what would we need? A position independent build of elixir and libraries bundled into a bootable disk image…just enough to boot to the iex console ??

Stop there I think…I can feel an oppressive amount of thought queuing up…

It would be fun though…

2
Post #13
leifericf

leifericf OP

Sounds like a challenge to me! :laughing:

[…] taking it one step at a time, what would we need?

I would’t even know where to begin.

I guess I’d have to read a book on operating system design first.

1
Post #14
emacstheviking

emacstheviking

It’s all about onions. That and mapping what you want onto what you have. Thinking back to my 8085 project (yes, that long ago) we designed “the ideal machine” for what we wanted to do (real time telemetry gathering, mass reading of digital I/O, analog cards etc) and then we looked at what the 8085 could do along with the supporting stuff 8255-s. 8259, etc (programmable I/O and interrupt controller respectively) and gradually wrote software that supported co-operative multitasking, provided an “API” for all bespoke software to use etc etc it was dead interesting as it was my first real job and I still remember like it was yesterday!

So, I guess we’d first have to figure out an initial set of goals; maybe keyboard I/O and basic tty style I/O and go for it. There’d have to be a “BIOS Layer” where Elixir code (via NIF code) can make calls to the BIOS and then process the return data to do something.

I’d start some processes in memory and then have an ISR (interrupt service routine) post the raw keyboard event to an Elixir process and what happens from there is anybodies guess! Likewise for terminal I/O, a buffer can be populated with outbound data (like an asynchronous UART queue or something) and an Elixir process can “receive” character data and then make the relevant BIOS call to output some text.

I still think the Squeak Smalltalk is a good one; that runs on more platforms than the JVM and that is still the case last time I looked.

It would come down to isolating those places where I/O is required and start simple. Once you could do basic keyboard and screen work then you could turn your attentions to the persistent storage model..hell I’d be so bold as to map DEFSTRUCT-s onto physical disk structures and leave it at that. Imagine treating the hard drive as a relational database and that’s all you needed to know…I mean it works like that anyway but it goes via a backend database driver…so all you’d need is a “raw disk” abstraction layer instead and that should be enough.

I am sure I could spend a lot of time thinking about this but…

- is it worth it other than for pedagogical reasons?
- who would use it?
- how would you maintain it?
- is it worth it? and
- is it worth it ??

Moving on…for now :wink:

3
Post #15
vasspilka

vasspilka

I just came here to say it can’t be done!!

(hopefully now someone will make it)

1
Post #16
leifericf

leifericf OP

LOL! Yeah, that’s how the story goes. It’s like how the police officer in an action movie cannot solve the case until after he or she gets taken off the case and/or gets fired.

1
Post #17
erikp33

erikp33

That’s what the Nerves project does more or less.

2
Post #18
leifericf

leifericf OP

@emacstheviking - It definitely seems like you’ve got way more hard-core/low-level programming experience under your belt than I have, based on that story. It sounds… deliciously complicated.

1
Post #19
leifericf

leifericf OP

Yeah, I’ve been thinking about that recently! I haven’t really checked at Nerves yet (still learning the basics of Elixir and Phoenix right now), but this has made me want to check it out even more. I enjoy tinkering with hardware as well (although I’m not particularly good at it).

1
Post #20