yes, not a unix os but rather unix-like, and i want to program all of it on python, is that possible?? even the kernel, i want it all python. i know most kernels use c++ or c* but maybe python has a library to turn c* into python?? i’m still sort of a beginner but thanks and i would appreciate the answers

  • solrize@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    22 hours ago

    I think it is best to have some understanding of how an OS works, and how Python works, before asking whether you can write an OS in Python.

    Python is basically a scripting wrapper around a bunch of C functions (“builtins”) and there are means of installing additional C functions if you need them. Without any of the builtins, you really can’t do much of anything. For example, “print(2+2)” computes the string “4” (by adding 2+2 and converting the result to decimal), then calls a builtin to actually print the string on the console.

    For an OS, you will need quite a few more C functions, mostly to control timers and task switching, the main functions of an OS. Given enough C functions though, in principle you can write an OS.