Frage

All I am ever told is that the ONLY way to do multiprocessing in the assembly language is to use the OS system calls, making it seem impossible to do it from the assembly language. But let's say I was making my own operating system. How would I use the assembly language to use multiple processers? I know it's possible or else no computer would be able to do it. I just don't know how to do it nor can I find any good rescources for this.

War es hilfreich?

Lösung

Basically you need to setup an interrupt timer, which fires every N intervalls. In this you save the CPU state, like registers and flags, load the new set from a different task and let it continue. This is the easy part of a scheduler. :)

If you want to really do multiprocessing, in full detail, then you should really look into the sources for i.e. Linux kernel.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top