Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to make OS with Qt (Operating System)
Forum Updated to NodeBB v4.3 + New Features

How to make OS with Qt (Operating System)

Scheduled Pinned Locked Moved Solved General and Desktop
15 Posts 8 Posters 3.1k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Kent-DorfmanK Offline
    Kent-DorfmanK Offline
    Kent-Dorfman
    wrote on last edited by
    #6

    redundant answer but modern computers are based on a layered approach where you start with hardware and then add a common interface layer to communicate with the hardware. On top of that you add common services (that is the OS). Qt is an application framework that exists two layers above the OS.

    OS -> windowing system -> Qt

    And yes, I know the windowing system isn't technically required but the vast majority of Qt apps are GUIs.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SimonSchroeder
      wrote on last edited by
      #7

      I'd like to add that this is a very interesting question. The outfacing interface of the Qt framework provides everything one would need for application development. Qt is also written to support different backends. So, to write an operating system using Qt would require to write a new backend. However, the backend needs to be low-level and could not rely on Qt. Basically, you would need a bootloader (at least some assembly on x86 - or use an existing bootloader to load your operating system), input handler, graphics driver, timers, interrupt handlers, ... For example, QFile would need an implementation to access the disk. If you imagine Qt as part of your OS QFile could contain the file system implementation and disk driver. Usually, the OS provides functions for opening, reading and writing files, and Qt will just provide a common interface on different platforms to these functions. But Qt could be extended to provide this functionality itself.

      Typically, all the low-level stuff would be written with some small amount of assembler and the major part using C or C++. Note that by default C++ does not have a standard library if you write your own operating system. You need to provide your own new/delete, std::cout, std::vector, std::string, exception handling, etc. Output, vectors, strings could all be replaced by Qt counterparts. Output/input handling would need to be rewritten with some low-level code outside of Qt.

      To be precise: You cannot write an operating system just using Qt. However, you can write a backend for Qt using very little of Qt (you could already use QString and QVector (QVector after providing new and delete) and such). A lot of the higher level functionality of your OS could then fully rely on Qt. For a fully fledged OS maybe 90+% could be written using Qt. But, until you get Qt fully working, at that point for your very tiny OS 90+% would need to be written without using Qt.

      Pl45m4P 1 Reply Last reply
      0
      • S SimonSchroeder

        I'd like to add that this is a very interesting question. The outfacing interface of the Qt framework provides everything one would need for application development. Qt is also written to support different backends. So, to write an operating system using Qt would require to write a new backend. However, the backend needs to be low-level and could not rely on Qt. Basically, you would need a bootloader (at least some assembly on x86 - or use an existing bootloader to load your operating system), input handler, graphics driver, timers, interrupt handlers, ... For example, QFile would need an implementation to access the disk. If you imagine Qt as part of your OS QFile could contain the file system implementation and disk driver. Usually, the OS provides functions for opening, reading and writing files, and Qt will just provide a common interface on different platforms to these functions. But Qt could be extended to provide this functionality itself.

        Typically, all the low-level stuff would be written with some small amount of assembler and the major part using C or C++. Note that by default C++ does not have a standard library if you write your own operating system. You need to provide your own new/delete, std::cout, std::vector, std::string, exception handling, etc. Output, vectors, strings could all be replaced by Qt counterparts. Output/input handling would need to be rewritten with some low-level code outside of Qt.

        To be precise: You cannot write an operating system just using Qt. However, you can write a backend for Qt using very little of Qt (you could already use QString and QVector (QVector after providing new and delete) and such). A lot of the higher level functionality of your OS could then fully rely on Qt. For a fully fledged OS maybe 90+% could be written using Qt. But, until you get Qt fully working, at that point for your very tiny OS 90+% would need to be written without using Qt.

        Pl45m4P Offline
        Pl45m4P Offline
        Pl45m4
        wrote on last edited by Pl45m4
        #8

        @SimonSchroeder

        ... yes, and this would take years or even decades, when you have to do everything on your own.

        Imagine how many developers are currently working on new Ubuntu releases... and these are just upgrades... They don't reinvent the wheel :)
        To create your own independent OS, you'll need a bunch of (skilled and experienced!!) developers and "some" money.

        Even if you get your OS running... There would probably be only one user in the world... you, unless you do something much better or more efficient than the "big three" Windows, Macintosh and UNIX / Linux (or four, if you add Android as separate OS), which would be very unlikely.


        If debugging is the process of removing software bugs, then programming must be the process of putting them in.

        ~E. W. Dijkstra

        1 Reply Last reply
        0
        • fcarneyF Offline
          fcarneyF Offline
          fcarney
          wrote on last edited by
          #9

          There was a guy that attempted this. I will let you research him on your own. He is an interesting person (now deceased). He wrote TempleOS. I found the source here. The code is written in a C like dialect that can only be compiled while running templeos. I don't know how to bootstrap the os or build a virtual machine. I think this took him 5 to 10 years to make. This should give you an idea of the scale of what your are proposing. Not compatible with Qt.

          Qt is not suitable for creating an OS. It depends upon an OS itself.

          Now, if you want an "OS" that uses Qt for all its windows. Then you can run KDE window manager on a Linux distro. Kubunutu is a derivative of Ubuntu that defaults to the KDE window manager.

          C++ is a perfectly valid school of magic.

          1 Reply Last reply
          0
          • JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by
            #10

            You could resurrect the approach of an OS like GEORGE. We need more batch-processing OSes, with offline batch jobs for your work and card input. Modern window-y things are a waste of time & space. And this might be more approachable than Lin/Mac/Win.

            Kent-DorfmanK 1 Reply Last reply
            1
            • JonBJ JonB

              You could resurrect the approach of an OS like GEORGE. We need more batch-processing OSes, with offline batch jobs for your work and card input. Modern window-y things are a waste of time & space. And this might be more approachable than Lin/Mac/Win.

              Kent-DorfmanK Offline
              Kent-DorfmanK Offline
              Kent-Dorfman
              wrote on last edited by
              #11

              @JonB You may write that tongue-in-cheek, but it is ridiculous how much the instant gratification model has warped data processing. Much bulk processing could still be done by batch, and give folks a real opportunity to step back, sip a cup of coffee, and smell the roses as it were...it's a sign of a larger societal problem.

              JonBJ 1 Reply Last reply
              0
              • Kent-DorfmanK Kent-Dorfman

                @JonB You may write that tongue-in-cheek, but it is ridiculous how much the instant gratification model has warped data processing. Much bulk processing could still be done by batch, and give folks a real opportunity to step back, sip a cup of coffee, and smell the roses as it were...it's a sign of a larger societal problem.

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote on last edited by
                #12

                @Kent-Dorfman
                I do not disagree! Having been brought up on UNIX (not GEORGE!), I do not see why people should need visual file managers when there is ls -l | sort | grep. I can still type faster into vi than move a mouse around a visual editor. Computers should be for the technical elite, not the great unwashed masses ;-)

                1 Reply Last reply
                1
                • S Offline
                  S Offline
                  SimonSchroeder
                  wrote on last edited by
                  #13

                  @fcarney TempleOS is just one example of many. Back in the days when newsgroups were a thing, I subscribed to alt.os.dev. There were a lot of hobbyist OS developers. And they all got their own operating systems running. They wrote their own bootloader, input handler (usually just keyboard), terminal output, filesystem (usually their own inventions), and some more. You can get a small OS running in a year or so. It just won't have a GUI and a whole bunch of software.

                  If you want to support just a single hardware (or virtual machine) - which means you just need one simple set of drivers - you can certainly pull your own OS. And I believe you can even support Qt if you are a serious hobbyist developer. Sure, it will not be an OS for the masses. For this you would need to build momentum, involve a lot more developers, and much more.

                  @Pl45m4 Maintaining Ubuntu is a lot of work because it is a huge OS (compared to one-person toy OSes). It has drivers for a lot of hardware, supports different file systems, has thousands of applications which needs to be maintained, etc. However, getting a small toy OS running is not too much work. At first, it will also not do much because it will miss all the different software.

                  Kent-DorfmanK 1 Reply Last reply
                  0
                  • david.skolandD Offline
                    david.skolandD Offline
                    david.skoland
                    wrote on last edited by
                    #14

                    I'd just like to add that OS dev wiki is a good resource. I would start on this page: https://wiki.osdev.org/Required_Knowledge

                    It gives you a bit of insight as to what kind of challenge this is. It really is on a whole different level, but if you're dedicated enough, it's not impossible.

                    1 Reply Last reply
                    1
                    • S SimonSchroeder

                      @fcarney TempleOS is just one example of many. Back in the days when newsgroups were a thing, I subscribed to alt.os.dev. There were a lot of hobbyist OS developers. And they all got their own operating systems running. They wrote their own bootloader, input handler (usually just keyboard), terminal output, filesystem (usually their own inventions), and some more. You can get a small OS running in a year or so. It just won't have a GUI and a whole bunch of software.

                      If you want to support just a single hardware (or virtual machine) - which means you just need one simple set of drivers - you can certainly pull your own OS. And I believe you can even support Qt if you are a serious hobbyist developer. Sure, it will not be an OS for the masses. For this you would need to build momentum, involve a lot more developers, and much more.

                      @Pl45m4 Maintaining Ubuntu is a lot of work because it is a huge OS (compared to one-person toy OSes). It has drivers for a lot of hardware, supports different file systems, has thousands of applications which needs to be maintained, etc. However, getting a small toy OS running is not too much work. At first, it will also not do much because it will miss all the different software.

                      Kent-DorfmanK Offline
                      Kent-DorfmanK Offline
                      Kent-Dorfman
                      wrote on last edited by Kent-Dorfman
                      #15

                      @SimonSchroeder

                      re - writing your own hobbiist OS: and I spend a majority of my time pounding my fist on the table and screaming at the managers when they consider a vendor with an innadequate BSP for the hardware they want us to use.

                      re - ubuntu: let canonical do all the work. I mean they are the ones who turned it into "spy"buntu.

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved