Hi qbkiller101
welcome to the forum of QB64just about your issue... I must say 3 simple concepts:
1. QBasic and also QB64 are not the more suitable language for build up an Operative System.
Think that an OS must manage file system, RAM, VideoRAM, hardware devices .... often at this level you must manage bits and bytes!
Moreover also the simplest OS must be efficient and fast.... It seems that the walking from Basic Source code to ASM pseudocode to binary code is not so linear and easy to manage as result in terms of speed and efficacy per QB/Qbasic!
In QB64 you must put in this line of compiling the translation from QB64 to C++ and then the compiling of C++ to bynary code. Another extra step that can make difference in results.
2.
about
I can't put an if or case statement with all possible commands after all input statements as that would be too long
what kind of project have you raised up for Qbasic OS?
I think that there are more commands in QB64 then in your thought Qbasic OS... and the parser of QB64 can manage it istantanely (see syntax check while you're typing code)
3.
about
how to create a virtual machine that would boot with the .bas file or with qb64 in which I will run the file.
This is an ambitious goal that lets me think about Commodore 64 that I remember has a BASIC in its ROMS.
A QB64 Machine like the Java Machine that all we have on our PC, notebook, netbook , smartphone etc etc.
In this case yoo must project a layer of interface between your QB64 machine and the other OS that hosts the QB64 machine. An API as DLL or similar to translate (ask and get feedback) the requests of QB64 machine to Windows or/and MAC or/and Linux or/and Android.
My suggestions are:for QB64 OS alone...study the hardware on common machine and see how you can manage using QB64
for QB64 virtual machine...
study the service that the host OS uses to manage hardware and how you can access to those service to build an interface for QB64 machine. Then make a project of a minimal Qbasic OS.
You can study the Commodore system to have an example.
These are my two cents.
More experienced coders can give you more suggestions and tips.
C64 OS
https://en.wikipedia.org/wiki/Commodore_64#BASIC