Friday 15 June 2012

assembly - Correct use of CPU registers -- scheduling concepts -



assembly - Correct use of CPU registers -- scheduling concepts -

warning: question more theoretical , less practical. unfortunately didn't manage find much info googling it.

having started basic mips32 assembly programming, educational purposes, can't seem understand something: if writes programme in mips assembly, , programme run on mips multitasking operating system, how process scheduling works?

1) example, in multitasking environment, when switch process must occur, os store registers' values somewhere in memory , wipes registers next process can utilize them? 2) appropriate utilize of registers? temp registers ($t0-$t7) @ disposal @ time? can utilize of other registers whenever like?

for 1), yes, when switching process process b, os has store a's registers in memory, , restores b's registers similar storage location.

because of this, process has illusion in finish command of processor's total register set; of general purpose registers on mips can used process wants (with exception of registers 26 , 27 reserved kernel). more complex conventions registers temporary values , such functions within 1 process can cooperate properly, passing values , not stepping on each other's registers.

gritty details on abi can found here: http://techpubs.sgi.com/library/dynaweb_docs/0640/sgi_developer/books/mpro_n32_abi/sgi_html/ch02.html

assembly mips scheduling cpu-registers

No comments:

Post a Comment