Exec
Posted: Sat Jan 24, 2009 11:32 pm
I have finally gotten my multitasking to work, and I have now implemented an Exec function that allows me to execute bin and com files. This will later be upgraded to run ELF files. At the moment I just need some advice.
When the exec function is called, I load the file to memory, then I create a new user task for the program. I now need to implement a way to kill the task and free the memory used by it when the program is finished running. My problem is how would I implement this. Would adding a system call in the program at the end be the easiest way? ie:
Or is there a better way to do this?
When the exec function is called, I load the file to memory, then I create a new user task for the program. I now need to implement a way to kill the task and free the memory used by it when the program is finished running. My problem is how would I implement this. Would adding a system call in the program at the end be the easiest way? ie:
Code: Select all
...Program Code...
mov eax, 0x00 //System call to kill task
int 0x80