Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Descrittore processo Linux[Risolto]
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
dursino
Tux's lil' helper
Tux's lil' helper


Joined: 26 Feb 2010
Posts: 83

PostPosted: Mon Dec 20, 2010 11:39 am    Post subject: Descrittore processo Linux[Risolto] Reply with quote

Salve ragazzi, ho scaricato un sorgente del Kernel per vedere un attimo come linux organizza il descrittore di processo.
Sapete in che file posso andare a parare per ottenere questa info?
Grazie


Last edited by dursino on Tue Dec 21, 2010 8:47 am; edited 1 time in total
Back to top
View user's profile Send private message
cloc3
Advocate
Advocate


Joined: 13 Jan 2004
Posts: 4787
Location: http://www.gentoo-users.org/user/cloc3/

PostPosted: Mon Dec 20, 2010 3:44 pm    Post subject: Reply with quote

Code:

ls /proc/1

:?:
_________________
vu vu vu
gentù
mi piaci tu
Back to top
View user's profile Send private message
dursino
Tux's lil' helper
Tux's lil' helper


Joined: 26 Feb 2010
Posts: 83

PostPosted: Mon Dec 20, 2010 6:28 pm    Post subject: Reply with quote

Intendo il file dove è dichiarato la struttura del descrittore di processo,dovrebbe essere tipo cosi:
Code:
struct task_struct {
/* these are hardcoded - don't touch */
volatile long        state;          /* -1 unrunnable, 0 runnable, >0 stopped */
long                 counter;
long                 priority;
unsigned             long signal;
unsigned             long blocked;   /* bitmap of masked signals */
unsigned             long flags;     /* per process flags, defined below */
int errno;
long                 debugreg[8];    /* Hardware debugging registers */
struct exec_domain   *exec_domain;
/* various fields */
struct linux_binfmt  *binfmt;
struct task_struct   *next_task, *prev_task;
struct task_struct   *next_run,  *prev_run;
unsigned long        saved_kernel_stack;
unsigned long        kernel_stack_page;
int                  exit_code, exit_signal;
/* ??? */
unsigned long        personality;
int                  dumpable:1;
int                  did_exec:1;
int                  pid;
int                  pgrp;
int                  tty_old_pgrp;
int                  session;
                                                                       
                                                                       
/* boolean value for session group leader */
int                  leader;
int                  groups[NGROUPS];
/*
* pointers to (original) parent process, youngest child, younger sibling,
* older sibling, respectively.  (p->father can be replaced with
* p->p_pptr->pid)
*/
struct task_struct   *p_opptr, *p_pptr, *p_cptr,
                  *p_ysptr, *p_osptr;
struct wait_queue    *wait_chldexit;


Comunque interessante anche la risorsa da te postata..Dove ci sono le info fondamentali dei processi presenti nel sistema
Back to top
View user's profile Send private message
cloc3
Advocate
Advocate


Joined: 13 Jan 2004
Posts: 4787
Location: http://www.gentoo-users.org/user/cloc3/

PostPosted: Mon Dec 20, 2010 9:45 pm    Post subject: Reply with quote

dursino wrote:
Intendo il file dove è dichiarato la struttura del descrittore di processo,dovrebbe essere tipo cosi:
Code:
struct task_struct {


quelle sono dichiarazioni da cercare alla fonte, direttamente nei sorgenti:
Code:

s939 ~ # grep -rH "struct task_struct {" /usr/src/linux
/usr/src/linux/include/linux/sched.h:struct task_struct {
s939 ~ #

_________________
vu vu vu
gentù
mi piaci tu
Back to top
View user's profile Send private message
dursino
Tux's lil' helper
Tux's lil' helper


Joined: 26 Feb 2010
Posts: 83

PostPosted: Tue Dec 21, 2010 8:46 am    Post subject: Reply with quote

Ok,l'ho trovato.
Grazie
Back to top
View user's profile Send private message
Ic3M4n
Advocate
Advocate


Joined: 02 Nov 2004
Posts: 3489
Location: Bergamo.

PostPosted: Tue Dec 21, 2010 6:21 pm    Post subject: Reply with quote

Non so se ti possa interessare, nel senso che non so se sei agli inizi nella programmazione e vuoi avere un idea di come si comporta un kernel per determinate cose, nel caso qui trovi il link al kernel 0.1 di linux, secondo me molto più comprensibile per fasi di studio in cui è necessario capire il funzionamento generale di un kernel.

my 2 cents
Back to top
View user's profile Send private message
dursino
Tux's lil' helper
Tux's lil' helper


Joined: 26 Feb 2010
Posts: 83

PostPosted: Wed Dec 22, 2010 1:19 pm    Post subject: Reply with quote

Un pò di programmazione in c,c++,java assembly la conosco.
All'università ho già studiato un nucleo di sistema operativo minimale:
http://calcolatori.iet.unipi.it/deep/nuclext.tar.gz pert maggiori info.
Comunque hai fatto bene a fornirmi il kernel 0.1 .
Praticamente adesso sto studiando sistemi operativi e nel mentre leggo la teoria volevo vedere anche qualcosa di 'reale',dunque
do un occhiata al kernel linux.
Una domanda vorrei fare, che sito di riferimento avete su argomenti del tipo sistemi operativi,programmazione concorrente?
Mentre circa le reti?
Sto leggendo il libro di Kurose,Ross 5 edizione ed è veramente fatto bene.
Se non è un problema di copyright metto un link al download ,così lo leggete pure voi.
Grazie per le risposte
Back to top
View user's profile Send private message
dursino
Tux's lil' helper
Tux's lil' helper


Joined: 26 Feb 2010
Posts: 83

PostPosted: Thu Dec 23, 2010 10:59 am    Post subject: Reply with quote

Ragazzi voi sapete mica se linux implementa una pila sistema unica od una per ogni processo?
Mentre la pila 'normale' quanto è grande per ogni processo?
Back to top
View user's profile Send private message
Pes88
Apprentice
Apprentice


Joined: 06 May 2009
Posts: 243

PostPosted: Sun Jan 02, 2011 10:42 am    Post subject: Reply with quote

Per queste domande ti conviene usare questo forum :
http://wiki.osdev.org/Main_Page
è dedicato hai sistemi operativi!

Secondo me ti conviene analizzare una versione più avanzata di linux tipo 0.11 o 0.12 perché la 0.1 non è completamente indipendente da minix!
_________________
Pygoscelis papua, chiamato Gentoo dagli abitanti delle isole Falkland/Malvinas, noto per essere il pinguino più veloce!!! XD
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum