[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [f-cpu] optional SRB



hi,

Antoine wrote:

>>	I reread the chapter named "ISA modularity" and I have a little problem. If 
>>we trust this paragraph, the SRB is optional, or I think that's totally 
>>impossible to write an OS without it. I don't know if the idea is to be able 
>>to create F-CPU where only one application can run or if it's a mistake.
>>    
>>
>
>It's quite simple to solve IMHO. On a context switch (IRQ/trap/...),
>the current PC could be stored in a special register, so as to be 
>restored at the end without any need for SRB.
>
>Of course, the IRQ/trap/syscall handler should actually store the
>SR somewhere else as soon as possible, so as to avoid crashing if
>the handler itself is interrupted (besides, the OS would take care
>that all handlers are locked in memory - i.e. can not be swapped to 
>disk).
>
>This is much simpler than making the SRB mandatory.
>  
>
and that's "RISC" ;-)

> Antoine wrote:
>
>Le lun 25/11/2002 à 00:10, Christophe Avoinne a écrit :
>  
>
>>And where is the stack pointer ????? F-cpu has no dedicated stack pointer !!!
>>    
>>
>
>So what ? SRB or not, it makes no difference. The OS still
>has to figure out where to save the registers anyway. In one
>case it will just set the SRB context block address in an SR
>and let the CPU do the savin, in the other case it will have
>to save registers manually.
>
>Please note : even if the SRB is not available, the SRs 
>SRB_old and SRB_new can still exist, and just be used by the
>OS to emulate the SRB in a software way. 
>  
>

cool ! someone who understands the basics ;-)
ok, there might be some hidden costs.
it might not solve everything, but it addresses most problems.
and it doesn't sound difficult to implement.

YG

PS : i recently attended a conference about GNU/Hurd and i have
seen some Hurd sourcec code. It's very far from POSIX but
one of the most crazy things i've seen is ... mmap() used for doing
a malloc() .....

*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/