Anyone creating an OS with Python (Tkinter)?

Recommended Answers

All 10 Replies

No. Python is a scripting language, which means that it requires an external program to interpret the python source code for it to be executed. To be able to execute Python, you require the Python Interpreter to be installed. This interpreter only runs in an existing operating system, such as Windows or Linux. On top of that, Tkinter requires a window manager to be present. On Windows, the window manager is part of the OS.

This renders it impossible to write an OS directly in python.

commented: Yes. +14

Yup. But we could still create a simple os application to run as a program in an other OS (Windows or Linux)

Right, I see what you mean, but technically, it wouldn't be an OS, hence my confusion.
It's quite a good task for learning Python and becoming familar with Tkinter, in fact it's how I learned much of the VB5 which I have now forgotten :)

I think there is some confusion about the nature of operating systems going on here. That is natural, as much of the OS is hidden from view, while most of the things people think of as being part of the OS are actually separate programs (or at most sub-sections of the OS proper). There is a definite disconnect between what OS developers (both professional and hobbyist) think of as 'the operating system' and what most users and client-programmers think of as the OS.

Generally speaking, most people think the operating system is the Graphical User Interface and the Window Manager, the upper-most levels of the system. This isn't really the case, however; in fact, these aren't necessarily part of the operating system at all. For example, most Unices - Linux, FreeBSD, and MacOS X included - do not have a GUI or Window Manager as part of the operating system; in fact, the entire user interface, including the text shell, runs as a set of user-level applications. Even in Windows, most of the windowing system is run in user space.

Conversely, to a serious OS developer, the real meat of the OS is in the kernel, the lowest level part of the system. This is where things like memory management and process scheduling take place, and but it is only a very small part of the whole system.

Just to put the issue of operating systems in different programming languages into perspective, there is a page on the OS-Dev wiki which discusses the language capabilities needed to develop an OS. In short, it is possible to write parts an operating system in an interpreted language, but you would still need either to write the kernel in a lower level language such as assembly or C, or write a compiler for a sub-set of the language, and a do lot of work in said lower-level language. You would then need to develop a customized version of the language interpreter as well. It may be worth it to you to do this for Python - and you wouldn't be the first to try - but it really isn't practical. That hasn't stopped me from an even more ambitious goal with Thelema (though other things have), but it would be enough to make most people stop short.

commented: Well explained. +14
commented: Nice. I'm never bothered to explain so clearly +4

@Schol-R-LEA, You're on OSDev too? I had no idea!

It's been a while since I've been there, but I used to be a regular.

They must be so dedicated

Programming in a high level language like Python can be fun.
However, writing an OS looks like work to me.

However, writing an OS looks like work to me.

Fun work, in some people's eyes

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.