Qbasicnews.com

Full Version: Actual QBOS thread -- STFU NEWBS! :P
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
I got the idea today that it might be possible to use QB to create a simple OS if I strip out the MS-DOS header information and make a small program for the bootsector to load it up.

I understand that many of the MS-DOS interrupts wouldn't exist, but there would be int 9 disk services to create a basic FAT file system driver, video interrupts and memory locations to create a basic interface, and even the keyboard interrupts.

Has anyone tried running QB code without DOS before?
Is the executable format my only barrier to running code directly?
Since I know how the FAT12 filesystem is laid out, and how to use bios disk functions, is there any real barrier to creating a minimal disk driver?

I'm curious because I'd like to prove, before qb fades away in the face of it's superior descendant, that an OS in QBasic isn't the impossibility people like to imagine it is.
Ofcourse it's possible..

It's just as possible as making an OS in C...


Oyu need to make a low level ASM loader to work as a runtime lib thingy...
The thing I'm worried about is whether the QB standard library relies on something inherently DOS to execute. If that's not the case, then I could probably get a kernel loaded using some ASM and I'd have a QBOS, but if it is, I'm not sure it would be easy to use QB to make an OS.
I'd bet that QB's rtlib has lots of DOS calls in it, but I don't know... just about everything you do in QB requires a rtlib call, though, so you must tread very carefully...
QB's runtime relies on DOS almost for everything, from allocating memory to accessing the disk drives.

I think that the only way to write an OS is with a low level language such as ASM or C, where you don't have to rely on a runtime library.
Or you would have to rewrite the DOS functionality that QB depends on yourself. Go for it! Big Grin
Quote:Or you would have to rewrite the DOS functionality that QB depends on yourself. Go for it! Big Grin

... and that would be writing the core of your "QB OS" in ASM...
If qb relies on MS-DOS calls for allocating memories for variables, then there's not a darned thing you can do about that.
... now, if you were to write/steal from Linux or whatever a little real-mode stub that sets up protected mode, then ported the freeBASIC rtlib to asm, you could use freeBASIC to generate most of the code for your OS. Smile
the interesting question is this: How much of DOS is actually DOS? Many interrupts are included by the BIOS, so if enough of DOS is just the real-mode BIOS, it should be possible to step around the dos stuff and execute a qb executable with relatively little trouble; most of what we do in DOS is through BIOS interrupts anyway.
Pages: 1 2 3