Executing programs (of any sort)
Executing programs (of any sort)
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.
- mathematician
- Member
- Posts: 437
- Joined: Fri Dec 15, 2006 5:26 pm
- Location: Church Stretton Uk
Re: Executing programs (of any sort)
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 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.
have you considered
Have you considered processes? You can use these to run the binaries you have in memory
oh microsoft, microsoft, what souls you have dismayed