Executing programs (of any sort)

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
graldur
Posts: 2
Joined: Fri May 25, 2007 3:34 pm

Executing programs (of any sort)

Post 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.
User avatar
mathematician
Member
Member
Posts: 437
Joined: Fri Dec 15, 2006 5:26 pm
Location: Church Stretton Uk

Re: Executing programs (of any sort)

Post 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?
graldur
Posts: 2
Joined: Fri May 25, 2007 3:34 pm

Post by graldur »

It's always so simple. Thanks a lot!
com1
Member
Member
Posts: 105
Joined: Sat Apr 28, 2007 11:57 am
Location: TN

have you considered

Post by com1 »

Have you considered processes? You can use these to run the binaries you have in memory
oh microsoft, microsoft, what souls you have dismayed
Post Reply