/demos/trunk/base/aster1.c |
---|
34,7 → 34,7 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* |
* |
* CVS : $Id: aster1.c,v 1.1 2002-10-28 08:13:37 pj Exp $ |
* CVS : $Id: aster1.c,v 1.2 2003-01-07 17:10:15 pj Exp $ |
this is a reduced verion of the classic Hartik demo Aster. |
168,7 → 168,6 |
sys_gettime(&t); |
} while (t.tv_sec < 6); |
sys_status(SCHED_STATUS); |
sys_end(); |
return 0; |
} |
/demos/trunk/base/aster3.c |
---|
34,7 → 34,7 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* |
* |
* CVS : $Id: aster3.c,v 1.2 2002-11-11 08:20:44 pj Exp $ |
* CVS : $Id: aster3.c,v 1.3 2003-01-07 17:10:15 pj Exp $ |
Test Number 10 (A): |
238,8 → 238,6 |
clear(); |
set_exchandler_grx(); |
hard_task_default_model(m); |
hard_task_def_wcet(m,ASTER_WCET); |
hard_task_def_mit(m,10000); |
/demos/trunk/base/aster5.c |
---|
34,7 → 34,7 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* |
* |
* CVS : $Id: aster5.c,v 1.1 2002-11-11 08:22:45 pj Exp $ |
* CVS : $Id: aster5.c,v 1.2 2003-01-07 17:10:15 pj Exp $ |
this is a part of the classic Hartik demo Aster. |
400,7 → 400,6 |
emerg.flag = ALTL_BIT; |
keyb_hook(emerg,fine); |
clear(); |
hard_task_default_model(m); |
/demos/trunk/base/aster6.c |
---|
34,7 → 34,7 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* |
* |
* CVS : $Id: aster6.c,v 1.1 2002-11-11 08:22:45 pj Exp $ |
* CVS : $Id: aster6.c,v 1.2 2003-01-07 17:10:15 pj Exp $ |
this is a part of the classic Hartik demo Aster. |
302,6 → 302,7 |
printf_xy(62,4,WHITE,"Ucbs=%12u",CBS_usedbandwidth(2)); |
mutex_unlock(&m1); |
task_endcycle(); |
if (++s > 59) { |
392,7 → 393,6 |
emerg.flag = ALTL_BIT; |
keyb_hook(emerg,fine); |
set_exchandler_grx(); |
clear(); |
hard_task_default_model(m); |
478,6 → 478,7 |
fineprg.tv_nsec = 0; |
kern_event_post(&fineprg,(void (*)(void *))fine,NULL); |
group_activate(1); |
return 0; |
} |
/demos/trunk/base/aster7.c |
---|
34,7 → 34,7 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* |
* |
* CVS : $Id: aster7.c,v 1.1 2002-11-11 08:22:45 pj Exp $ |
* CVS : $Id: aster7.c,v 1.2 2003-01-07 17:10:15 pj Exp $ |
this is a part of the classic Hartik demo Aster. |
246,8 → 246,6 |
cprintf("Press Alt-x to end the demo..."); |
set_exchandler_grx(); |
//keyb_set_map(itaMap); |
emerg.ascii = 'x'; |
emerg.scan = KEY_X; |
/demos/trunk/base/aster8.c |
---|
34,7 → 34,7 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* |
* |
* CVS : $Id: aster8.c,v 1.1 2002-11-11 08:22:45 pj Exp $ |
* CVS : $Id: aster8.c,v 1.2 2003-01-07 17:10:15 pj Exp $ |
Test for Sporadic Server (ss): |
438,8 → 438,6 |
cprintf("Press Alt-x to end the demo..."); |
set_exchandler_grx(); |
hard_task_default_model(m); |
hard_task_def_mit(m,100000); |
hard_task_def_wcet(m,ASTER_WCET); |
/demos/trunk/base/cabs.c |
---|
34,7 → 34,7 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* |
* |
* CVS : $Id: cabs.c,v 1.2 2002-10-28 08:11:29 pj Exp $ |
* CVS : $Id: cabs.c,v 1.3 2003-01-07 17:10:15 pj Exp $ |
*/ |
/*--------------------------------------------------------------*/ |
88,32 → 88,6 |
/****************************************************************/ |
/* This is the exception handler. It is called when an exception |
is raised. |
It exits from the graphical mode, then it prints a message and |
shutdown the kernel using sys_abort() |
*/ |
void demo_exc_handler(int signo, siginfo_t *info, void *extra) |
{ |
struct timespec t; |
grx_close(); |
/* Default action for an kern exception is */ |
kern_cli(); |
ll_gettime(TIME_EXACT, &t), |
cprintf("\nS.Ha.R.K. Exception raised!!!" |
"\nTime (s:ns) :%ld:%ld" |
"\nException number:%d (numbers in include/bits/errno.h)" |
"\nPID :%d\n", |
t.tv_sec, t.tv_nsec, info->si_value.sival_int, |
info->si_task); |
sys_abort(1); |
} |
/******************************************************************/ |
/* This function is called when Alt-X is pressed. |
It simply shutdown the system using sys_end. |
Note that the byebye() function is called only if we exit from |
160,23 → 134,10 |
int main(int argc, char **argv) |
{ |
struct sigaction action; |
char c = 0; /* character from keyboard */ |
/* Init the standard S.Ha.R.K. exception handler */ |
action.sa_flags = SA_SIGINFO; /* Set the signal action */ |
action.sa_sigaction = demo_exc_handler; |
action.sa_handler = 0; |
sigfillset(&action.sa_mask); /* we block all the other signals... */ |
if (sigaction(SIGHEXC, &action, NULL) == -1) { /* set the signal */ |
perror("Error initializing signals..."); |
sys_end(); |
} |
/* Set the closing function */ |
sys_atrunlevel(byebye, NULL, RUNLEVEL_BEFORE_EXIT|NO_AT_ABORT); |
sys_atrunlevel(byebye, NULL, RUNLEVEL_BEFORE_EXIT); |
/* graphic card Initialization */ |
if (grx_init() < 1) { |
/demos/trunk/base/sched.c |
---|
34,7 → 34,7 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* |
* |
* CVS : $Id: sched.c,v 1.1 2002-11-11 08:22:46 pj Exp $ |
* CVS : $Id: sched.c,v 1.2 2003-01-07 17:10:15 pj Exp $ |
This demo is derived from the cbsmouse.c Hartik's example. |
306,8 → 306,6 |
HARD_TASK_MODEL m_per; |
int modenum; |
set_exchandler_grx(); |
if (argc>=3) |
switch(*argv[2]) { |
case 'h': |
/demos/trunk/base/fly.c |
---|
18,11 → 18,11 |
/** |
------------ |
CVS : $Id: fly.c,v 1.2 2002-10-28 08:11:29 pj Exp $ |
CVS : $Id: fly.c,v 1.3 2003-01-07 17:10:15 pj Exp $ |
File: $File$ |
Revision: $Revision: 1.2 $ |
Last update: $Date: 2002-10-28 08:11:29 $ |
Revision: $Revision: 1.3 $ |
Last update: $Date: 2003-01-07 17:10:15 $ |
------------ |
**/ |
160,9 → 160,6 |
int i = 0; /* number of tasks created */ |
TIME seme; /* used to init the random seed */ |
/* Set the exception handler */ |
set_exchandler_grx(); |
/* Set the closing function */ |
sys_atrunlevel(byebye, NULL, RUNLEVEL_BEFORE_EXIT); |
/demos/trunk/base/pcdemo.c |
---|
34,7 → 34,7 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* |
* |
* CVS : $Id: pcdemo.c,v 1.1 2002-11-11 08:22:46 pj Exp $ |
* CVS : $Id: pcdemo.c,v 1.2 2003-01-07 17:10:15 pj Exp $ |
This test verify the correctness of the PC module. |
142,6 → 142,8 |
KEY_EVT emerg; |
clear(); |
cprintf("Priority Ceiling demo. Press Alt-X to exit the demo\n"); |
//keyb_set_map(itaMap); |
/demos/trunk/base/srpdemo.c |
---|
34,7 → 34,7 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* |
* |
* CVS : $Id: srpdemo.c,v 1.1 2002-11-11 08:22:46 pj Exp $ |
* CVS : $Id: srpdemo.c,v 1.2 2003-01-07 17:10:16 pj Exp $ |
This test verify the correctness of the SRP module. |
173,6 → 173,8 |
KEY_EVT emerg; |
clear(); |
cprintf("Stack resource Policy demo. Press Alt-X to exit the demo\n"); |
//keyb_set_map(itaMap); |
/demos/trunk/base/ego.c |
---|
18,11 → 18,11 |
/** |
------------ |
CVS : $Id: ego.c,v 1.2 2002-10-28 08:11:29 pj Exp $ |
CVS : $Id: ego.c,v 1.3 2003-01-07 17:10:15 pj Exp $ |
File: $File$ |
Revision: $Revision: 1.2 $ |
Last update: $Date: 2002-10-28 08:11:29 $ |
Revision: $Revision: 1.3 $ |
Last update: $Date: 2003-01-07 17:10:15 $ |
------------ |
**/ |
111,32 → 111,6 |
/****************************************************************/ |
/* This is the exception handler. It is called when an exception |
is raised. |
It exits from the graphical mode, then it prints a message and |
shutdown the kernel using sys_abort() |
*/ |
void demo_exc_handler(int signo, siginfo_t *info, void *extra) |
{ |
struct timespec t; |
grx_close(); |
/* Default action for an kern exception is */ |
kern_cli(); |
ll_gettime(TIME_EXACT, &t), |
cprintf("\nS.Ha.R.K. Exception raised!!!" |
"\nTime (s:ns) :%ld:%ld" |
"\nException number:%d (numbers in include/bits/errno.h)" |
"\nPID :%d\n", |
t.tv_sec, t.tv_nsec, info->si_value.sival_int, |
info->si_task); |
sys_abort(1); |
} |
/******************************************************************/ |
/* This function is called when Alt-X is pressed. |
It simply shutdown the system using sys_end. |
Note that the byebye() function is called only if we exit from |
176,21 → 150,9 |
PID pid1, pid2, pid3; |
KEY_EVT emerg; |
HARD_TASK_MODEL m1, m2, m3; |
struct sigaction action; |
/* Init the standard S.Ha.R.K. exception handler */ |
action.sa_flags = SA_SIGINFO; /* Set the signal action */ |
action.sa_sigaction = demo_exc_handler; |
action.sa_handler = 0; |
sigfillset(&action.sa_mask); /* we block all the other signals... */ |
if (sigaction(SIGHEXC, &action, NULL) == -1) { /* set the signal */ |
perror("Error initializing signals..."); |
sys_end(); |
} |
/* Set the closing function */ |
sys_atrunlevel(byebye, NULL, RUNLEVEL_BEFORE_EXIT|NO_AT_ABORT); |
sys_atrunlevel(byebye, NULL, RUNLEVEL_BEFORE_EXIT); |
/* Initializes the semaphore */ |
sem_init(&mutex,0,1); |
/demos/trunk/base/preempt.c |
---|
34,7 → 34,7 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* |
* |
* CVS : $Id: preempt.c,v 1.1 2002-11-11 08:22:46 pj Exp $ |
* CVS : $Id: preempt.c,v 1.2 2003-01-07 17:10:15 pj Exp $ |
CBS test with preemption disabling |
53,6 → 53,8 |
task_endcycle(); |
} |
cprintf("Periodic: Task %d end.\n", exec_shadow); |
return 0; |
} |
/demos/trunk/base/pidemo.c |
---|
34,7 → 34,7 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* |
* |
* CVS : $Id: pidemo.c,v 1.1 2002-11-11 08:22:46 pj Exp $ |
* CVS : $Id: pidemo.c,v 1.2 2003-01-07 17:10:15 pj Exp $ |
This test verify the correctness of the PI module. |
79,8 → 79,6 |
PI_mutexattr_t a; |
set_exchandler_grx(); |
hard_task_default_model(m); |
hard_task_def_mit(m,50000); |
hard_task_def_wcet(m,20000); |
/demos/trunk/base/aster.c |
---|
34,7 → 34,7 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* |
* |
* CVS : $Id: aster.c,v 1.1 2002-11-11 08:22:45 pj Exp $ |
* CVS : $Id: aster.c,v 1.2 2003-01-07 17:10:15 pj Exp $ |
Author: Gerardo Lamastra |
Giuseppe Lipari |
259,7 → 259,7 |
c = keyb_getchar(); |
if (c == ESC) { |
esc = TRUE; |
task_sleep(); |
task_endcycle(); |
} |
else { |
#ifdef __VPAGING__ |
302,11 → 302,6 |
sys_end(); |
} |
void res(void *arg) |
{ |
sys_status(CLOCK_STATUS|SCHED_STATUS); |
} |
int main(int argc, char **argv) |
{ |
PID p1,p2,p3,p4,p5,p6; |
319,8 → 314,6 |
// double rif; |
struct timespec t; |
sys_atrunlevel(res, NULL, RUNLEVEL_BEFORE_EXIT); |
//keyb_set_map(itaMap); |
emerg.ascii = 'x'; |
emerg.scan = KEY_X; |
398,10 → 391,7 |
group_activate(1); |
while (!esc) { |
kern_cli(); |
ll_gettime(TIME_EXACT,&t); |
kern_sti(); |
sys_gettime(&t); |
printf_xy(0,21,WHITE,"Clock : %-9ds %-9dns",(int)t.tv_sec, (int)t.tv_nsec); |
} |
/demos/trunk/base/sig.c |
---|
18,11 → 18,11 |
/** |
------------ |
CVS : $Id: sig.c,v 1.2 2002-11-11 08:20:44 pj Exp $ |
CVS : $Id: sig.c,v 1.3 2003-01-07 17:10:15 pj Exp $ |
File: $File$ |
Revision: $Revision: 1.2 $ |
Last update: $Date: 2002-11-11 08:20:44 $ |
Revision: $Revision: 1.3 $ |
Last update: $Date: 2003-01-07 17:10:15 $ |
------------ |
**/ |
81,14 → 81,19 |
return 0; |
} |
void catchit(int signo, siginfo_t *info, void *extra) |
void catchit_RT(int signo, siginfo_t *info, void *extra) |
{ |
cprintf("Current Running Task = %d signo=%d code=%d value=%d from pid=%d\n", |
cprintf("RT signal: Current Running Task = %d signo=%d code=%d value=%d from pid=%d\n", |
exec_shadow, |
info->si_signo, info->si_code, |
info->si_value.sival_int, info->si_task); |
} |
void catchit(int signo) |
{ |
cprintf("RT signal: Current Running Task = %d signo=%d\n", |
exec_shadow, signo); |
} |
int main(int argc, char **argv) |
{ |
105,7 → 110,7 |
/* Set the signal action */ |
action.sa_flags = SA_SIGINFO; |
action.sa_sigaction = catchit; |
action.sa_sigaction = catchit_RT; |
action.sa_handler = 0; |
action.sa_mask = 0; |