TheLuaOSProject / Kernel

Kernel for the LuaOS operating system
GNU General Public License v3.0
36 stars 4 forks source link

Implementation of the rest of the LuaJIT standard library #26

Closed Frityet closed 1 year ago

Frityet commented 1 year ago

Currently, the io and os tables are not implemented (nil). The file handling functions in io cannot be implemented, but the console parts (io.read, io.write, etc) can be implemented and specifically io.read and io.write already are implemented as kernel.read, kernel.write. For os, all of the functions may be discarded for now, except the time related functions which values may be accessed by the CMOS, and os.exit().

pitust commented 1 year ago

io and os are userspace things, aren't they?

Frityet commented 1 year ago

io and os are userspace things, aren't they?

yeah, I go over that in the post, its just io.read(), io.write(), os.exit() and os.time() which can be done in kernel space and is useful. But, the use of lua in kernel space will be minimal anyways so its a low priority issue

Frityet commented 1 year ago

Some math functions being implemented in #28

pitust commented 1 year ago

os.time() can't be, because to synchronize you need to do ntp or something

Frityet commented 1 year ago

os.time() can't be, because to synchronize you need to do ntp or something

not even with the CMOS battery?

pitust commented 1 year ago

What if there is no CMOS RTC, or the rtc needs to be offset by something that the userspace knows but kernel doesn't (like iirc on qcom, and definitely on the ps4 for example)?

Frityet commented 1 year ago

is not having RTC, or having to offset, actually common?

pitust commented 1 year ago

on x86, not really. on arm, i think its pretty common, yeah. and either way, we probably want an rtc driver in lua because you dont /need/ to have it in c /anyway/

Frityet commented 1 year ago

on x86, not really. on arm, i think its pretty common, yeah. and either way, we probably want an rtc driver in lua because you dont /need/ to have it in c /anyway/

yeah makes sense