19.05.2013 Views

Facoltà di Ingegneria Tesi di laurea ANALISI DELLE TECNOLOGIE ...

Facoltà di Ingegneria Tesi di laurea ANALISI DELLE TECNOLOGIE ...

Facoltà di Ingegneria Tesi di laurea ANALISI DELLE TECNOLOGIE ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Figura 1.6: esempio <strong>di</strong> kernel<br />

Quando un processo in esecuzione ha bisogno <strong>di</strong> una risorsa hardware, poiché non ha i<br />

privilegi <strong>di</strong> accesso a queste, deve richiedere l’intervento del kernel, attraverso una chiamata a<br />

sistema (system call), che provoca il passaggio dallo user mode al kernel mode: nel kernel<br />

mode vengono eseguite le operazioni necessarie sulle risorse hardware, dopo<strong>di</strong>ché , attraverso<br />

un’istruzione del tipo “return from interrupt”, si ritorna allo user mode.<br />

Stati del processore (CPU states)<br />

Gli stati del processore (detti processor modes, CPU states o CPU privilege levels) sono<br />

modalità operative per il processore <strong>di</strong> alcune architetture <strong>di</strong> computer, che pongono<br />

restrizioni sul tipo e sulla portata delle operazioni che possono essere eseguite da alcuni<br />

processi in esecuzione nella CPU [10].<br />

Idealmente solo al co<strong>di</strong>ce del kernel è permesso <strong>di</strong> eseguire senza restrizioni (unrestricted<br />

mode), mentre tutto il resto è eseguito in una modalità limitata (restricted mode) e c’è bisogno<br />

<strong>di</strong> una chiamata <strong>di</strong> sistema (system call) per richiedere al kernel <strong>di</strong> eseguire qualsiasi<br />

operazione che potrebbe danneggiare o compromettere il sistema (esempi <strong>di</strong> system call sono<br />

l’accesso all’hard <strong>di</strong>sk, operazioni <strong>di</strong> I/O, creazione <strong>di</strong> processi), rendendo impossibile per i<br />

programmi non atten<strong>di</strong>bili <strong>di</strong> mo<strong>di</strong>ficare o danneggiare altri programmi, se non il sistema<br />

stesso.<br />

In generale ci sono due <strong>di</strong>stinti mo<strong>di</strong> operativi: il kernel mode (detto anche supervisor mode o<br />

privileged mode) e lo user mode.<br />

15

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!