Kernel written in bytecode

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
User avatar
AndrewAPrice
Member
Member
Posts: 2310
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

Re: Kernel written in bytecode

Post by AndrewAPrice »

This got really off topic. Not a single post on page 2 mentions "bytecode"!

Let's talk about:

1) JIT boot loaders!
2) Or a very minimal "exokernel" that basically an interpreter, so you can put as much logic as possible into a cross-platform bytecode kernel.
My OS is Perception.
rdos
Member
Member
Posts: 3337
Joined: Wed Oct 01, 2008 1:55 pm

Re: Kernel written in bytecode

Post by rdos »

AndrewAPrice wrote: Thu Jan 30, 2025 3:11 pm This got really off topic. Not a single post on page 2 mentions "bytecode"!

Let's talk about:

1) JIT boot loaders!
2) Or a very minimal "exokernel" that basically an interpreter, so you can put as much logic as possible into a cross-platform bytecode kernel.
I think bytecode in a micro- or exokernel has exactly the same problems as in a monolithic. No need to make that a special case.

Personally, I find the microkernel concept interesting because it can isolate drivers more properly than linking it into a flat, monolithic kernel, and not because it consists of an interpreter.
User avatar
Demindiro
Member
Member
Posts: 98
Joined: Fri Jun 11, 2021 6:02 am
Libera.chat IRC: demindiro
Location: Belgium
Contact:

Re: Kernel written in bytecode

Post by Demindiro »

Instead of bytecode, why not go straight for a scripting language?

The interpreter would certainly be more complex, but a well-designed scripting language can be very easy to parse (e.g. LISP dialect). As a bonus, it would be easier to debug and, IMO more importantly, to modify. And realistically you probably want to translate it to native machine code anyway, so the relative added complexity will be low.

I'll also add that scripting language != slow or even dynamically typed. To me, a scripting language is mainly about being easy and quick to write, which might prove useful for making good-enough drivers quickly.

(Incidentally, the project I'm currently planning is related to this.)
My OS is Norost B (website, Github, sourcehut)
My filesystem is NRFS (Github, sourcehut)
^ defunct
User avatar
eekee
Member
Member
Posts: 899
Joined: Mon May 22, 2017 5:56 am
Location: Kerbin
Discord: eekee
Contact:

Re: Kernel written in bytecode

Post by eekee »

Which major OS has a Lua interpreter in the kernel? Was it Linux or FreeBSD? I can't remember.
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie
Post Reply