Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows style O/S in QBASIC!!!

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
DOH! I need HELP!

Id like to create a windows style O/S in QBasic but don't know where to start. Can anyone give me any advice / code that will prove of value in my quest to beat the crap out of BILL GATE's WINDOWS!!!!?
Not really! I just wanna have my own version of windows so that I can feel I have achived something great!

PLEASE HELP ME, I'd be well greatfull
 
Qbasic will NOT! be good at all for creating an OS, plus it cant multithread even, you would need to do some Assembly, or some C++, something that's much more powerful. You couldnt even make an OS better than Win3.1 or even DOS (including being able to boot up) with just Qbasic alone.

[sig]<p>Karl<br><a href=mailto:kb244@kb244.com>kb244@kb244.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>
[/sig]
 
Really a nice thought, Homer, but, as Karl pointed out, it is impossible to create a multi-tasking, multi-threading application using QB. Microsoft developed QB in a way that prevents it from ever being used for that purpose.

You can write an application that mimics the appearance of Windows and do some pretty fancy stuff with InterruptX but you would really need to rely on pure Assembly to do the job you want to accomplish.

Sorry about that. QB is a very good language for many purposes but it isn't suited for OS development.
[sig]<a href=mailto:CraigL@bc-corp.com>CraigL@bc-corp.com</a><br>[/sig]
 
Using assisted libraries like an Graphic lib created for QB4.5 that oneone posted here, allowed you to work with nice smooth graphics, however due to QB, it could still only be single tasked, and it could only use VESA modes( I think ) something as far complex as an OS would need to be assembly (some C++ once you get past the Partitioning, booting, hardware interface, CPU instructions, memory registers, IRQ, DMAs, etc etc etc) And you would have to have an extensive knowledge of how computers worked on the lowest level. If someone could just as easily grab a simple compiler (one that used to come free with DOS 5.0 for example :) ) and just start creating an OS no prob, then that would mean by reasoning that a company like microsoft could have done their job a thousand times better. if compared to a simple entry level skilled person being able to create even the simplest of an OS.

Creating something like DOS took a while, not just the command prompt, but because it had to interface with alot of the memory and what not, but programmers who programed for dos, would have to understand hardware as well, since DOS didnt support hardware right off, instead the programmer would have to know how to send interupts, or command right to the device he/she was looking for, of course some compilers can help eliminate the need by using standard modes for certain things (like Qbasic uses Screen 13, etc to evoke the standard video mode)

If I were you I'd start small, and build skill up from there. [sig]<p>Karl<br><a href=mailto:kb244@kb244.com>kb244@kb244.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>
[/sig]
 
I'll be the devil's advocate here. I think trying to work around the restrictions posed in QB are fun. In fact with a lot of work, you can make a multithreaded environment in QB. The thread switching granularity would probably be limited to statement level unless you make your own multithreaded runtime library though. One idea I've seen for doing this sort of thing is to hook the interrupt used for handing errors in QB. Since that interrupt is always active, it can be used as a task switcher. You'll have to write a context switch routine in assembler though, for an effective preemptive multithreaded system. An easier way is to structure your programs so that they yield periodically (depending on thread priority) to the task switcher (part of the OS kernel). This is somewhat like how Windows 3.1 works. Some DOS games and utilities are written this way. uses this concept.
For a start on preemptive multitasking, look at You were probably looking to create a &quot;shell&quot;, or the GUI of the operating system. For that kind of thing, there is the AlfaOS at in the QB section, and Eclipzer's Nitescript GUI system at Have fun programming!
 
Well it would certainly be a hell of alot of work to make a true OS from qbasic (I'm talking about pure OS, I'm not talking about creating a GUI Shell, that resembles windows)

But good links, they would certainly help out the die-hard types of guys. [sig]<p>Karl<br><a href=mailto:kb244@kb244.com>kb244@kb244.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>
[/sig]
 
Dang it, Toshi, I keep reaching for that &quot;Vote Toshi Tip Master&quot; link and it isn't there. You certainly gave me pause for thought.

Has anybody ever put the puzzle pieces together so they will actually work per your speculation?
[sig]<p> <br><a href=mailto: > </a><br><a href= plain black box</a><br>Don't sit down. It's time to dig another one.[/sig]
 
well, since I've got my three favorite gurus in one place
I will try and formulate a question.
I left Qbasic to learn C and I'm really confused, I thought C was supposed to be standardized and portable but in reality &quot;C's got his own problems&quot; ,it's like, how do I even
get sprites up on the screen? open GL? ActiveX?
DrawSproket(mac)? Carbon(mac)?
Can I write something from scratch to make my code portable
and accomplish what I want graphically? It's taken me two months to get familiar with my IDE and write my 'first' few programs. I don't mind the learning curve but I'm trying to
figure out what to learn.
Anyway, I'll figure it out sooner or later. I just saw that it was possible to write an OS in Qbasic and I had a panic attack. I should have never left. [sig]<p>Lupine<br><a href=mailto:RobertCorrina@patownsend.com>RobertCorrina@patownsend.com</a><br><a href= > </a><br> [/sig]
 
Graphics programming in C is NOT standardized. ANSI C only standardizes stream-oriented textmode stuff. The graphics APIs (functions you call) are constantly changing, so it's useless to learn in the long term. That's why most schools do programming assignments for textmode. However, it *is* standardized in Java. I've written Java graphics apps that work on Macs, PCs, and a bunch of UNIX OSs.

But if you like C for its hack value or speed, you can try using stuff like OpenPTC for 2D and OpenGL for 3D. In Windows, OpenPTC uses DirectX if it is available, or GDI if not, and it works well in DOS and UNIX, so it's pretty useful. PTC can be found at OpenGL is for drawing 3D primitives and doing transforms and lighting. It can be used to display 2D sprites, but you're wasting its power if you do that. If you want to make OpenGL games, start at If you want something more compatible and nicer, try GLUT at
If you really want to use DirectX, you can download it (122MB!) from and start off with If you don't understand graphics programming under Windows, you'd better look at this too. If you don't understand Windows programming, DirectX programming may be painful. One month with this book got me up to speed. _Programming_Windows_ Fifth Edition by Charles Petzold.

Good luck, lupine.
 
Java it is then, Luckily I havent gotten to far in C any way
Thank you Toshi,Thank you. [sig]<p>Lupine<br><a href=mailto:RobertCorrina@patownsend.com>RobertCorrina@patownsend.com</a><br><a href= > </a><br> [/sig]
 
Oh no! Not Java! LOL Sorry about the prejudice... every time I hear or read that word I have flashbacks from an assignment when I worked under an accountant who decided that I was going to rewrite all of the company's user applications (Excel, Paradox, MS Word, etc. in Java... there's that word again... I can't get it out of my head... somebody help me!)

His reasoning was that it worked on any platform and it would be a really easy way to make our Win9x workstations communicate with our HP3000 mainframe (running COBOL). ARRGGGHHH! The first thing he did was download the &quot;compleate works&quot; from the Sun site. Then he bought me a book called &quot;Learn Java in 21 Hours&quot;.

Then he asked me about my opinion.

&quot;Do you know Java?&quot;

&quot;Nope.&quot;

&quot;Have you ever heard of Java?&quot;

&quot;Yep. I just had a cup of it.&quot;

&quot;Good. That's what you'll be using to write our new system.&quot;

Okay.... About a week later he walked in my office, looked at my monitor and asked &quot;Why are you coding in Visual Basic?&quot;

I explained that it was just a little program that let me edit the Java code and then run it without shelling to the DOS prompt.

&quot;Well, why are you doing that?&quot;

(((BECAUSE YOU DIDN'T BUY AN IDE, YA MORON!)) Didn't say it, but the notion was starting to boil over.

Java might really be the way of the future. If you have had any experience with C, Java will be second-nature. But make sure you find an adequate IDE and never, ever allow an accountant to tell you how, what or the way you should write your code.
[sig]<p> <br><a href=mailto: > </a><br><a href= plain black box</a><br>"Suffice it to say that adding disk drives and a disk operating system to a personal microcomputer is guaranteed to increase its power dramatically."<br>
<u><b>CP/M and the Personal Computer</u></b>[/sig]
 

Hey, Alt255.

Here's an easy way to get Java out of your head.

Think a happy thought! You know the things that make you happy (if there are any). If that doesn't work try visualization like the accountant being stung by a bee on his nose and it blows up, or a dog hum*ping his leg while he's trying to climb some stairs, or him falling down an elevator shaft or something.

I'm hoping my suggestions help you. :)

--MiggyD [sig]<p> <br><a href=mailto: > </a><br><a href= > </a><br>English is too hard to learn, the vowles change too much like come/home, comb/tomb, book/school, high/bye/sty, etc., etc. So should I say Geez or Sheez or Cheeze? hehe.[/sig]
 
Thanks for the suggestions, MiggyD. I'll try some of them later. Sometimes I get a little comfort envisioning him scrutinizing his keyboard, hunting for the &quot;Any key&quot; so he can &quot;strike&quot; and comply with the instructions on his screen.

Seriously, Java is probably a neat little language. I just wish the circumstances had been different. Oh well... maybe some day when I am independantly wealthy and have too much time on my hands....

Sometimes it isn't so easy for an old dog to learn new tricks.
[sig]<p> <br><a href=mailto: > </a><br><a href= plain black box</a><br>"Suffice it to say that adding disk drives and a disk operating system to a personal microcomputer is guaranteed to increase its power dramatically."<br>
<u><b>CP/M and the Personal Computer</u></b>[/sig]
 
To the first paragraph: lol

To the last paragraph: I agree with your observation. I'm going back to school and whoa boy! I had forgotten how to study. [sig]<p> <br><a href=mailto: > </a><br><a href= > </a><br>English is too hard to learn, the vowles change too much like come/home, comb/tomb, book/school, high/bye/sty, etc., etc. So should I say Geez or Sheez or Cheeze? hehe.[/sig]
 
alright, I'll learn C (and open GL), then I'll learn Java
then I'll learn Japanese then I'll learn ASM then I'll
learn whatever language they are using in 2059
(assuming we are still attached to the physical world)
open GL is portable right?
ok then
GN all [sig]<p>Lupine<br><a href=mailto:RobertCorrina@patownsend.com>RobertCorrina@patownsend.com</a><br><a href= > </a><br> [/sig]
 
Well OpenGL is pretty standard, but it's not like portable to the point that you could swap around OpenGL code without modifying it somehow to the new system, for example, you can do OpenGL in Visual Basic, or VC++, but you'll have to rewrite a little bit before you can get it working in Linux or something similar. [sig]<p>Karl<br><a href=mailto:kb244@kb244.com>kb244@kb244.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>
[/sig]
 
I am finding out that I'm looking at some serious portability issues (targets WIN, LINUX, MAC 7-9, MAC 10)
1So, can Java really run on all these machines?

2Are Java games unstable or &quot;crash happy&quot;?

3Do all high end computers have Virtual JAva Machine?

4. Is there an example of a Java game that I can download and test?

5. I know some Qbasic, I took to Java right away, it seems more like what I'm used to then C
am I mental or something?

6. Is Java *really* slow? I am only needing 2D 256colors?

7. Does Java have any weaknesses that I'm missing above? how is it at data manipulation? Can I seperate data and logic as in other languages? [sig]<p>Lupine<br><a href=mailto:RobertCorrina@patownsend.com>RobertCorrina@patownsend.com</a><br><a href= > </a><br> [/sig]
 
Java is truely portible provided that the platform has a JVM, as for 2, Java is very stable &quot;IF&quot; you write it correctly. Most computers equiped with Windows or Mac have a JVM, Linux you would have to download one. Java is more close to C/C++ Style/Structure, in fact JAVA took some tips from C/C++ as well as from pascal and many other major language to create what felt to be the best design for Sun.
Java is just as strong as most C++ and other languages, you cannot strictly say this always has this or that weakness, with these types of questions, you might find yourself keeping away from most languages, it depends mostly on how you as a programmer can efficiently make programs, the more powerfull languages(or more flexible) rely more on how you write it. [sig]<p>Karl<br><a href=mailto:kb244@kb244.com>kb244@kb244.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>
[/sig]
 
what everybody else is telling you is not entirely true. Get a .exe disassembler and open .exe programs as files. With the OPEN statement. Make a SUB to run it. I don't know how many files you can open at once, but everybody else was right with one thing. It is impossible to make a IPL in QB, believe me, i've been working on that for a long time w/o getting anywhere. Slim chance you could make anything like windows, but if you look closely Windows 3.1 and 2.0 are not true OS's if you really look you can see that they are complicated, integrated .exe programs (win.exe), but 95 and up are true OS's. I hope this helped
PS: I am trying to do the same thing you are if I get anywhere I will tell you and you can find a great deisassmebler at qbasic.com
 
Well I ve been thinking about the same things and I tried Java and you need the runtime, so I thought, it ain't no good expecting the other fellow to have that, so I thought, Pascal, and couldn't get MPW to compile the code, so I thought C+ and I cannot get my head around Classes and objects, and shared librarys. Can someone out there with an ounce more sense give me a small precise about how the XXXX this relates to a good old for next loop with a print and input and a read and data, with a gosub here and a gosub there for good measure, cos I'm eighties man!, and stuffed to see a book that explains the important stuff technically, not big dummie and clearly. I want to peek and poke my mac but where's the data online? Who ever had the dream of Ja hav her and C must of been someone like Karl Marx.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top