executing a little program under custom os

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
suhmaamiar

executing a little program under custom os

Post by suhmaamiar »

i have another question for senior developers here :)

assume i have written a simple os X, under dos enviorment using NASM, all the interrupts i have used are bios dependent,

now i write a simple program Y which output a single
line on screen and then exit. this is also written in
dos enviorment using NASM and bios dependent interrupts are used.

my question is, will that Y program be able to execute
in X os ? if yes, then how can we do that, any assembly
code to support your answer !!

many thanks
gtsphere

Re:executing a little program under custom os

Post by gtsphere »

first of all you are going to need a memory management system either very complacated or as simple as loading that one and only program, and eventually jumping back to your other program. I've done this before, after the bootloader runs, you jump to a memory location of a kernel. Then, after your kernel does some type of command processing, jump to another program that is written to a certain CHS on a disk. This is a way of "hardcoding" the location of the program on the disk, and THEN loading it. Problems are obvious. So in a list, i'd say you would need these:

1) some type of file system / arrangement
2) some type of handling memory, either loading pieces of the programs code and data, handling it, loading more, etc.
3) multitasking? processes? threads?
4) whatever else anyone has to offer heh

I hope this helps
-GT
Post Reply