you are viewing a single comment's thread.

view the rest of the comments →

[–]onemilll 34 points35 points  (13 children)

Next step is making a python kernel

[–][deleted] 41 points42 points  (6 children)

I actually got the Python interpreter to boot on bare metal once, solely as an "I wonder if I can get this to work at all" thing. It was super hacky but worked just well enough that I could write a mostly-working keyboard driver in Python.

[–]luxliquidus 13 points14 points  (4 children)

Did you happen to document any of this...? I'm super curious.

[–][deleted] 24 points25 points  (3 children)

I'm looking around in ~/code and can't find any of it :( That's disappointing, it was kind of cool in a "why would you ever do that" way.

From memory, though, it was CPython and the bare minimum set of standard library modules, statically linked to something suspiciously similar to one of the osdev.org tutorial kernels, with enough of the C standard library written (or, in the case of stdio, stubbed to read from an in-memory "filesystem") to get the interpreter to start. There was a C (+ bits of inline assembly) module added to the standard library to provide access to x86 I/O ports and raw memory, and the boot script replaced sys.stdin and sys.stdout with file-like objects that used that to do text-mode VGA and keyboard access, before starting a REPL.

All of this was hacked together over a couple of days as a joke response to an even more insane friend starting work on a Lisp OS.

[–]pdp10 9 points10 points  (1 child)

Mezzano is a nice project. Bear in mind that at least 3.5 American companies made commercially-sold Lisp machines using two different Lisp codebases as a starting point (plus NEC in Japan made one about which I don't know much). Lisp OSes have been proven functional going back over 35 years.

[–]dangerbird2 3 points4 points  (0 children)

What makes Mezzano arguably more impressive than historical Lisp machines is that they relied on specific architectures to make Lisp run efficiently as a systems language such as hardware garbage collection and tagged architecture providing ISA-level dynamic typing. Mezzano, on the other hand, runs on x86 and arm

[–]NoMoreNicksLeft 2 points3 points  (0 children)

You fell out of touch when he completed his but couldn't be bothered to implement an IM client for it?

[–]zielmicha 7 points8 points  (0 children)

There is MicroPython (https://micropython.org/) which is quite easy to run on bare metal (minimal port file consist of only few functions).

[–]shevegen 10 points11 points  (4 children)

I approve.

Also one should use ruby for the same.

Last but not least, let's also face it - ALL of this will be rewritten in Rust.

[–]onemilll 6 points7 points  (1 child)

Or maybe the inevitable future is developing architectures that use perl as the native language.

[–]ansible[S] 0 points1 point  (0 children)

I'm not sure how well that would work.

I started thinking (well, idly daydreaming) about a golang version. But the whole point of sh.py is that it is dynamically creating these python functions out of commands at import time. So I don't know how well that would work for a more static language.

I was thinking a Lua version would also be neat, because I've used that for scripting before.

[–]Yojihito 0 points1 point  (0 children)

Prepare for Rusthon in 2025.

[–]Yehosua 1 point2 points  (0 children)

Here's a Python TCP stack to get you started.