Page 1 of 1

run another program within qbasic

Posted: Sat Apr 25, 2009 1:34 am
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'!

Posted: Sat Apr 25, 2009 5:30 am
by Pharoah
Try SHELL.

How did you make your browser work without it?

Posted: Sat Apr 25, 2009 6:21 am
by bongomeno
the shell command executes a msdos command, and other programs
so it likey requires msdos

Posted: Sat Apr 25, 2009 8:23 am
by Pharoah
Windows has ntdvm so shell wil work fine.

1337

Posted: Sat Apr 25, 2009 11:41 am
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.

Posted: Sat Apr 25, 2009 12:02 pm
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.

Posted: Mon Apr 27, 2009 6:29 am
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.

asm os

Posted: Mon Apr 27, 2009 8:34 pm
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.

Posted: Wed Apr 29, 2009 4:51 pm
by qbguy
You can use SOME interrupts (those implemented in the BIOS)

http://en.wikipedia.org/wiki/BIOS_call

Posted: Wed Apr 29, 2009 11:10 pm
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.