Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Didattica > Corsi N - Z > Sistemi operativi I > Effetto tasto F8
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
=kimi=
.primate.

User info:
Registered: Jan 2006
Posts: 69 (0.01 al dì)
Location: milano
Corso: Informatica
Anno: 1
Time Online: 3:26:04: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
Effetto tasto F8

ciao ragazzi,
volevo sapere se c'era qualcuno disponibile a spiegare i passi che bisogna fare su minix per poter modificare il tasto f8, cioè quando lo si preme per esempio compare una scritta.

26-06-2007 14:03
Click Here to See the Profile for =kimi= Click here to Send =kimi= a Private Message Find more posts by =kimi= Add =kimi= to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
n3o
tanto c'è SPASS...

User info:
Registered: Oct 2005
Posts: 134 (0.02 al dì)
Location: Brescia
Corso: Informatica Magistrale
Anno:
Time Online: 1 Day, 19:26:05: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Devi modificare solo un paio di file:

in /usr/src/servers/is/dmp.c

code:
#define NHOOKS 18 struct hook_entry { int key; void (*function)(void); char *name; } hooks[NHOOKS] = { { F1, proctab_dmp, "Kernel process table" }, { F2, memmap_dmp, "Process memory maps" }, { F3, image_dmp, "System image" }, { F4, privileges_dmp, "Process privileges" }, { F5, monparams_dmp, "Boot monitor parameters" }, { F6, irqtab_dmp, "IRQ hooks and policies" }, { F7, kmessages_dmp, "Kernel messages" }, { F9, sched_dmp, "Scheduling queues" }, { F10, kenv_dmp, "Kernel parameters" }, ....


Modifichi
#define NHOOKS 18 in #define NHOOKS 19
Aggiungi la seguente riga nela struttura degli HOOKS:
code:
.... { F6, irqtab_dmp, "IRQ hooks and policies" }, { F7, kmessages_dmp, "Kernel messages" }, { F8, hw_dmp, "Print a nice message!" }, { F9, sched_dmp, "Scheduling queues" }, { F10, kenv_dmp, "Kernel parameters" }, ....


In fondo al file aggiungi la funzione hw_dmp :
code:
PUBLIC void hw_dmp(void) { printf ("Hello World !!!\n"); }


Infine in /usr/src/servers/is/proto.h

code:
/* Function prototypes. */ /* main.c */ _PROTOTYPE( int main, (int argc, char **argv) ); /* dmp.c */ _PROTOTYPE( int do_fkey_pressed, (message *m) ); _PROTOTYPE( void mapping_dmp, (void) ); ....


Aggiungi un prototipo nel gruppo dmp.c

code:
/* Function prototypes. */ /* main.c */ _PROTOTYPE( int main, (int argc, char **argv) ); /* dmp.c */ _PROTOTYPE( int do_fkey_pressed, (message *m) ); _PROTOTYPE( void mapping_dmp, (void) ); _PROTOTYPE( void hw_dmp, (void) ); ....


Spostati in /usr/src/tools

make image
make services (fondamentale!)
make hdboot
reboot

That's all folks!!!

__________________
The answer is blowing in the wind...

26-06-2007 18:07
Click Here to See the Profile for n3o Click here to Send n3o a Private Message Find more posts by n3o Add n3o to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
=kimi=
.primate.

User info:
Registered: Jan 2006
Posts: 69 (0.01 al dì)
Location: milano
Corso: Informatica
Anno: 1
Time Online: 3:26:04: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

grazie mille,
invece per quanto riguarda la modifica nel kernel,quando inseriamo una nuova syscall con parametri a cosa devo stare attento??? puoi darmi anche li delle dritte???

26-06-2007 19:09
Click Here to See the Profile for =kimi= Click here to Send =kimi= a Private Message Find more posts by =kimi= Add =kimi= to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
n3o
tanto c'è SPASS...

User info:
Registered: Oct 2005
Posts: 134 (0.02 al dì)
Location: Brescia
Corso: Informatica Magistrale
Anno:
Time Online: 1 Day, 19:26:05: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Questa è decisamente più complicata...


  1. In /usr/src/include/minix/call_nr.h
    Aumenta di uno il numero di syscall NCALLS e aggiungi una syscall alla fine seguendo lo schema delle precedenti, es:
    #define GREETINGS 95 /* to PM */
  2. In /usr/src/servers/fs/table.c aggiungi alla fine dei prototipi la riga:
    no_sys, /* 95 = greetings */
  3. In /usr/src/servers/pm/table.c aggiungi alla fine dei prototipi la riga:
    do_greetings, /* 95 = greetings */
  4. In /usr/src/servers/pm/misc.c aggiungi la syscall vera e propria alla fine del file:
    code:
    PUBLIC void do_greetings (void) { printf ("Hi %s, %d greeting%s for you !!!\n", m_in.m3_ca1, m_in.m3_i1, m_in.m3_i1 == 1 ? "" : "s"); }
    m_in è il messaggio in ingresso, guarda sul libro per la composizione dei vari messaggi...
  5. In /usr/src/servers/pm/proto.h
    Aggiungi il prototipo della funzione appena creata sotto la sezione misc.c:
    _PROTOTYPE( void do_greetings, (void) );
  6. A questo punto ricompila tutto con make image e make hdboot poi fai uno shutdown e crea un file di test del tipo:
    code:
    #include <lib.h> #include <string.h> #include <unistd.h> int main (void) { message m; m.m3_i1 = 5 strcpy (m.m3_ca1, "Pippo Pluto"); // Max 13 caratteri + '\0' _syscall (PM_PROC_NR, GREETINGS, &m); return (0); }

    Questo test dovrebbe stamparti:
    # Hi Pippo Pluto, 5 greetings for you !!!

Si potrebbe creare anche un wrapper nelle librerie per evitare di scrivere manualmente i messaggi ma introdurrebbe altre operazioni che probabilmente non servono all'esame...

E anche questa volta è tutto!

__________________
The answer is blowing in the wind...

Last edited by n3o on 18-07-2007 at 15:16

27-06-2007 13:46
Click Here to See the Profile for n3o Click here to Send n3o a Private Message Find more posts by n3o Add n3o to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
liver82
.fedelissimo.

User info:
Registered: Sep 2002
Posts: 56 (0.01 al dì)
Location: Milano
Corso:
Anno:
Time Online: 16:03:12 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Scusa ma il file di test dove va messo?
Grazie mille!!!

18-07-2007 21:54
Click Here to See the Profile for liver82 Click here to Send liver82 a Private Message Find more posts by liver82 Add liver82 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
n3o
tanto c'è SPASS...

User info:
Registered: Oct 2005
Posts: 134 (0.02 al dì)
Location: Brescia
Corso: Informatica Magistrale
Anno:
Time Online: 1 Day, 19:26:05: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

è un programmino che puoi mettere dove vuoi (io l'ho messo nella mia home) :D
Scrittura: elvis test.c (o elle, io ho scaricato vim..)
Compilazione: cc test.c -o test
Esecuzione: ./test

__________________
The answer is blowing in the wind...

Last edited by n3o on 18-07-2007 at 22:05

18-07-2007 22:03
Click Here to See the Profile for n3o Click here to Send n3o a Private Message Find more posts by n3o Add n3o to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
marbliss
.illuminato.

User info:
Registered: Nov 2006
Posts: 84 (0.01 al dì)
Location: Milano
Corso: TICOM
Anno: Primo
Time Online: 3 Days, 20:37:00: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Ciao, ho seguito passo per passo tutto quello che c'è da fare per far stampare "Hello World" quando si preme F8 ma non mi funziona. Ricompila il kernel senza errori, ma premendo F8 non succede niente!! Qualcuno mi può aiutare a capire come mai? Grazie a chi risponde

12-07-2008 02:02
Click Here to See the Profile for marbliss Click here to Send marbliss a Private Message Find more posts by marbliss Add marbliss to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
cimax86
.simpatizzante.

User info:
Registered: Jul 2008
Posts: 19 (0.00 al dì)
Location:
Corso:
Anno:
Time Online: 3:06:51 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

controlla di aver fatto giusta la punteggiatura. a me molti errori di compilazione erano su quello.

12-07-2008 11:50
Click Here to See the Profile for cimax86 Click here to Send cimax86 a Private Message Find more posts by cimax86 Add cimax86 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 19:24.    Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.065 seconds (64.32% PHP - 35.68% MySQL) con 23 query.