run another program within qbasic

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
User avatar
bongomeno
Veteran
Posts: 266
Joined: Wed Dec 10, 2008 9:08 am
Location: Arizona
Contact:

run another program within qbasic

Post by bongomeno »

i have been working on writing my own qb os.

1 PROBLEM!!!

how do i execute another executable program (.com, .exe) within my qb program?????????

i tried to use CALL ABSOLUTE, but it just crashed qb.....

does any1 have some code so i can load a program aand run it and return to my program? i would appreciate it very much!

btw my os is a tui and i am working on a gui to run on it.
its called '1337 coders os'

i already added file managment commands+more and the abaility to execute special 'batch files'!
Pharoah
Coder
Posts: 33
Joined: Sun Nov 27, 2005 10:35 am
Location: Pennsylvania, United States
Contact:

Post by Pharoah »

Try SHELL.

How did you make your browser work without it?
User avatar
bongomeno
Veteran
Posts: 266
Joined: Wed Dec 10, 2008 9:08 am
Location: Arizona
Contact:

Post by bongomeno »

the shell command executes a msdos command, and other programs
so it likey requires msdos
Pharoah
Coder
Posts: 33
Joined: Sun Nov 27, 2005 10:35 am
Location: Pennsylvania, United States
Contact:

Post by Pharoah »

Windows has ntdvm so shell wil work fine.
User avatar
bongomeno
Veteran
Posts: 266
Joined: Wed Dec 10, 2008 9:08 am
Location: Arizona
Contact:

1337

Post by bongomeno »

i dont think shell will work for me because i am writing my own STAND ALONE operating system. i will run it from a flash drive or floppy disp probably. if shell requires nvtdm or windows, it will not work for me.

i need code that loads the hex code from a file and executes it useng call absolute or something.
Pharoah
Coder
Posts: 33
Joined: Sun Nov 27, 2005 10:35 am
Location: Pennsylvania, United States
Contact:

Post by Pharoah »

If you are writing your own stand alone operating system, you can't use any Qbasic file system commands. You will have to write a lot in assembly.

For every platform QB is designed for, shell will work. Most QB GUIs are written to run on DOS, which is nice and minimul and handles shell fine.

NTDVM is just a dos emulator for windows.
angros47
Veteran
Posts: 79
Joined: Mon Sep 08, 2008 12:52 pm
Contact:

Post by angros47 »

If you are using a program written in qb, you can load it over DOS, and shell will work (but you won't be able to use long file names).

If you are going to write your own kernel, you'll need something like bootprog to load it directly from the boot sector, but you have no dos services (so, no file commands, no memory allocation commands, no strings, no arrays...).
A Qb-compiled program won't work. A program compiled in freebasic can work if you don't use strings, dynamic arrays and the runtime library (actually, it will be like programming in C with no libraries).

On the site http://www.osdev.org there is an example about writing a true OS in freebasic.

As far as I know, nobody ever wrote a real OS in qb, the only thing you can write is a sort of shell that run over dos (a concept like windows 3.1). A good example of that is GIMI by Sebastian Mate.
User avatar
bongomeno
Veteran
Posts: 266
Joined: Wed Dec 10, 2008 9:08 am
Location: Arizona
Contact:

asm os

Post by bongomeno »

thanx 4 the tips.

im gonna try to make an os in asm now. :shock:

254534534 problems....

- I dont know alot of asm
- can I use interrupts if i make my own kernal (no MSDOS)
- i need some routines for text output and input and file managment and alot more :cry: (if i cant use int w/o msdos)

any help for a poor asm newb would be GREATLY appreciated. :D

---------------------------------------- ps

if i can use int w/o msdos then i need a assembler compatable with the program debug.
qbguy
Coder
Posts: 14
Joined: Tue Dec 26, 2006 7:27 pm

Post by qbguy »

You can use SOME interrupts (those implemented in the BIOS)

http://en.wikipedia.org/wiki/BIOS_call
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 »

Creating an OS has always been attractive, but not really very useful.

Plus it is more trouble than it's worth. Consider DOS as an OS and move on. You can do too many other projects, because NOBODY is gonna pay for more.

Just reality, but DOS is enough to have fun in. No matter how much M$ wants to ditch it, it works.
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
Post Reply