lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Peter Hill:
> And I really think Lua has the potential to be an excellent kernel for
> an operating system!

Tom Wrensch:
> I'm not sure which of you first suggested the use of Lua as an operating
> system, but I have to say I'm interested in the idea. I've used several
> language-based OSes, including the UCDS p-system, Smalltalk, and
> Symbolics Lisp machines. They always seemed to be cleaner and simpler
> than a random language/OS combination.
>
> Anyway, I don't know if there's the basis for actually DOING anything
> with this, but it's a very interesting idea.

I've no specific plans... I just think it has potential.

It already provides a marshalling technique for calls to the os + other
tasks (using the Lua function stack). It also provides a 'scripting'
language for all sorts of actions. It would, of course, need a few
enhancements to make it a LuaOS.

- The os memory allocation would need to allow a quota, so that one task
could not steal all of the operating system's memory. This would be
basically transparent to Lua programs (user programs can also just use
'malloc / free' as they wish for their own C data).

- Compaction of the OS memory would need to exist (since the OS runs
indefinitely). This is fairly simple. However steps should be taken to
minimise the sudden 'freezing' that could result. Likewise with incremental
garbage collection.

- Preemptive task swapping would need to be implemented (and some quota to
prevent one task from stealing all the cpu time by spawning child tasks).
Also some subtask creation + semaphore / messaging / etc library routines
need to be added to handle inter-task communication.

- Userdata would need protection. Currently any C routine can 'open'
userdata and see what is inside. This would need to be adjusted so that only
the owning task could do so. Probably the most flexible way is to include a
'key' object (like I once suggested on the list for locking Tables).

- Add some sort of 'file system'... probably simply a persistent table type.

Any thing else I've missed?

*cheers*
Peter Hill.

Ki: Contractors... high-paid leeches stealing our work.
Fooker: If you think of them as disposable employees, you'll feel much
better...