Page 1 of 1

Executing programs (of any sort)

Posted: Fri May 25, 2007 3:39 pm
by graldur
Hello, I am at the point in the development process where I want to run other programs that I compiled separately. I have a working floppy driver, so I read the binaries from a disk and put it into memory. However, I can't figure out how to actually transfer control to this new thing! I have an ELF binary and a flat binary, and I'm fairly sure my ELF header parser works. Though this doesn't work even with the flat binary. I've tried doing asm("call 0xmemaddress") but this always gives me an Illegal Instruction error when it is run. I really don't know what to do -- help would be appreciated.

Re: Executing programs (of any sort)

Posted: Fri May 25, 2007 4:24 pm
by mathematician
graldur wrote:Hello, I am at the point in the development process where I want to run other programs that I compiled separately. I have a working floppy driver, so I read the binaries from a disk and put it into memory. However, I can't figure out how to actually transfer control to this new thing! I have an ELF binary and a flat binary, and I'm fairly sure my ELF header parser works. Though this doesn't work even with the flat binary. I've tried doing asm("call 0xmemaddress") but this always gives me an Illegal Instruction error when it is run. I really don't know what to do -- help would be appreciated.
According to the Intel manual why a call addr shouldn't work, unless you are coming up against a limitation of your compiler/assembler. Have you tried loading the address into a register and doing a call eax?

Posted: Fri May 25, 2007 5:08 pm
by graldur
It's always so simple. Thanks a lot!

have you considered

Posted: Tue Jun 26, 2007 5:57 pm
by com1
Have you considered processes? You can use these to run the binaries you have in memory