X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/28c176b668c841a3b7fb093faccf0efa39257603..refs/heads/fs-race-fix:/lunaix-os/LConfig diff --git a/lunaix-os/LConfig b/lunaix-os/LConfig index ecd4a03..0e27e4e 100644 --- a/lunaix-os/LConfig +++ b/lunaix-os/LConfig @@ -1,9 +1,11 @@ import time +from datetime import datetime, date -include("kernel/LConfig") -include("arch/LConfig") +include("kernel") +include("arch") +include("hal") -@Term("Version") +@Term("Kernel Version") @ReadOnly def lunaix_ver(): """ @@ -12,10 +14,14 @@ def lunaix_ver(): type(str) - seq_num = int(time.time() / 3600) - default("%s dev-2024_%d"%(v(arch), seq_num)) + today = date.today() + year = today.year + start_of_year = datetime(year, 1, 1).date() + seq_num = (today - start_of_year).days + + default("%s v0.%d%d"%(v(arch), year - 2000, seq_num)) -@Collection +@Collection("Kernel Debug and Testing") def debug_and_testing(): """ General settings for kernel debugging feature @@ -29,4 +35,39 @@ def debug_and_testing(): extermly unstable """ type(bool) - default(False) \ No newline at end of file + default(False) + + @Term("Report on stalled thread") + def check_stall(): + """ + Check and report on any thread that spend too much time in kernel. + """ + + type(bool) + default(True) + + @Term("Max kernel time allowance") + def stall_timeout(): + """ + Set the maximum time (in seconds) spent in kernel before considered + to be stalled. + """ + + type(int) + default(10) + + return v(check_stall) + + @Term("Max number of preemptions") + def stall_max_preempts(): + """ + Set the maximum number of preemptions that a task can take + before it is considered to be stucked in some loops. + + Setting it to 0 disable this check + """ + + type(int) + default(0) + + return v(check_stall) \ No newline at end of file