2005-10-20 22:29:52 +02:00
|
|
|
#include "inc.h"
|
2010-01-14 16:24:16 +01:00
|
|
|
#include "store.h"
|
2005-10-20 22:29:52 +02:00
|
|
|
|
|
|
|
/* Allocate space for the data store. */
|
|
|
|
PRIVATE struct data_store ds_store[NR_DS_KEYS];
|
2006-07-13 16:50:23 +02:00
|
|
|
PRIVATE struct subscription ds_subs[NR_DS_SUBS];
|
2005-10-20 22:29:52 +02:00
|
|
|
|
2010-01-14 16:24:16 +01:00
|
|
|
/*===========================================================================*
|
|
|
|
* alloc_data_slot *
|
|
|
|
*===========================================================================*/
|
|
|
|
PRIVATE struct data_store *alloc_data_slot(void)
|
|
|
|
{
|
|
|
|
/* Allocate a new data slot. */
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < NR_DS_KEYS; i++) {
|
|
|
|
if (!(ds_store[i].flags & DSF_IN_USE))
|
|
|
|
return &ds_store[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* alloc_sub_slot *
|
|
|
|
*===========================================================================*/
|
|
|
|
PRIVATE struct subscription *alloc_sub_slot(void)
|
|
|
|
{
|
|
|
|
/* Allocate a new subscription slot. */
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < NR_DS_SUBS; i++) {
|
|
|
|
if (!(ds_subs[i].flags & DSF_IN_USE))
|
|
|
|
return &ds_subs[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* lookup_entry *
|
|
|
|
*===========================================================================*/
|
|
|
|
PRIVATE struct data_store *lookup_entry(const char *key_name, int type)
|
|
|
|
{
|
|
|
|
/* Lookup an existing entry by key and type. */
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < NR_DS_KEYS; i++) {
|
|
|
|
if ((ds_store[i].flags & DSF_IN_USE) /* used */
|
|
|
|
&& (ds_store[i].flags & type) /* same type*/
|
|
|
|
&& !strcmp(ds_store[i].key, key_name)) /* same key*/
|
|
|
|
return &ds_store[i];
|
|
|
|
}
|
2005-10-20 22:29:52 +02:00
|
|
|
|
2010-01-14 16:24:16 +01:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* lookup_label_entry *
|
|
|
|
*===========================================================================*/
|
|
|
|
PRIVATE struct data_store *lookup_label_entry(unsigned num)
|
|
|
|
{
|
|
|
|
/* Lookup an existing label entry by num. */
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < NR_DS_KEYS; i++) {
|
|
|
|
if ((ds_store[i].flags & DSF_IN_USE)
|
|
|
|
&& (ds_store[i].flags & DSF_TYPE_LABEL)
|
|
|
|
&& (ds_store[i].u.u32 == num))
|
|
|
|
return &ds_store[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* lookup_sub *
|
|
|
|
*===========================================================================*/
|
|
|
|
PRIVATE struct subscription *lookup_sub(const char *owner)
|
|
|
|
{
|
|
|
|
/* Lookup an existing subscription given its owner. */
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < NR_DS_SUBS; i++) {
|
|
|
|
if ((ds_subs[i].flags & DSF_IN_USE) /* used */
|
|
|
|
&& !strcmp(ds_subs[i].owner, owner)) /* same key*/
|
|
|
|
return &ds_subs[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* ds_getprocname *
|
|
|
|
*===========================================================================*/
|
|
|
|
PRIVATE char *ds_getprocname(endpoint_t e)
|
|
|
|
{
|
|
|
|
/* Get a process name given its endpoint. */
|
|
|
|
struct data_store *dsp;
|
|
|
|
|
|
|
|
static char *first_proc_name = "ds";
|
|
|
|
endpoint_t first_proc_ep = DS_PROC_NR;
|
|
|
|
|
|
|
|
if(e == first_proc_ep)
|
|
|
|
return first_proc_name;
|
|
|
|
|
|
|
|
if((dsp = lookup_label_entry(e)) != NULL)
|
|
|
|
return dsp->key;
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* ds_getprocep *
|
|
|
|
*===========================================================================*/
|
2010-03-30 16:07:15 +02:00
|
|
|
PRIVATE endpoint_t ds_getprocep(const char *s)
|
2010-01-14 16:24:16 +01:00
|
|
|
{
|
|
|
|
/* Get a process endpoint given its name. */
|
|
|
|
struct data_store *dsp;
|
|
|
|
|
|
|
|
if((dsp = lookup_entry(s, DSF_TYPE_LABEL)) != NULL)
|
|
|
|
return dsp->u.u32;
|
2010-03-30 16:07:15 +02:00
|
|
|
return (endpoint_t) -1;
|
2010-01-14 16:24:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* check_auth *
|
|
|
|
*===========================================================================*/
|
2010-04-07 13:25:51 +02:00
|
|
|
PRIVATE int check_auth(const struct data_store *p, endpoint_t ep, int perm)
|
2010-01-14 16:24:16 +01:00
|
|
|
{
|
|
|
|
/* Check authorization for a given type of permission. */
|
New RS and new signal handling for system processes.
UPDATING INFO:
20100317:
/usr/src/etc/system.conf updated to ignore default kernel calls: copy
it (or merge it) to /etc/system.conf.
The hello driver (/dev/hello) added to the distribution:
# cd /usr/src/commands/scripts && make clean install
# cd /dev && MAKEDEV hello
KERNEL CHANGES:
- Generic signal handling support. The kernel no longer assumes PM as a signal
manager for every process. The signal manager of a given process can now be
specified in its privilege slot. When a signal has to be delivered, the kernel
performs the lookup and forwards the signal to the appropriate signal manager.
PM is the default signal manager for user processes, RS is the default signal
manager for system processes. To enable ptrace()ing for system processes, it
is sufficient to change the default signal manager to PM. This will temporarily
disable crash recovery, though.
- sys_exit() is now split into sys_exit() (i.e. exit() for system processes,
which generates a self-termination signal), and sys_clear() (i.e. used by PM
to ask the kernel to clear a process slot when a process exits).
- Added a new kernel call (i.e. sys_update()) to swap two process slots and
implement live update.
PM CHANGES:
- Posix signal handling is no longer allowed for system processes. System
signals are split into two fixed categories: termination and non-termination
signals. When a non-termination signaled is processed, PM transforms the signal
into an IPC message and delivers the message to the system process. When a
termination signal is processed, PM terminates the process.
- PM no longer assumes itself as the signal manager for system processes. It now
makes sure that every system signal goes through the kernel before being
actually processes. The kernel will then dispatch the signal to the appropriate
signal manager which may or may not be PM.
SYSLIB CHANGES:
- Simplified SEF init and LU callbacks.
- Added additional predefined SEF callbacks to debug crash recovery and
live update.
- Fixed a temporary ack in the SEF init protocol. SEF init reply is now
completely synchronous.
- Added SEF signal event type to provide a uniform interface for system
processes to deal with signals. A sef_cb_signal_handler() callback is
available for system processes to handle every received signal. A
sef_cb_signal_manager() callback is used by signal managers to process
system signals on behalf of the kernel.
- Fixed a few bugs with memory mapping and DS.
VM CHANGES:
- Page faults and memory requests coming from the kernel are now implemented
using signals.
- Added a new VM call to swap two process slots and implement live update.
- The call is used by RS at update time and in turn invokes the kernel call
sys_update().
RS CHANGES:
- RS has been reworked with a better functional decomposition.
- Better kernel call masks. com.h now defines the set of very basic kernel calls
every system service is allowed to use. This makes system.conf simpler and
easier to maintain. In addition, this guarantees a higher level of isolation
for system libraries that use one or more kernel calls internally (e.g. printf).
- RS is the default signal manager for system processes. By default, RS
intercepts every signal delivered to every system process. This makes crash
recovery possible before bringing PM and friends in the loop.
- RS now supports fast rollback when something goes wrong while initializing
the new version during a live update.
- Live update is now implemented by keeping the two versions side-by-side and
swapping the process slots when the old version is ready to update.
- Crash recovery is now implemented by keeping the two versions side-by-side
and cleaning up the old version only when the recovery process is complete.
DS CHANGES:
- Fixed a bug when the process doing ds_publish() or ds_delete() is not known
by DS.
- Fixed the completely broken support for strings. String publishing is now
implemented in the system library and simply wraps publishing of memory ranges.
Ideally, we should adopt a similar approach for other data types as well.
- Test suite fixed.
DRIVER CHANGES:
- The hello driver has been added to the Minix distribution to demonstrate basic
live update and crash recovery functionalities.
- Other drivers have been adapted to conform the new SEF interface.
2010-03-17 02:15:29 +01:00
|
|
|
char *source;
|
|
|
|
|
2010-01-14 16:24:16 +01:00
|
|
|
if(!(p->flags & perm))
|
|
|
|
return 1;
|
|
|
|
|
New RS and new signal handling for system processes.
UPDATING INFO:
20100317:
/usr/src/etc/system.conf updated to ignore default kernel calls: copy
it (or merge it) to /etc/system.conf.
The hello driver (/dev/hello) added to the distribution:
# cd /usr/src/commands/scripts && make clean install
# cd /dev && MAKEDEV hello
KERNEL CHANGES:
- Generic signal handling support. The kernel no longer assumes PM as a signal
manager for every process. The signal manager of a given process can now be
specified in its privilege slot. When a signal has to be delivered, the kernel
performs the lookup and forwards the signal to the appropriate signal manager.
PM is the default signal manager for user processes, RS is the default signal
manager for system processes. To enable ptrace()ing for system processes, it
is sufficient to change the default signal manager to PM. This will temporarily
disable crash recovery, though.
- sys_exit() is now split into sys_exit() (i.e. exit() for system processes,
which generates a self-termination signal), and sys_clear() (i.e. used by PM
to ask the kernel to clear a process slot when a process exits).
- Added a new kernel call (i.e. sys_update()) to swap two process slots and
implement live update.
PM CHANGES:
- Posix signal handling is no longer allowed for system processes. System
signals are split into two fixed categories: termination and non-termination
signals. When a non-termination signaled is processed, PM transforms the signal
into an IPC message and delivers the message to the system process. When a
termination signal is processed, PM terminates the process.
- PM no longer assumes itself as the signal manager for system processes. It now
makes sure that every system signal goes through the kernel before being
actually processes. The kernel will then dispatch the signal to the appropriate
signal manager which may or may not be PM.
SYSLIB CHANGES:
- Simplified SEF init and LU callbacks.
- Added additional predefined SEF callbacks to debug crash recovery and
live update.
- Fixed a temporary ack in the SEF init protocol. SEF init reply is now
completely synchronous.
- Added SEF signal event type to provide a uniform interface for system
processes to deal with signals. A sef_cb_signal_handler() callback is
available for system processes to handle every received signal. A
sef_cb_signal_manager() callback is used by signal managers to process
system signals on behalf of the kernel.
- Fixed a few bugs with memory mapping and DS.
VM CHANGES:
- Page faults and memory requests coming from the kernel are now implemented
using signals.
- Added a new VM call to swap two process slots and implement live update.
- The call is used by RS at update time and in turn invokes the kernel call
sys_update().
RS CHANGES:
- RS has been reworked with a better functional decomposition.
- Better kernel call masks. com.h now defines the set of very basic kernel calls
every system service is allowed to use. This makes system.conf simpler and
easier to maintain. In addition, this guarantees a higher level of isolation
for system libraries that use one or more kernel calls internally (e.g. printf).
- RS is the default signal manager for system processes. By default, RS
intercepts every signal delivered to every system process. This makes crash
recovery possible before bringing PM and friends in the loop.
- RS now supports fast rollback when something goes wrong while initializing
the new version during a live update.
- Live update is now implemented by keeping the two versions side-by-side and
swapping the process slots when the old version is ready to update.
- Crash recovery is now implemented by keeping the two versions side-by-side
and cleaning up the old version only when the recovery process is complete.
DS CHANGES:
- Fixed a bug when the process doing ds_publish() or ds_delete() is not known
by DS.
- Fixed the completely broken support for strings. String publishing is now
implemented in the system library and simply wraps publishing of memory ranges.
Ideally, we should adopt a similar approach for other data types as well.
- Test suite fixed.
DRIVER CHANGES:
- The hello driver has been added to the Minix distribution to demonstrate basic
live update and crash recovery functionalities.
- Other drivers have been adapted to conform the new SEF interface.
2010-03-17 02:15:29 +01:00
|
|
|
source = ds_getprocname(ep);
|
|
|
|
return source && !strcmp(p->owner, source);
|
2010-01-14 16:24:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* get_key_name *
|
|
|
|
*===========================================================================*/
|
2010-04-07 13:25:51 +02:00
|
|
|
PRIVATE int get_key_name(const message *m_ptr, char *key_name)
|
2010-01-14 16:24:16 +01:00
|
|
|
{
|
|
|
|
/* Get key name given an input message. */
|
|
|
|
int r;
|
|
|
|
|
|
|
|
if (m_ptr->DS_KEY_LEN > DS_MAX_KEYLEN || m_ptr->DS_KEY_LEN < 2) {
|
|
|
|
printf("DS: bogus key length (%d) from %d\n", m_ptr->DS_KEY_LEN,
|
|
|
|
m_ptr->m_source);
|
|
|
|
return EINVAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Copy name from caller. */
|
|
|
|
r = sys_safecopyfrom(m_ptr->m_source,
|
|
|
|
(cp_grant_id_t) m_ptr->DS_KEY_GRANT, 0,
|
|
|
|
(vir_bytes) key_name, m_ptr->DS_KEY_LEN, D);
|
|
|
|
if(r != OK) {
|
|
|
|
printf("DS: publish: copy failed from %d: %d\n", m_ptr->m_source, r);
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|
|
|
|
key_name[DS_MAX_KEYLEN-1] = '\0';
|
|
|
|
|
|
|
|
return OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* check_snapshot_index *
|
|
|
|
*===========================================================================*/
|
2010-04-07 13:25:51 +02:00
|
|
|
PRIVATE int check_snapshot_index(const struct data_store *dsp, int index)
|
2010-01-14 16:24:16 +01:00
|
|
|
{
|
|
|
|
/* See if the given snapshot index is valid. */
|
|
|
|
int min;
|
|
|
|
|
|
|
|
min = dsp->u.map.sindex < NR_DS_SNAPSHOT
|
|
|
|
? 0
|
|
|
|
: dsp->u.map.sindex - NR_DS_SNAPSHOT + 1;
|
|
|
|
|
|
|
|
return (index >= min && index <= dsp->u.map.sindex) ? 0 : 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* check_sub_match *
|
|
|
|
*===========================================================================*/
|
2010-04-07 13:25:51 +02:00
|
|
|
PRIVATE int check_sub_match(const struct subscription *subp,
|
2010-01-14 16:24:16 +01:00
|
|
|
struct data_store *dsp, endpoint_t ep)
|
|
|
|
{
|
|
|
|
/* Check if an entry matches a subscription. Return 1 in case of match. */
|
|
|
|
return (check_auth(dsp, ep, DSF_PRIV_SUBSCRIBE)
|
|
|
|
&& regexec(&subp->regex, dsp->key, 0, NULL, 0) == 0)
|
|
|
|
? 1 : 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* update_subscribers *
|
|
|
|
*===========================================================================*/
|
|
|
|
PRIVATE void update_subscribers(struct data_store *dsp, int set)
|
|
|
|
{
|
|
|
|
/* If set = 1, set bit in the sub bitmap of any subscription matching the given
|
|
|
|
* entry, otherwise clear it. In both cases, notify the subscriber.
|
|
|
|
*/
|
|
|
|
int i;
|
|
|
|
int nr = dsp - ds_store;
|
|
|
|
endpoint_t ep;
|
|
|
|
|
|
|
|
for(i = 0; i < NR_DS_SUBS; i++) {
|
|
|
|
if(!(ds_subs[i].flags & DSF_IN_USE))
|
|
|
|
continue;
|
|
|
|
if(!(ds_subs[i].flags & dsp->flags & DSF_MASK_TYPE))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
ep = ds_getprocep(ds_subs[i].owner);
|
|
|
|
if(!check_sub_match(&ds_subs[i], dsp, ep))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if(set == 1) {
|
|
|
|
SET_BIT(ds_subs[i].old_subs, nr);
|
|
|
|
} else {
|
|
|
|
UNSET_BIT(ds_subs[i].old_subs, nr);
|
|
|
|
}
|
|
|
|
notify(ep);
|
|
|
|
}
|
|
|
|
}
|
2005-10-20 22:29:52 +02:00
|
|
|
|
2010-02-09 16:23:38 +01:00
|
|
|
/*===========================================================================*
|
|
|
|
* map_service *
|
|
|
|
*===========================================================================*/
|
2010-04-07 13:25:51 +02:00
|
|
|
PRIVATE int map_service(const struct rprocpub *rpub)
|
2010-02-09 16:23:38 +01:00
|
|
|
{
|
|
|
|
/* Map a new service by registering its label. */
|
|
|
|
struct data_store *dsp;
|
|
|
|
|
|
|
|
/* Allocate a new data slot. */
|
|
|
|
if((dsp = alloc_data_slot()) == NULL) {
|
|
|
|
return ENOMEM;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Set attributes. */
|
|
|
|
strcpy(dsp->key, rpub->label);
|
|
|
|
dsp->u.u32 = (u32_t) rpub->endpoint;
|
New RS and new signal handling for system processes.
UPDATING INFO:
20100317:
/usr/src/etc/system.conf updated to ignore default kernel calls: copy
it (or merge it) to /etc/system.conf.
The hello driver (/dev/hello) added to the distribution:
# cd /usr/src/commands/scripts && make clean install
# cd /dev && MAKEDEV hello
KERNEL CHANGES:
- Generic signal handling support. The kernel no longer assumes PM as a signal
manager for every process. The signal manager of a given process can now be
specified in its privilege slot. When a signal has to be delivered, the kernel
performs the lookup and forwards the signal to the appropriate signal manager.
PM is the default signal manager for user processes, RS is the default signal
manager for system processes. To enable ptrace()ing for system processes, it
is sufficient to change the default signal manager to PM. This will temporarily
disable crash recovery, though.
- sys_exit() is now split into sys_exit() (i.e. exit() for system processes,
which generates a self-termination signal), and sys_clear() (i.e. used by PM
to ask the kernel to clear a process slot when a process exits).
- Added a new kernel call (i.e. sys_update()) to swap two process slots and
implement live update.
PM CHANGES:
- Posix signal handling is no longer allowed for system processes. System
signals are split into two fixed categories: termination and non-termination
signals. When a non-termination signaled is processed, PM transforms the signal
into an IPC message and delivers the message to the system process. When a
termination signal is processed, PM terminates the process.
- PM no longer assumes itself as the signal manager for system processes. It now
makes sure that every system signal goes through the kernel before being
actually processes. The kernel will then dispatch the signal to the appropriate
signal manager which may or may not be PM.
SYSLIB CHANGES:
- Simplified SEF init and LU callbacks.
- Added additional predefined SEF callbacks to debug crash recovery and
live update.
- Fixed a temporary ack in the SEF init protocol. SEF init reply is now
completely synchronous.
- Added SEF signal event type to provide a uniform interface for system
processes to deal with signals. A sef_cb_signal_handler() callback is
available for system processes to handle every received signal. A
sef_cb_signal_manager() callback is used by signal managers to process
system signals on behalf of the kernel.
- Fixed a few bugs with memory mapping and DS.
VM CHANGES:
- Page faults and memory requests coming from the kernel are now implemented
using signals.
- Added a new VM call to swap two process slots and implement live update.
- The call is used by RS at update time and in turn invokes the kernel call
sys_update().
RS CHANGES:
- RS has been reworked with a better functional decomposition.
- Better kernel call masks. com.h now defines the set of very basic kernel calls
every system service is allowed to use. This makes system.conf simpler and
easier to maintain. In addition, this guarantees a higher level of isolation
for system libraries that use one or more kernel calls internally (e.g. printf).
- RS is the default signal manager for system processes. By default, RS
intercepts every signal delivered to every system process. This makes crash
recovery possible before bringing PM and friends in the loop.
- RS now supports fast rollback when something goes wrong while initializing
the new version during a live update.
- Live update is now implemented by keeping the two versions side-by-side and
swapping the process slots when the old version is ready to update.
- Crash recovery is now implemented by keeping the two versions side-by-side
and cleaning up the old version only when the recovery process is complete.
DS CHANGES:
- Fixed a bug when the process doing ds_publish() or ds_delete() is not known
by DS.
- Fixed the completely broken support for strings. String publishing is now
implemented in the system library and simply wraps publishing of memory ranges.
Ideally, we should adopt a similar approach for other data types as well.
- Test suite fixed.
DRIVER CHANGES:
- The hello driver has been added to the Minix distribution to demonstrate basic
live update and crash recovery functionalities.
- Other drivers have been adapted to conform the new SEF interface.
2010-03-17 02:15:29 +01:00
|
|
|
strcpy(dsp->owner, "rs");
|
2010-02-09 16:23:38 +01:00
|
|
|
dsp->flags = DSF_IN_USE | DSF_TYPE_LABEL;
|
|
|
|
|
|
|
|
/* Update subscribers having a matching subscription. */
|
|
|
|
update_subscribers(dsp, 1);
|
|
|
|
|
|
|
|
return(OK);
|
|
|
|
}
|
|
|
|
|
2006-07-13 16:50:23 +02:00
|
|
|
/*===========================================================================*
|
Initialization protocol for system services.
SYSLIB CHANGES:
- SEF framework now supports a new SEF Init request type from RS. 3 different
callbacks are available (init_fresh, init_lu, init_restart) to specify
initialization code when a service starts fresh, starts after a live update,
or restarts.
SYSTEM SERVICE CHANGES:
- Initialization code for system services is now enclosed in a callback SEF will
automatically call at init time. The return code of the callback will
tell RS whether the initialization completed successfully.
- Each init callback can access information passed by RS to initialize. As of
now, each system service has access to the public entries of RS's system process
table to gather all the information required to initialize. This design
eliminates many existing or potential races at boot time and provides a uniform
initialization interface to system services. The same interface will be reused
for the upcoming publish/subscribe model to handle dynamic
registration / deregistration of system services.
VM CHANGES:
- Uniform privilege management for all system services. Every service uses the
same call mask format. For boot services, VM copies the call mask from init
data. For dynamic services, VM still receives the call mask via rs_set_priv
call that will be soon replaced by the upcoming publish/subscribe model.
RS CHANGES:
- The system process table has been reorganized and split into private entries
and public entries. Only the latter ones are exposed to system services.
- VM call masks are now entirely configured in rs/table.c
- RS has now its own slot in the system process table. Only kernel tasks and
user processes not included in the boot image are now left out from the system
process table.
- RS implements the initialization protocol for system services.
- For services in the boot image, RS blocks till initialization is complete and
panics when failure is reported back. Services are initialized in their order of
appearance in the boot image priv table and RS blocks to implements synchronous
initialization for every system service having the flag SF_SYNCH_BOOT set.
- For services started dynamically, the initialization protocol is implemented
as though it were the first ping for the service. In this case, if the
system service fails to report back (or reports failure), RS brings the service
down rather than trying to restart it.
2010-01-08 02:20:42 +01:00
|
|
|
* sef_cb_init_fresh *
|
2006-07-13 16:50:23 +02:00
|
|
|
*===========================================================================*/
|
Initialization protocol for system services.
SYSLIB CHANGES:
- SEF framework now supports a new SEF Init request type from RS. 3 different
callbacks are available (init_fresh, init_lu, init_restart) to specify
initialization code when a service starts fresh, starts after a live update,
or restarts.
SYSTEM SERVICE CHANGES:
- Initialization code for system services is now enclosed in a callback SEF will
automatically call at init time. The return code of the callback will
tell RS whether the initialization completed successfully.
- Each init callback can access information passed by RS to initialize. As of
now, each system service has access to the public entries of RS's system process
table to gather all the information required to initialize. This design
eliminates many existing or potential races at boot time and provides a uniform
initialization interface to system services. The same interface will be reused
for the upcoming publish/subscribe model to handle dynamic
registration / deregistration of system services.
VM CHANGES:
- Uniform privilege management for all system services. Every service uses the
same call mask format. For boot services, VM copies the call mask from init
data. For dynamic services, VM still receives the call mask via rs_set_priv
call that will be soon replaced by the upcoming publish/subscribe model.
RS CHANGES:
- The system process table has been reorganized and split into private entries
and public entries. Only the latter ones are exposed to system services.
- VM call masks are now entirely configured in rs/table.c
- RS has now its own slot in the system process table. Only kernel tasks and
user processes not included in the boot image are now left out from the system
process table.
- RS implements the initialization protocol for system services.
- For services in the boot image, RS blocks till initialization is complete and
panics when failure is reported back. Services are initialized in their order of
appearance in the boot image priv table and RS blocks to implements synchronous
initialization for every system service having the flag SF_SYNCH_BOOT set.
- For services started dynamically, the initialization protocol is implemented
as though it were the first ping for the service. In this case, if the
system service fails to report back (or reports failure), RS brings the service
down rather than trying to restart it.
2010-01-08 02:20:42 +01:00
|
|
|
PUBLIC int sef_cb_init_fresh(int type, sef_init_info_t *info)
|
2006-07-13 16:50:23 +02:00
|
|
|
{
|
Initialization protocol for system services.
SYSLIB CHANGES:
- SEF framework now supports a new SEF Init request type from RS. 3 different
callbacks are available (init_fresh, init_lu, init_restart) to specify
initialization code when a service starts fresh, starts after a live update,
or restarts.
SYSTEM SERVICE CHANGES:
- Initialization code for system services is now enclosed in a callback SEF will
automatically call at init time. The return code of the callback will
tell RS whether the initialization completed successfully.
- Each init callback can access information passed by RS to initialize. As of
now, each system service has access to the public entries of RS's system process
table to gather all the information required to initialize. This design
eliminates many existing or potential races at boot time and provides a uniform
initialization interface to system services. The same interface will be reused
for the upcoming publish/subscribe model to handle dynamic
registration / deregistration of system services.
VM CHANGES:
- Uniform privilege management for all system services. Every service uses the
same call mask format. For boot services, VM copies the call mask from init
data. For dynamic services, VM still receives the call mask via rs_set_priv
call that will be soon replaced by the upcoming publish/subscribe model.
RS CHANGES:
- The system process table has been reorganized and split into private entries
and public entries. Only the latter ones are exposed to system services.
- VM call masks are now entirely configured in rs/table.c
- RS has now its own slot in the system process table. Only kernel tasks and
user processes not included in the boot image are now left out from the system
process table.
- RS implements the initialization protocol for system services.
- For services in the boot image, RS blocks till initialization is complete and
panics when failure is reported back. Services are initialized in their order of
appearance in the boot image priv table and RS blocks to implements synchronous
initialization for every system service having the flag SF_SYNCH_BOOT set.
- For services started dynamically, the initialization protocol is implemented
as though it were the first ping for the service. In this case, if the
system service fails to report back (or reports failure), RS brings the service
down rather than trying to restart it.
2010-01-08 02:20:42 +01:00
|
|
|
/* Initialize the data store server. */
|
|
|
|
int i, r;
|
|
|
|
struct rprocpub rprocpub[NR_BOOT_PROCS];
|
2006-07-13 16:50:23 +02:00
|
|
|
|
|
|
|
/* Reset data store: data and subscriptions. */
|
|
|
|
for(i = 0; i < NR_DS_KEYS; i++) {
|
2010-01-14 16:24:16 +01:00
|
|
|
ds_store[i].flags = 0;
|
|
|
|
}
|
|
|
|
for(i = 0; i < NR_DS_SUBS; i++) {
|
|
|
|
ds_subs[i].flags = 0;
|
2006-07-13 16:50:23 +02:00
|
|
|
}
|
|
|
|
|
Initialization protocol for system services.
SYSLIB CHANGES:
- SEF framework now supports a new SEF Init request type from RS. 3 different
callbacks are available (init_fresh, init_lu, init_restart) to specify
initialization code when a service starts fresh, starts after a live update,
or restarts.
SYSTEM SERVICE CHANGES:
- Initialization code for system services is now enclosed in a callback SEF will
automatically call at init time. The return code of the callback will
tell RS whether the initialization completed successfully.
- Each init callback can access information passed by RS to initialize. As of
now, each system service has access to the public entries of RS's system process
table to gather all the information required to initialize. This design
eliminates many existing or potential races at boot time and provides a uniform
initialization interface to system services. The same interface will be reused
for the upcoming publish/subscribe model to handle dynamic
registration / deregistration of system services.
VM CHANGES:
- Uniform privilege management for all system services. Every service uses the
same call mask format. For boot services, VM copies the call mask from init
data. For dynamic services, VM still receives the call mask via rs_set_priv
call that will be soon replaced by the upcoming publish/subscribe model.
RS CHANGES:
- The system process table has been reorganized and split into private entries
and public entries. Only the latter ones are exposed to system services.
- VM call masks are now entirely configured in rs/table.c
- RS has now its own slot in the system process table. Only kernel tasks and
user processes not included in the boot image are now left out from the system
process table.
- RS implements the initialization protocol for system services.
- For services in the boot image, RS blocks till initialization is complete and
panics when failure is reported back. Services are initialized in their order of
appearance in the boot image priv table and RS blocks to implements synchronous
initialization for every system service having the flag SF_SYNCH_BOOT set.
- For services started dynamically, the initialization protocol is implemented
as though it were the first ping for the service. In this case, if the
system service fails to report back (or reports failure), RS brings the service
down rather than trying to restart it.
2010-01-08 02:20:42 +01:00
|
|
|
/* Map all the services in the boot image. */
|
|
|
|
if((r = sys_safecopyfrom(RS_PROC_NR, info->rproctab_gid, 0,
|
|
|
|
(vir_bytes) rprocpub, sizeof(rprocpub), S)) != OK) {
|
2010-03-05 16:05:11 +01:00
|
|
|
panic("sys_safecopyfrom failed: %d", r);
|
Initialization protocol for system services.
SYSLIB CHANGES:
- SEF framework now supports a new SEF Init request type from RS. 3 different
callbacks are available (init_fresh, init_lu, init_restart) to specify
initialization code when a service starts fresh, starts after a live update,
or restarts.
SYSTEM SERVICE CHANGES:
- Initialization code for system services is now enclosed in a callback SEF will
automatically call at init time. The return code of the callback will
tell RS whether the initialization completed successfully.
- Each init callback can access information passed by RS to initialize. As of
now, each system service has access to the public entries of RS's system process
table to gather all the information required to initialize. This design
eliminates many existing or potential races at boot time and provides a uniform
initialization interface to system services. The same interface will be reused
for the upcoming publish/subscribe model to handle dynamic
registration / deregistration of system services.
VM CHANGES:
- Uniform privilege management for all system services. Every service uses the
same call mask format. For boot services, VM copies the call mask from init
data. For dynamic services, VM still receives the call mask via rs_set_priv
call that will be soon replaced by the upcoming publish/subscribe model.
RS CHANGES:
- The system process table has been reorganized and split into private entries
and public entries. Only the latter ones are exposed to system services.
- VM call masks are now entirely configured in rs/table.c
- RS has now its own slot in the system process table. Only kernel tasks and
user processes not included in the boot image are now left out from the system
process table.
- RS implements the initialization protocol for system services.
- For services in the boot image, RS blocks till initialization is complete and
panics when failure is reported back. Services are initialized in their order of
appearance in the boot image priv table and RS blocks to implements synchronous
initialization for every system service having the flag SF_SYNCH_BOOT set.
- For services started dynamically, the initialization protocol is implemented
as though it were the first ping for the service. In this case, if the
system service fails to report back (or reports failure), RS brings the service
down rather than trying to restart it.
2010-01-08 02:20:42 +01:00
|
|
|
}
|
|
|
|
for(i=0;i < NR_BOOT_PROCS;i++) {
|
|
|
|
if(rprocpub[i].in_use) {
|
|
|
|
if((r = map_service(&rprocpub[i])) != OK) {
|
2010-03-05 16:05:11 +01:00
|
|
|
panic("unable to map service: %d", r);
|
Initialization protocol for system services.
SYSLIB CHANGES:
- SEF framework now supports a new SEF Init request type from RS. 3 different
callbacks are available (init_fresh, init_lu, init_restart) to specify
initialization code when a service starts fresh, starts after a live update,
or restarts.
SYSTEM SERVICE CHANGES:
- Initialization code for system services is now enclosed in a callback SEF will
automatically call at init time. The return code of the callback will
tell RS whether the initialization completed successfully.
- Each init callback can access information passed by RS to initialize. As of
now, each system service has access to the public entries of RS's system process
table to gather all the information required to initialize. This design
eliminates many existing or potential races at boot time and provides a uniform
initialization interface to system services. The same interface will be reused
for the upcoming publish/subscribe model to handle dynamic
registration / deregistration of system services.
VM CHANGES:
- Uniform privilege management for all system services. Every service uses the
same call mask format. For boot services, VM copies the call mask from init
data. For dynamic services, VM still receives the call mask via rs_set_priv
call that will be soon replaced by the upcoming publish/subscribe model.
RS CHANGES:
- The system process table has been reorganized and split into private entries
and public entries. Only the latter ones are exposed to system services.
- VM call masks are now entirely configured in rs/table.c
- RS has now its own slot in the system process table. Only kernel tasks and
user processes not included in the boot image are now left out from the system
process table.
- RS implements the initialization protocol for system services.
- For services in the boot image, RS blocks till initialization is complete and
panics when failure is reported back. Services are initialized in their order of
appearance in the boot image priv table and RS blocks to implements synchronous
initialization for every system service having the flag SF_SYNCH_BOOT set.
- For services started dynamically, the initialization protocol is implemented
as though it were the first ping for the service. In this case, if the
system service fails to report back (or reports failure), RS brings the service
down rather than trying to restart it.
2010-01-08 02:20:42 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return(OK);
|
|
|
|
}
|
|
|
|
|
2010-01-14 16:24:16 +01:00
|
|
|
/*===========================================================================*
|
|
|
|
* do_publish *
|
|
|
|
*===========================================================================*/
|
|
|
|
PUBLIC int do_publish(message *m_ptr)
|
2005-10-20 22:29:52 +02:00
|
|
|
{
|
|
|
|
struct data_store *dsp;
|
2006-07-13 16:50:23 +02:00
|
|
|
char key_name[DS_MAX_KEYLEN];
|
New RS and new signal handling for system processes.
UPDATING INFO:
20100317:
/usr/src/etc/system.conf updated to ignore default kernel calls: copy
it (or merge it) to /etc/system.conf.
The hello driver (/dev/hello) added to the distribution:
# cd /usr/src/commands/scripts && make clean install
# cd /dev && MAKEDEV hello
KERNEL CHANGES:
- Generic signal handling support. The kernel no longer assumes PM as a signal
manager for every process. The signal manager of a given process can now be
specified in its privilege slot. When a signal has to be delivered, the kernel
performs the lookup and forwards the signal to the appropriate signal manager.
PM is the default signal manager for user processes, RS is the default signal
manager for system processes. To enable ptrace()ing for system processes, it
is sufficient to change the default signal manager to PM. This will temporarily
disable crash recovery, though.
- sys_exit() is now split into sys_exit() (i.e. exit() for system processes,
which generates a self-termination signal), and sys_clear() (i.e. used by PM
to ask the kernel to clear a process slot when a process exits).
- Added a new kernel call (i.e. sys_update()) to swap two process slots and
implement live update.
PM CHANGES:
- Posix signal handling is no longer allowed for system processes. System
signals are split into two fixed categories: termination and non-termination
signals. When a non-termination signaled is processed, PM transforms the signal
into an IPC message and delivers the message to the system process. When a
termination signal is processed, PM terminates the process.
- PM no longer assumes itself as the signal manager for system processes. It now
makes sure that every system signal goes through the kernel before being
actually processes. The kernel will then dispatch the signal to the appropriate
signal manager which may or may not be PM.
SYSLIB CHANGES:
- Simplified SEF init and LU callbacks.
- Added additional predefined SEF callbacks to debug crash recovery and
live update.
- Fixed a temporary ack in the SEF init protocol. SEF init reply is now
completely synchronous.
- Added SEF signal event type to provide a uniform interface for system
processes to deal with signals. A sef_cb_signal_handler() callback is
available for system processes to handle every received signal. A
sef_cb_signal_manager() callback is used by signal managers to process
system signals on behalf of the kernel.
- Fixed a few bugs with memory mapping and DS.
VM CHANGES:
- Page faults and memory requests coming from the kernel are now implemented
using signals.
- Added a new VM call to swap two process slots and implement live update.
- The call is used by RS at update time and in turn invokes the kernel call
sys_update().
RS CHANGES:
- RS has been reworked with a better functional decomposition.
- Better kernel call masks. com.h now defines the set of very basic kernel calls
every system service is allowed to use. This makes system.conf simpler and
easier to maintain. In addition, this guarantees a higher level of isolation
for system libraries that use one or more kernel calls internally (e.g. printf).
- RS is the default signal manager for system processes. By default, RS
intercepts every signal delivered to every system process. This makes crash
recovery possible before bringing PM and friends in the loop.
- RS now supports fast rollback when something goes wrong while initializing
the new version during a live update.
- Live update is now implemented by keeping the two versions side-by-side and
swapping the process slots when the old version is ready to update.
- Crash recovery is now implemented by keeping the two versions side-by-side
and cleaning up the old version only when the recovery process is complete.
DS CHANGES:
- Fixed a bug when the process doing ds_publish() or ds_delete() is not known
by DS.
- Fixed the completely broken support for strings. String publishing is now
implemented in the system library and simply wraps publishing of memory ranges.
Ideally, we should adopt a similar approach for other data types as well.
- Test suite fixed.
DRIVER CHANGES:
- The hello driver has been added to the Minix distribution to demonstrate basic
live update and crash recovery functionalities.
- Other drivers have been adapted to conform the new SEF interface.
2010-03-17 02:15:29 +01:00
|
|
|
char *source;
|
2010-01-14 16:24:16 +01:00
|
|
|
int flags = m_ptr->DS_FLAGS;
|
|
|
|
size_t length;
|
2010-01-22 23:01:08 +01:00
|
|
|
int r;
|
2005-10-20 22:29:52 +02:00
|
|
|
|
New RS and new signal handling for system processes.
UPDATING INFO:
20100317:
/usr/src/etc/system.conf updated to ignore default kernel calls: copy
it (or merge it) to /etc/system.conf.
The hello driver (/dev/hello) added to the distribution:
# cd /usr/src/commands/scripts && make clean install
# cd /dev && MAKEDEV hello
KERNEL CHANGES:
- Generic signal handling support. The kernel no longer assumes PM as a signal
manager for every process. The signal manager of a given process can now be
specified in its privilege slot. When a signal has to be delivered, the kernel
performs the lookup and forwards the signal to the appropriate signal manager.
PM is the default signal manager for user processes, RS is the default signal
manager for system processes. To enable ptrace()ing for system processes, it
is sufficient to change the default signal manager to PM. This will temporarily
disable crash recovery, though.
- sys_exit() is now split into sys_exit() (i.e. exit() for system processes,
which generates a self-termination signal), and sys_clear() (i.e. used by PM
to ask the kernel to clear a process slot when a process exits).
- Added a new kernel call (i.e. sys_update()) to swap two process slots and
implement live update.
PM CHANGES:
- Posix signal handling is no longer allowed for system processes. System
signals are split into two fixed categories: termination and non-termination
signals. When a non-termination signaled is processed, PM transforms the signal
into an IPC message and delivers the message to the system process. When a
termination signal is processed, PM terminates the process.
- PM no longer assumes itself as the signal manager for system processes. It now
makes sure that every system signal goes through the kernel before being
actually processes. The kernel will then dispatch the signal to the appropriate
signal manager which may or may not be PM.
SYSLIB CHANGES:
- Simplified SEF init and LU callbacks.
- Added additional predefined SEF callbacks to debug crash recovery and
live update.
- Fixed a temporary ack in the SEF init protocol. SEF init reply is now
completely synchronous.
- Added SEF signal event type to provide a uniform interface for system
processes to deal with signals. A sef_cb_signal_handler() callback is
available for system processes to handle every received signal. A
sef_cb_signal_manager() callback is used by signal managers to process
system signals on behalf of the kernel.
- Fixed a few bugs with memory mapping and DS.
VM CHANGES:
- Page faults and memory requests coming from the kernel are now implemented
using signals.
- Added a new VM call to swap two process slots and implement live update.
- The call is used by RS at update time and in turn invokes the kernel call
sys_update().
RS CHANGES:
- RS has been reworked with a better functional decomposition.
- Better kernel call masks. com.h now defines the set of very basic kernel calls
every system service is allowed to use. This makes system.conf simpler and
easier to maintain. In addition, this guarantees a higher level of isolation
for system libraries that use one or more kernel calls internally (e.g. printf).
- RS is the default signal manager for system processes. By default, RS
intercepts every signal delivered to every system process. This makes crash
recovery possible before bringing PM and friends in the loop.
- RS now supports fast rollback when something goes wrong while initializing
the new version during a live update.
- Live update is now implemented by keeping the two versions side-by-side and
swapping the process slots when the old version is ready to update.
- Crash recovery is now implemented by keeping the two versions side-by-side
and cleaning up the old version only when the recovery process is complete.
DS CHANGES:
- Fixed a bug when the process doing ds_publish() or ds_delete() is not known
by DS.
- Fixed the completely broken support for strings. String publishing is now
implemented in the system library and simply wraps publishing of memory ranges.
Ideally, we should adopt a similar approach for other data types as well.
- Test suite fixed.
DRIVER CHANGES:
- The hello driver has been added to the Minix distribution to demonstrate basic
live update and crash recovery functionalities.
- Other drivers have been adapted to conform the new SEF interface.
2010-03-17 02:15:29 +01:00
|
|
|
/* Lookup the source. */
|
|
|
|
source = ds_getprocname(m_ptr->m_source);
|
|
|
|
if(source == NULL)
|
|
|
|
return EPERM;
|
|
|
|
|
2010-04-08 15:41:35 +02:00
|
|
|
/* Only RS can publish labels. */
|
|
|
|
if((flags & DSF_TYPE_LABEL) && m_ptr->m_source != RS_PROC_NR)
|
|
|
|
return EPERM;
|
|
|
|
|
2010-01-14 16:24:16 +01:00
|
|
|
/* MAP should not be overwritten. */
|
|
|
|
if((flags & DSF_TYPE_MAP) && (flags & DSF_OVERWRITE))
|
2006-07-13 16:50:23 +02:00
|
|
|
return EINVAL;
|
|
|
|
|
2010-01-14 16:24:16 +01:00
|
|
|
/* Get key name. */
|
|
|
|
if((r = get_key_name(m_ptr, key_name)) != OK)
|
2006-07-13 16:50:23 +02:00
|
|
|
return r;
|
2010-01-14 16:24:16 +01:00
|
|
|
|
|
|
|
/* Lookup the entry. */
|
|
|
|
dsp = lookup_entry(key_name, flags & DSF_MASK_TYPE);
|
|
|
|
/* If type is LABEL, also try to lookup the entry by num. */
|
|
|
|
if((flags & DSF_TYPE_LABEL) && (dsp == NULL))
|
|
|
|
dsp = lookup_label_entry(m_ptr->DS_VAL);
|
|
|
|
|
|
|
|
if(dsp == NULL) {
|
|
|
|
/* The entry doesn't exist, allocate a new data slot. */
|
|
|
|
if((dsp = alloc_data_slot()) == NULL)
|
|
|
|
return ENOMEM;
|
|
|
|
} else if (flags & DSF_OVERWRITE) {
|
|
|
|
/* Overwrite. */
|
|
|
|
if(!check_auth(dsp, m_ptr->m_source, DSF_PRIV_OVERWRITE))
|
|
|
|
return EPERM;
|
|
|
|
} else {
|
|
|
|
/* Don't overwrite and return error. */
|
|
|
|
return EEXIST;
|
2006-07-13 16:50:23 +02:00
|
|
|
}
|
|
|
|
|
2010-01-14 16:24:16 +01:00
|
|
|
/* Store! */
|
|
|
|
switch(flags & DSF_MASK_TYPE) {
|
|
|
|
case DSF_TYPE_U32:
|
|
|
|
case DSF_TYPE_LABEL:
|
|
|
|
dsp->u.u32 = m_ptr->DS_VAL;
|
|
|
|
break;
|
|
|
|
case DSF_TYPE_STR:
|
|
|
|
case DSF_TYPE_MEM:
|
|
|
|
length = m_ptr->DS_VAL_LEN;
|
|
|
|
/* Allocate a new data buffer if necessary. */
|
|
|
|
if(!(dsp->flags & DSF_IN_USE)) {
|
|
|
|
if((dsp->u.mem.data = malloc(length)) == NULL)
|
|
|
|
return ENOMEM;
|
|
|
|
dsp->u.mem.reallen = length;
|
|
|
|
} else if(length > dsp->u.mem.reallen) {
|
|
|
|
free(dsp->u.mem.data);
|
|
|
|
if((dsp->u.mem.data = malloc(length)) == NULL)
|
|
|
|
return ENOMEM;
|
|
|
|
dsp->u.mem.reallen = length;
|
|
|
|
}
|
2006-07-13 16:50:23 +02:00
|
|
|
|
2010-01-14 16:24:16 +01:00
|
|
|
/* Copy the memory range. */
|
2010-03-03 00:12:13 +01:00
|
|
|
r = sys_safecopyfrom(m_ptr->m_source, (cp_grant_id_t) m_ptr->DS_VAL,
|
|
|
|
0, (vir_bytes) dsp->u.mem.data, length, D);
|
2010-01-14 16:24:16 +01:00
|
|
|
if(r != OK) {
|
|
|
|
printf("DS: publish: memory map/copy failed from %d: %d\n",
|
|
|
|
m_ptr->m_source, r);
|
|
|
|
free(dsp->u.mem.data);
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
dsp->u.mem.length = length;
|
New RS and new signal handling for system processes.
UPDATING INFO:
20100317:
/usr/src/etc/system.conf updated to ignore default kernel calls: copy
it (or merge it) to /etc/system.conf.
The hello driver (/dev/hello) added to the distribution:
# cd /usr/src/commands/scripts && make clean install
# cd /dev && MAKEDEV hello
KERNEL CHANGES:
- Generic signal handling support. The kernel no longer assumes PM as a signal
manager for every process. The signal manager of a given process can now be
specified in its privilege slot. When a signal has to be delivered, the kernel
performs the lookup and forwards the signal to the appropriate signal manager.
PM is the default signal manager for user processes, RS is the default signal
manager for system processes. To enable ptrace()ing for system processes, it
is sufficient to change the default signal manager to PM. This will temporarily
disable crash recovery, though.
- sys_exit() is now split into sys_exit() (i.e. exit() for system processes,
which generates a self-termination signal), and sys_clear() (i.e. used by PM
to ask the kernel to clear a process slot when a process exits).
- Added a new kernel call (i.e. sys_update()) to swap two process slots and
implement live update.
PM CHANGES:
- Posix signal handling is no longer allowed for system processes. System
signals are split into two fixed categories: termination and non-termination
signals. When a non-termination signaled is processed, PM transforms the signal
into an IPC message and delivers the message to the system process. When a
termination signal is processed, PM terminates the process.
- PM no longer assumes itself as the signal manager for system processes. It now
makes sure that every system signal goes through the kernel before being
actually processes. The kernel will then dispatch the signal to the appropriate
signal manager which may or may not be PM.
SYSLIB CHANGES:
- Simplified SEF init and LU callbacks.
- Added additional predefined SEF callbacks to debug crash recovery and
live update.
- Fixed a temporary ack in the SEF init protocol. SEF init reply is now
completely synchronous.
- Added SEF signal event type to provide a uniform interface for system
processes to deal with signals. A sef_cb_signal_handler() callback is
available for system processes to handle every received signal. A
sef_cb_signal_manager() callback is used by signal managers to process
system signals on behalf of the kernel.
- Fixed a few bugs with memory mapping and DS.
VM CHANGES:
- Page faults and memory requests coming from the kernel are now implemented
using signals.
- Added a new VM call to swap two process slots and implement live update.
- The call is used by RS at update time and in turn invokes the kernel call
sys_update().
RS CHANGES:
- RS has been reworked with a better functional decomposition.
- Better kernel call masks. com.h now defines the set of very basic kernel calls
every system service is allowed to use. This makes system.conf simpler and
easier to maintain. In addition, this guarantees a higher level of isolation
for system libraries that use one or more kernel calls internally (e.g. printf).
- RS is the default signal manager for system processes. By default, RS
intercepts every signal delivered to every system process. This makes crash
recovery possible before bringing PM and friends in the loop.
- RS now supports fast rollback when something goes wrong while initializing
the new version during a live update.
- Live update is now implemented by keeping the two versions side-by-side and
swapping the process slots when the old version is ready to update.
- Crash recovery is now implemented by keeping the two versions side-by-side
and cleaning up the old version only when the recovery process is complete.
DS CHANGES:
- Fixed a bug when the process doing ds_publish() or ds_delete() is not known
by DS.
- Fixed the completely broken support for strings. String publishing is now
implemented in the system library and simply wraps publishing of memory ranges.
Ideally, we should adopt a similar approach for other data types as well.
- Test suite fixed.
DRIVER CHANGES:
- The hello driver has been added to the Minix distribution to demonstrate basic
live update and crash recovery functionalities.
- Other drivers have been adapted to conform the new SEF interface.
2010-03-17 02:15:29 +01:00
|
|
|
if(flags & DSF_TYPE_STR) {
|
|
|
|
((char*)dsp->u.mem.data)[length-1] = '\0';
|
|
|
|
}
|
2010-01-14 16:24:16 +01:00
|
|
|
break;
|
|
|
|
case DSF_TYPE_MAP:
|
|
|
|
/* Allocate buffer, the address should be aligned by CLICK_SIZE. */
|
|
|
|
length = m_ptr->DS_VAL_LEN;
|
|
|
|
if((dsp->u.map.realpointer = malloc(length + CLICK_SIZE)) == NULL)
|
|
|
|
return ENOMEM;
|
|
|
|
dsp->u.map.data = (void*) CLICK_CEIL(dsp->u.map.realpointer);
|
|
|
|
|
|
|
|
/* Map memory. */
|
2010-03-03 00:12:13 +01:00
|
|
|
r = sys_safemap(m_ptr->m_source, (cp_grant_id_t) m_ptr->DS_VAL, 0,
|
2010-01-14 16:24:16 +01:00
|
|
|
(vir_bytes) dsp->u.map.data, length, D, 0);
|
|
|
|
if(r != OK) {
|
|
|
|
printf("DS: publish: memory map/copy failed from %d: %d\n",
|
|
|
|
m_ptr->m_source, r);
|
|
|
|
free(dsp->u.map.realpointer);
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
dsp->u.map.length = length;
|
|
|
|
dsp->u.map.sindex = -1;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return EINVAL;
|
2005-10-20 22:29:52 +02:00
|
|
|
}
|
|
|
|
|
2010-01-14 16:24:16 +01:00
|
|
|
/* Set attributes. */
|
|
|
|
strcpy(dsp->key, key_name);
|
New RS and new signal handling for system processes.
UPDATING INFO:
20100317:
/usr/src/etc/system.conf updated to ignore default kernel calls: copy
it (or merge it) to /etc/system.conf.
The hello driver (/dev/hello) added to the distribution:
# cd /usr/src/commands/scripts && make clean install
# cd /dev && MAKEDEV hello
KERNEL CHANGES:
- Generic signal handling support. The kernel no longer assumes PM as a signal
manager for every process. The signal manager of a given process can now be
specified in its privilege slot. When a signal has to be delivered, the kernel
performs the lookup and forwards the signal to the appropriate signal manager.
PM is the default signal manager for user processes, RS is the default signal
manager for system processes. To enable ptrace()ing for system processes, it
is sufficient to change the default signal manager to PM. This will temporarily
disable crash recovery, though.
- sys_exit() is now split into sys_exit() (i.e. exit() for system processes,
which generates a self-termination signal), and sys_clear() (i.e. used by PM
to ask the kernel to clear a process slot when a process exits).
- Added a new kernel call (i.e. sys_update()) to swap two process slots and
implement live update.
PM CHANGES:
- Posix signal handling is no longer allowed for system processes. System
signals are split into two fixed categories: termination and non-termination
signals. When a non-termination signaled is processed, PM transforms the signal
into an IPC message and delivers the message to the system process. When a
termination signal is processed, PM terminates the process.
- PM no longer assumes itself as the signal manager for system processes. It now
makes sure that every system signal goes through the kernel before being
actually processes. The kernel will then dispatch the signal to the appropriate
signal manager which may or may not be PM.
SYSLIB CHANGES:
- Simplified SEF init and LU callbacks.
- Added additional predefined SEF callbacks to debug crash recovery and
live update.
- Fixed a temporary ack in the SEF init protocol. SEF init reply is now
completely synchronous.
- Added SEF signal event type to provide a uniform interface for system
processes to deal with signals. A sef_cb_signal_handler() callback is
available for system processes to handle every received signal. A
sef_cb_signal_manager() callback is used by signal managers to process
system signals on behalf of the kernel.
- Fixed a few bugs with memory mapping and DS.
VM CHANGES:
- Page faults and memory requests coming from the kernel are now implemented
using signals.
- Added a new VM call to swap two process slots and implement live update.
- The call is used by RS at update time and in turn invokes the kernel call
sys_update().
RS CHANGES:
- RS has been reworked with a better functional decomposition.
- Better kernel call masks. com.h now defines the set of very basic kernel calls
every system service is allowed to use. This makes system.conf simpler and
easier to maintain. In addition, this guarantees a higher level of isolation
for system libraries that use one or more kernel calls internally (e.g. printf).
- RS is the default signal manager for system processes. By default, RS
intercepts every signal delivered to every system process. This makes crash
recovery possible before bringing PM and friends in the loop.
- RS now supports fast rollback when something goes wrong while initializing
the new version during a live update.
- Live update is now implemented by keeping the two versions side-by-side and
swapping the process slots when the old version is ready to update.
- Crash recovery is now implemented by keeping the two versions side-by-side
and cleaning up the old version only when the recovery process is complete.
DS CHANGES:
- Fixed a bug when the process doing ds_publish() or ds_delete() is not known
by DS.
- Fixed the completely broken support for strings. String publishing is now
implemented in the system library and simply wraps publishing of memory ranges.
Ideally, we should adopt a similar approach for other data types as well.
- Test suite fixed.
DRIVER CHANGES:
- The hello driver has been added to the Minix distribution to demonstrate basic
live update and crash recovery functionalities.
- Other drivers have been adapted to conform the new SEF interface.
2010-03-17 02:15:29 +01:00
|
|
|
strcpy(dsp->owner, source);
|
2010-01-14 16:24:16 +01:00
|
|
|
dsp->flags = DSF_IN_USE | (flags & DSF_MASK_INTERNAL);
|
2005-10-20 22:29:52 +02:00
|
|
|
|
2010-01-14 16:24:16 +01:00
|
|
|
/* Update subscribers having a matching subscription. */
|
|
|
|
update_subscribers(dsp, 1);
|
2006-07-13 16:50:23 +02:00
|
|
|
|
2005-10-20 22:29:52 +02:00
|
|
|
return(OK);
|
|
|
|
}
|
|
|
|
|
2006-07-13 16:50:23 +02:00
|
|
|
/*===========================================================================*
|
|
|
|
* do_retrieve *
|
|
|
|
*===========================================================================*/
|
2010-01-14 16:24:16 +01:00
|
|
|
PUBLIC int do_retrieve(message *m_ptr)
|
2005-10-20 22:29:52 +02:00
|
|
|
{
|
|
|
|
struct data_store *dsp;
|
2006-07-13 16:50:23 +02:00
|
|
|
char key_name[DS_MAX_KEYLEN];
|
2010-01-14 16:24:16 +01:00
|
|
|
int flags = m_ptr->DS_FLAGS;
|
|
|
|
int type = flags & DSF_MASK_TYPE;
|
|
|
|
size_t length;
|
|
|
|
void *data;
|
|
|
|
int index, r;
|
|
|
|
|
|
|
|
/* Get key name. */
|
|
|
|
if((r = get_key_name(m_ptr, key_name)) != OK)
|
2006-07-13 16:50:23 +02:00
|
|
|
return r;
|
|
|
|
|
2010-01-14 16:24:16 +01:00
|
|
|
/* Lookup the entry. */
|
|
|
|
if((dsp = lookup_entry(key_name, type)) == NULL)
|
|
|
|
return ESRCH;
|
|
|
|
if(!check_auth(dsp, m_ptr->m_source, DSF_PRIV_RETRIEVE))
|
|
|
|
return EPERM;
|
2006-07-13 16:50:23 +02:00
|
|
|
|
2010-01-14 16:24:16 +01:00
|
|
|
/* Copy the requested data. */
|
|
|
|
switch(type) {
|
|
|
|
case DSF_TYPE_U32:
|
|
|
|
case DSF_TYPE_LABEL:
|
|
|
|
m_ptr->DS_VAL = dsp->u.u32;
|
|
|
|
break;
|
|
|
|
case DSF_TYPE_STR:
|
|
|
|
case DSF_TYPE_MEM:
|
|
|
|
length = MIN(m_ptr->DS_VAL_LEN, dsp->u.mem.length);
|
2010-03-03 00:12:13 +01:00
|
|
|
r = sys_safecopyto(m_ptr->m_source, (cp_grant_id_t) m_ptr->DS_VAL, 0,
|
2010-01-14 16:24:16 +01:00
|
|
|
(vir_bytes) dsp->u.mem.data, length, D);
|
|
|
|
if(r != OK) {
|
|
|
|
printf("DS: retrieve: copy failed to %d: %d\n",
|
|
|
|
m_ptr->m_source, r);
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
m_ptr->DS_VAL_LEN = length;
|
|
|
|
break;
|
|
|
|
case DSF_TYPE_MAP:
|
|
|
|
/* The caller requested to map a mapped memory range.
|
|
|
|
* Create a MAP grant for the caller, the caller will do the
|
|
|
|
* safemap itself later.
|
|
|
|
*/
|
|
|
|
if(flags & DSMF_MAP_MAPPED) {
|
|
|
|
cp_grant_id_t gid;
|
|
|
|
gid = cpf_grant_direct(m_ptr->m_source,
|
|
|
|
(vir_bytes)dsp->u.map.data,
|
|
|
|
dsp->u.map.length,
|
|
|
|
CPF_READ|CPF_WRITE|CPF_MAP);
|
|
|
|
if(!GRANT_VALID(gid))
|
|
|
|
return -1;
|
|
|
|
m_ptr->DS_VAL = gid;
|
2010-01-27 11:23:58 +01:00
|
|
|
m_ptr->DS_VAL_LEN = dsp->u.map.length;
|
2010-01-14 16:24:16 +01:00
|
|
|
}
|
2005-10-20 22:29:52 +02:00
|
|
|
|
2010-01-14 16:24:16 +01:00
|
|
|
/* The caller requested a copy of a mapped mem range or a snapshot. */
|
|
|
|
else if(flags & (DSMF_COPY_MAPPED|DSMF_COPY_SNAPSHOT)) {
|
|
|
|
if(flags & DSMF_COPY_MAPPED) {
|
|
|
|
data = dsp->u.map.data;
|
|
|
|
} else {
|
|
|
|
index = m_ptr->DS_NR_SNAPSHOT;
|
|
|
|
if(check_snapshot_index(dsp, index))
|
|
|
|
return EINVAL;
|
|
|
|
data = dsp->u.map.snapshots[index % NR_DS_SNAPSHOT];
|
|
|
|
}
|
|
|
|
|
|
|
|
length = MIN(m_ptr->DS_VAL_LEN, dsp->u.map.length);
|
2010-03-03 00:12:13 +01:00
|
|
|
r = sys_safecopyto(m_ptr->m_source,
|
|
|
|
(cp_grant_id_t) m_ptr->DS_VAL, (vir_bytes) 0,
|
2010-01-14 16:24:16 +01:00
|
|
|
(vir_bytes) data, length, D);
|
|
|
|
if(r != OK) {
|
2006-07-13 16:50:23 +02:00
|
|
|
printf("DS: retrieve: copy failed to %d: %d\n",
|
|
|
|
m_ptr->m_source, r);
|
|
|
|
return r;
|
|
|
|
}
|
2010-01-14 16:24:16 +01:00
|
|
|
m_ptr->DS_VAL_LEN = length;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
return EINVAL;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return EINVAL;
|
2005-10-20 22:29:52 +02:00
|
|
|
}
|
2010-01-14 16:24:16 +01:00
|
|
|
|
|
|
|
return OK;
|
2005-10-20 22:29:52 +02:00
|
|
|
}
|
|
|
|
|
2006-07-13 16:50:23 +02:00
|
|
|
/*===========================================================================*
|
2010-01-14 16:24:16 +01:00
|
|
|
* do_retrieve_label *
|
2006-07-13 16:50:23 +02:00
|
|
|
*===========================================================================*/
|
2010-04-07 13:25:51 +02:00
|
|
|
PUBLIC int do_retrieve_label(const message *m_ptr)
|
2006-07-13 16:50:23 +02:00
|
|
|
{
|
2010-01-14 16:24:16 +01:00
|
|
|
struct data_store *dsp;
|
|
|
|
int r;
|
|
|
|
|
|
|
|
/* Lookup the label entry. */
|
|
|
|
if((dsp = lookup_label_entry(m_ptr->DS_VAL)) == NULL)
|
|
|
|
return ESRCH;
|
|
|
|
|
|
|
|
/* Copy the key name. */
|
|
|
|
r = sys_safecopyto(m_ptr->m_source,
|
2010-03-03 00:12:13 +01:00
|
|
|
(cp_grant_id_t) m_ptr->DS_KEY_GRANT, (vir_bytes) 0,
|
2010-01-14 16:24:16 +01:00
|
|
|
(vir_bytes) dsp->key, strlen(dsp->key) + 1, D);
|
|
|
|
if(r != OK) {
|
|
|
|
printf("DS: copy failed from %d: %d\n", m_ptr->m_source, r);
|
|
|
|
return r;
|
|
|
|
}
|
2006-07-13 16:50:23 +02:00
|
|
|
|
2010-01-14 16:24:16 +01:00
|
|
|
return OK;
|
2006-07-13 16:50:23 +02:00
|
|
|
}
|
2005-10-20 22:29:52 +02:00
|
|
|
|
2010-01-14 16:24:16 +01:00
|
|
|
/*===========================================================================*
|
|
|
|
* do_subscribe *
|
|
|
|
*===========================================================================*/
|
|
|
|
PUBLIC int do_subscribe(message *m_ptr)
|
2005-10-20 22:29:52 +02:00
|
|
|
{
|
2006-07-13 16:50:23 +02:00
|
|
|
char regex[DS_MAX_KEYLEN+3];
|
2010-01-14 16:24:16 +01:00
|
|
|
struct subscription *subp;
|
2006-07-13 16:50:23 +02:00
|
|
|
char errbuf[80];
|
2010-01-14 16:24:16 +01:00
|
|
|
char *owner;
|
|
|
|
int type_set;
|
|
|
|
int r, e, b;
|
|
|
|
|
|
|
|
/* Find the owner. */
|
|
|
|
owner = ds_getprocname(m_ptr->m_source);
|
|
|
|
if(owner == NULL)
|
|
|
|
return ESRCH;
|
|
|
|
|
|
|
|
/* See if the owner already has an existing subscription. */
|
|
|
|
if((subp = lookup_sub(owner)) == NULL) {
|
|
|
|
/* The subscription doesn't exist, allocate a new one. */
|
|
|
|
if((subp = alloc_sub_slot()) == NULL)
|
|
|
|
return EAGAIN;
|
|
|
|
} else if(!(m_ptr->DS_FLAGS & DSF_OVERWRITE)) {
|
|
|
|
/* The subscription exists but we can't overwrite, return error. */
|
|
|
|
return EEXIST;
|
|
|
|
}
|
2006-07-13 16:50:23 +02:00
|
|
|
|
2010-01-14 16:24:16 +01:00
|
|
|
/* Copy key name from the caller. Anchor the subscription with "^regexp$" so
|
|
|
|
* substrings don't match. The caller will probably not expect this,
|
2006-07-13 16:50:23 +02:00
|
|
|
* and the usual case is for a complete match.
|
|
|
|
*/
|
|
|
|
regex[0] = '^';
|
2010-01-14 16:24:16 +01:00
|
|
|
if((r = get_key_name(m_ptr, regex)) != OK)
|
|
|
|
return r;
|
2006-07-13 16:50:23 +02:00
|
|
|
regex[DS_MAX_KEYLEN-1] = '\0';
|
|
|
|
strcat(regex, "$");
|
|
|
|
|
2010-01-14 16:24:16 +01:00
|
|
|
/* Compile regular expression. */
|
|
|
|
if((e=regcomp(&subp->regex, regex, REG_EXTENDED)) != 0) {
|
|
|
|
regerror(e, &subp->regex, errbuf, sizeof(errbuf));
|
|
|
|
printf("DS: subscribe: regerror: %s\n", errbuf);
|
|
|
|
return EINVAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If type_set = 0, then subscribe all types. */
|
|
|
|
type_set = m_ptr->DS_FLAGS & DSF_MASK_TYPE;
|
|
|
|
if(type_set == 0)
|
|
|
|
type_set = DSF_MASK_TYPE;
|
|
|
|
|
|
|
|
subp->flags = DSF_IN_USE | type_set;
|
|
|
|
strcpy(subp->owner, owner);
|
2010-02-24 11:39:58 +01:00
|
|
|
for(b = 0; b < BITMAP_CHUNKS(NR_DS_KEYS); b++)
|
2010-01-14 16:24:16 +01:00
|
|
|
subp->old_subs[b] = 0;
|
|
|
|
|
|
|
|
/* See if caller requested an instant initial list. */
|
|
|
|
if(m_ptr->DS_FLAGS & DSF_INITIAL) {
|
|
|
|
int i, match_found = FALSE;
|
|
|
|
for(i = 0; i < NR_DS_KEYS; i++) {
|
|
|
|
if(!(ds_store[i].flags & DSF_IN_USE))
|
|
|
|
continue;
|
|
|
|
if(!(ds_store[i].flags & type_set))
|
|
|
|
continue;
|
|
|
|
if(!check_sub_match(subp, &ds_store[i], m_ptr->m_source))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
SET_BIT(subp->old_subs, i);
|
|
|
|
match_found = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Notify in case of match. */
|
|
|
|
if(match_found)
|
|
|
|
notify(m_ptr->m_source);
|
|
|
|
}
|
|
|
|
|
|
|
|
return OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* do_check *
|
|
|
|
*===========================================================================*/
|
|
|
|
PUBLIC int do_check(message *m_ptr)
|
|
|
|
{
|
|
|
|
struct subscription *subp;
|
|
|
|
char *owner;
|
2010-04-08 15:41:35 +02:00
|
|
|
endpoint_t entry_owner_e;
|
2010-01-14 16:24:16 +01:00
|
|
|
int r, i;
|
|
|
|
|
2010-04-08 15:41:35 +02:00
|
|
|
/* Find the subscription owner. */
|
2010-01-14 16:24:16 +01:00
|
|
|
owner = ds_getprocname(m_ptr->m_source);
|
|
|
|
if(owner == NULL)
|
|
|
|
return ESRCH;
|
|
|
|
|
|
|
|
/* Lookup the owner's subscription. */
|
|
|
|
if((subp = lookup_sub(owner)) == NULL)
|
|
|
|
return ESRCH;
|
|
|
|
|
|
|
|
/* Look for an updated entry the subscriber is interested in. */
|
|
|
|
for(i = 0; i < NR_DS_KEYS; i++) {
|
|
|
|
if(GET_BIT(subp->old_subs, i))
|
2006-07-13 16:50:23 +02:00
|
|
|
break;
|
2010-01-14 16:24:16 +01:00
|
|
|
}
|
|
|
|
if(i == NR_DS_KEYS)
|
|
|
|
return ENOENT;
|
2006-07-13 16:50:23 +02:00
|
|
|
|
2010-01-14 16:24:16 +01:00
|
|
|
/* Copy the key name. */
|
|
|
|
r = sys_safecopyto(m_ptr->m_source,
|
2010-03-03 00:12:13 +01:00
|
|
|
(cp_grant_id_t) m_ptr->DS_KEY_GRANT, (vir_bytes) 0,
|
2010-04-08 15:41:35 +02:00
|
|
|
(vir_bytes) ds_store[i].key, strlen(ds_store[i].key) + 1, D);
|
2010-01-14 16:24:16 +01:00
|
|
|
if(r != OK) {
|
|
|
|
printf("DS: check: copy failed from %d: %d\n", m_ptr->m_source, r);
|
|
|
|
return r;
|
2006-07-13 16:50:23 +02:00
|
|
|
}
|
|
|
|
|
2010-04-08 15:41:35 +02:00
|
|
|
/* Copy the type and the owner of the original entry. */
|
|
|
|
entry_owner_e = ds_getprocep(ds_store[i].owner);
|
|
|
|
if(entry_owner_e == -1) {
|
|
|
|
panic("ds_getprocep failed");
|
|
|
|
}
|
2010-01-14 16:24:16 +01:00
|
|
|
m_ptr->DS_FLAGS = ds_store[i].flags & DSF_MASK_TYPE;
|
2010-04-08 15:41:35 +02:00
|
|
|
m_ptr->DS_OWNER = entry_owner_e;
|
2010-01-14 16:24:16 +01:00
|
|
|
|
|
|
|
/* Mark the entry as no longer updated for the subscriber. */
|
|
|
|
UNSET_BIT(subp->old_subs, i);
|
|
|
|
|
|
|
|
return OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* do_delete *
|
|
|
|
*===========================================================================*/
|
|
|
|
PUBLIC int do_delete(message *m_ptr)
|
|
|
|
{
|
|
|
|
struct data_store *dsp;
|
|
|
|
char key_name[DS_MAX_KEYLEN];
|
New RS and new signal handling for system processes.
UPDATING INFO:
20100317:
/usr/src/etc/system.conf updated to ignore default kernel calls: copy
it (or merge it) to /etc/system.conf.
The hello driver (/dev/hello) added to the distribution:
# cd /usr/src/commands/scripts && make clean install
# cd /dev && MAKEDEV hello
KERNEL CHANGES:
- Generic signal handling support. The kernel no longer assumes PM as a signal
manager for every process. The signal manager of a given process can now be
specified in its privilege slot. When a signal has to be delivered, the kernel
performs the lookup and forwards the signal to the appropriate signal manager.
PM is the default signal manager for user processes, RS is the default signal
manager for system processes. To enable ptrace()ing for system processes, it
is sufficient to change the default signal manager to PM. This will temporarily
disable crash recovery, though.
- sys_exit() is now split into sys_exit() (i.e. exit() for system processes,
which generates a self-termination signal), and sys_clear() (i.e. used by PM
to ask the kernel to clear a process slot when a process exits).
- Added a new kernel call (i.e. sys_update()) to swap two process slots and
implement live update.
PM CHANGES:
- Posix signal handling is no longer allowed for system processes. System
signals are split into two fixed categories: termination and non-termination
signals. When a non-termination signaled is processed, PM transforms the signal
into an IPC message and delivers the message to the system process. When a
termination signal is processed, PM terminates the process.
- PM no longer assumes itself as the signal manager for system processes. It now
makes sure that every system signal goes through the kernel before being
actually processes. The kernel will then dispatch the signal to the appropriate
signal manager which may or may not be PM.
SYSLIB CHANGES:
- Simplified SEF init and LU callbacks.
- Added additional predefined SEF callbacks to debug crash recovery and
live update.
- Fixed a temporary ack in the SEF init protocol. SEF init reply is now
completely synchronous.
- Added SEF signal event type to provide a uniform interface for system
processes to deal with signals. A sef_cb_signal_handler() callback is
available for system processes to handle every received signal. A
sef_cb_signal_manager() callback is used by signal managers to process
system signals on behalf of the kernel.
- Fixed a few bugs with memory mapping and DS.
VM CHANGES:
- Page faults and memory requests coming from the kernel are now implemented
using signals.
- Added a new VM call to swap two process slots and implement live update.
- The call is used by RS at update time and in turn invokes the kernel call
sys_update().
RS CHANGES:
- RS has been reworked with a better functional decomposition.
- Better kernel call masks. com.h now defines the set of very basic kernel calls
every system service is allowed to use. This makes system.conf simpler and
easier to maintain. In addition, this guarantees a higher level of isolation
for system libraries that use one or more kernel calls internally (e.g. printf).
- RS is the default signal manager for system processes. By default, RS
intercepts every signal delivered to every system process. This makes crash
recovery possible before bringing PM and friends in the loop.
- RS now supports fast rollback when something goes wrong while initializing
the new version during a live update.
- Live update is now implemented by keeping the two versions side-by-side and
swapping the process slots when the old version is ready to update.
- Crash recovery is now implemented by keeping the two versions side-by-side
and cleaning up the old version only when the recovery process is complete.
DS CHANGES:
- Fixed a bug when the process doing ds_publish() or ds_delete() is not known
by DS.
- Fixed the completely broken support for strings. String publishing is now
implemented in the system library and simply wraps publishing of memory ranges.
Ideally, we should adopt a similar approach for other data types as well.
- Test suite fixed.
DRIVER CHANGES:
- The hello driver has been added to the Minix distribution to demonstrate basic
live update and crash recovery functionalities.
- Other drivers have been adapted to conform the new SEF interface.
2010-03-17 02:15:29 +01:00
|
|
|
char *source;
|
2010-04-08 15:41:35 +02:00
|
|
|
char *label;
|
2010-01-14 16:24:16 +01:00
|
|
|
int type = m_ptr->DS_FLAGS & DSF_MASK_TYPE;
|
|
|
|
int top, i, r;
|
|
|
|
|
New RS and new signal handling for system processes.
UPDATING INFO:
20100317:
/usr/src/etc/system.conf updated to ignore default kernel calls: copy
it (or merge it) to /etc/system.conf.
The hello driver (/dev/hello) added to the distribution:
# cd /usr/src/commands/scripts && make clean install
# cd /dev && MAKEDEV hello
KERNEL CHANGES:
- Generic signal handling support. The kernel no longer assumes PM as a signal
manager for every process. The signal manager of a given process can now be
specified in its privilege slot. When a signal has to be delivered, the kernel
performs the lookup and forwards the signal to the appropriate signal manager.
PM is the default signal manager for user processes, RS is the default signal
manager for system processes. To enable ptrace()ing for system processes, it
is sufficient to change the default signal manager to PM. This will temporarily
disable crash recovery, though.
- sys_exit() is now split into sys_exit() (i.e. exit() for system processes,
which generates a self-termination signal), and sys_clear() (i.e. used by PM
to ask the kernel to clear a process slot when a process exits).
- Added a new kernel call (i.e. sys_update()) to swap two process slots and
implement live update.
PM CHANGES:
- Posix signal handling is no longer allowed for system processes. System
signals are split into two fixed categories: termination and non-termination
signals. When a non-termination signaled is processed, PM transforms the signal
into an IPC message and delivers the message to the system process. When a
termination signal is processed, PM terminates the process.
- PM no longer assumes itself as the signal manager for system processes. It now
makes sure that every system signal goes through the kernel before being
actually processes. The kernel will then dispatch the signal to the appropriate
signal manager which may or may not be PM.
SYSLIB CHANGES:
- Simplified SEF init and LU callbacks.
- Added additional predefined SEF callbacks to debug crash recovery and
live update.
- Fixed a temporary ack in the SEF init protocol. SEF init reply is now
completely synchronous.
- Added SEF signal event type to provide a uniform interface for system
processes to deal with signals. A sef_cb_signal_handler() callback is
available for system processes to handle every received signal. A
sef_cb_signal_manager() callback is used by signal managers to process
system signals on behalf of the kernel.
- Fixed a few bugs with memory mapping and DS.
VM CHANGES:
- Page faults and memory requests coming from the kernel are now implemented
using signals.
- Added a new VM call to swap two process slots and implement live update.
- The call is used by RS at update time and in turn invokes the kernel call
sys_update().
RS CHANGES:
- RS has been reworked with a better functional decomposition.
- Better kernel call masks. com.h now defines the set of very basic kernel calls
every system service is allowed to use. This makes system.conf simpler and
easier to maintain. In addition, this guarantees a higher level of isolation
for system libraries that use one or more kernel calls internally (e.g. printf).
- RS is the default signal manager for system processes. By default, RS
intercepts every signal delivered to every system process. This makes crash
recovery possible before bringing PM and friends in the loop.
- RS now supports fast rollback when something goes wrong while initializing
the new version during a live update.
- Live update is now implemented by keeping the two versions side-by-side and
swapping the process slots when the old version is ready to update.
- Crash recovery is now implemented by keeping the two versions side-by-side
and cleaning up the old version only when the recovery process is complete.
DS CHANGES:
- Fixed a bug when the process doing ds_publish() or ds_delete() is not known
by DS.
- Fixed the completely broken support for strings. String publishing is now
implemented in the system library and simply wraps publishing of memory ranges.
Ideally, we should adopt a similar approach for other data types as well.
- Test suite fixed.
DRIVER CHANGES:
- The hello driver has been added to the Minix distribution to demonstrate basic
live update and crash recovery functionalities.
- Other drivers have been adapted to conform the new SEF interface.
2010-03-17 02:15:29 +01:00
|
|
|
/* Lookup the source. */
|
|
|
|
source = ds_getprocname(m_ptr->m_source);
|
|
|
|
if(source == NULL)
|
|
|
|
return EPERM;
|
|
|
|
|
2010-01-14 16:24:16 +01:00
|
|
|
/* Get key name. */
|
|
|
|
if((r = get_key_name(m_ptr, key_name)) != OK)
|
|
|
|
return r;
|
|
|
|
|
|
|
|
/* Lookup the entry. */
|
|
|
|
if((dsp = lookup_entry(key_name, type)) == NULL)
|
|
|
|
return ESRCH;
|
|
|
|
|
|
|
|
/* Only the owner can delete. */
|
New RS and new signal handling for system processes.
UPDATING INFO:
20100317:
/usr/src/etc/system.conf updated to ignore default kernel calls: copy
it (or merge it) to /etc/system.conf.
The hello driver (/dev/hello) added to the distribution:
# cd /usr/src/commands/scripts && make clean install
# cd /dev && MAKEDEV hello
KERNEL CHANGES:
- Generic signal handling support. The kernel no longer assumes PM as a signal
manager for every process. The signal manager of a given process can now be
specified in its privilege slot. When a signal has to be delivered, the kernel
performs the lookup and forwards the signal to the appropriate signal manager.
PM is the default signal manager for user processes, RS is the default signal
manager for system processes. To enable ptrace()ing for system processes, it
is sufficient to change the default signal manager to PM. This will temporarily
disable crash recovery, though.
- sys_exit() is now split into sys_exit() (i.e. exit() for system processes,
which generates a self-termination signal), and sys_clear() (i.e. used by PM
to ask the kernel to clear a process slot when a process exits).
- Added a new kernel call (i.e. sys_update()) to swap two process slots and
implement live update.
PM CHANGES:
- Posix signal handling is no longer allowed for system processes. System
signals are split into two fixed categories: termination and non-termination
signals. When a non-termination signaled is processed, PM transforms the signal
into an IPC message and delivers the message to the system process. When a
termination signal is processed, PM terminates the process.
- PM no longer assumes itself as the signal manager for system processes. It now
makes sure that every system signal goes through the kernel before being
actually processes. The kernel will then dispatch the signal to the appropriate
signal manager which may or may not be PM.
SYSLIB CHANGES:
- Simplified SEF init and LU callbacks.
- Added additional predefined SEF callbacks to debug crash recovery and
live update.
- Fixed a temporary ack in the SEF init protocol. SEF init reply is now
completely synchronous.
- Added SEF signal event type to provide a uniform interface for system
processes to deal with signals. A sef_cb_signal_handler() callback is
available for system processes to handle every received signal. A
sef_cb_signal_manager() callback is used by signal managers to process
system signals on behalf of the kernel.
- Fixed a few bugs with memory mapping and DS.
VM CHANGES:
- Page faults and memory requests coming from the kernel are now implemented
using signals.
- Added a new VM call to swap two process slots and implement live update.
- The call is used by RS at update time and in turn invokes the kernel call
sys_update().
RS CHANGES:
- RS has been reworked with a better functional decomposition.
- Better kernel call masks. com.h now defines the set of very basic kernel calls
every system service is allowed to use. This makes system.conf simpler and
easier to maintain. In addition, this guarantees a higher level of isolation
for system libraries that use one or more kernel calls internally (e.g. printf).
- RS is the default signal manager for system processes. By default, RS
intercepts every signal delivered to every system process. This makes crash
recovery possible before bringing PM and friends in the loop.
- RS now supports fast rollback when something goes wrong while initializing
the new version during a live update.
- Live update is now implemented by keeping the two versions side-by-side and
swapping the process slots when the old version is ready to update.
- Crash recovery is now implemented by keeping the two versions side-by-side
and cleaning up the old version only when the recovery process is complete.
DS CHANGES:
- Fixed a bug when the process doing ds_publish() or ds_delete() is not known
by DS.
- Fixed the completely broken support for strings. String publishing is now
implemented in the system library and simply wraps publishing of memory ranges.
Ideally, we should adopt a similar approach for other data types as well.
- Test suite fixed.
DRIVER CHANGES:
- The hello driver has been added to the Minix distribution to demonstrate basic
live update and crash recovery functionalities.
- Other drivers have been adapted to conform the new SEF interface.
2010-03-17 02:15:29 +01:00
|
|
|
if(strcmp(dsp->owner, source))
|
2010-01-14 16:24:16 +01:00
|
|
|
return EPERM;
|
|
|
|
|
|
|
|
switch(type) {
|
|
|
|
case DSF_TYPE_U32:
|
2010-04-08 15:41:35 +02:00
|
|
|
break;
|
2010-01-14 16:24:16 +01:00
|
|
|
case DSF_TYPE_LABEL:
|
2010-04-08 15:41:35 +02:00
|
|
|
label = dsp->key;
|
|
|
|
|
|
|
|
/* Clean up subscriptions. */
|
|
|
|
for (i = 0; i < NR_DS_SUBS; i++) {
|
|
|
|
if ((ds_subs[i].flags & DSF_IN_USE)
|
|
|
|
&& !strcmp(ds_subs[i].owner, label)) {
|
|
|
|
ds_subs[i].flags = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Clean up data entries. */
|
|
|
|
for (i = 0; i < NR_DS_KEYS; i++) {
|
|
|
|
if ((ds_store[i].flags & DSF_IN_USE)
|
|
|
|
&& !strcmp(ds_store[i].owner, label)) {
|
|
|
|
ds_store[i].flags = 0;
|
|
|
|
}
|
|
|
|
}
|
2010-01-14 16:24:16 +01:00
|
|
|
break;
|
New RS and new signal handling for system processes.
UPDATING INFO:
20100317:
/usr/src/etc/system.conf updated to ignore default kernel calls: copy
it (or merge it) to /etc/system.conf.
The hello driver (/dev/hello) added to the distribution:
# cd /usr/src/commands/scripts && make clean install
# cd /dev && MAKEDEV hello
KERNEL CHANGES:
- Generic signal handling support. The kernel no longer assumes PM as a signal
manager for every process. The signal manager of a given process can now be
specified in its privilege slot. When a signal has to be delivered, the kernel
performs the lookup and forwards the signal to the appropriate signal manager.
PM is the default signal manager for user processes, RS is the default signal
manager for system processes. To enable ptrace()ing for system processes, it
is sufficient to change the default signal manager to PM. This will temporarily
disable crash recovery, though.
- sys_exit() is now split into sys_exit() (i.e. exit() for system processes,
which generates a self-termination signal), and sys_clear() (i.e. used by PM
to ask the kernel to clear a process slot when a process exits).
- Added a new kernel call (i.e. sys_update()) to swap two process slots and
implement live update.
PM CHANGES:
- Posix signal handling is no longer allowed for system processes. System
signals are split into two fixed categories: termination and non-termination
signals. When a non-termination signaled is processed, PM transforms the signal
into an IPC message and delivers the message to the system process. When a
termination signal is processed, PM terminates the process.
- PM no longer assumes itself as the signal manager for system processes. It now
makes sure that every system signal goes through the kernel before being
actually processes. The kernel will then dispatch the signal to the appropriate
signal manager which may or may not be PM.
SYSLIB CHANGES:
- Simplified SEF init and LU callbacks.
- Added additional predefined SEF callbacks to debug crash recovery and
live update.
- Fixed a temporary ack in the SEF init protocol. SEF init reply is now
completely synchronous.
- Added SEF signal event type to provide a uniform interface for system
processes to deal with signals. A sef_cb_signal_handler() callback is
available for system processes to handle every received signal. A
sef_cb_signal_manager() callback is used by signal managers to process
system signals on behalf of the kernel.
- Fixed a few bugs with memory mapping and DS.
VM CHANGES:
- Page faults and memory requests coming from the kernel are now implemented
using signals.
- Added a new VM call to swap two process slots and implement live update.
- The call is used by RS at update time and in turn invokes the kernel call
sys_update().
RS CHANGES:
- RS has been reworked with a better functional decomposition.
- Better kernel call masks. com.h now defines the set of very basic kernel calls
every system service is allowed to use. This makes system.conf simpler and
easier to maintain. In addition, this guarantees a higher level of isolation
for system libraries that use one or more kernel calls internally (e.g. printf).
- RS is the default signal manager for system processes. By default, RS
intercepts every signal delivered to every system process. This makes crash
recovery possible before bringing PM and friends in the loop.
- RS now supports fast rollback when something goes wrong while initializing
the new version during a live update.
- Live update is now implemented by keeping the two versions side-by-side and
swapping the process slots when the old version is ready to update.
- Crash recovery is now implemented by keeping the two versions side-by-side
and cleaning up the old version only when the recovery process is complete.
DS CHANGES:
- Fixed a bug when the process doing ds_publish() or ds_delete() is not known
by DS.
- Fixed the completely broken support for strings. String publishing is now
implemented in the system library and simply wraps publishing of memory ranges.
Ideally, we should adopt a similar approach for other data types as well.
- Test suite fixed.
DRIVER CHANGES:
- The hello driver has been added to the Minix distribution to demonstrate basic
live update and crash recovery functionalities.
- Other drivers have been adapted to conform the new SEF interface.
2010-03-17 02:15:29 +01:00
|
|
|
case DSF_TYPE_STR:
|
2010-01-14 16:24:16 +01:00
|
|
|
case DSF_TYPE_MEM:
|
|
|
|
free(dsp->u.mem.data);
|
|
|
|
break;
|
|
|
|
case DSF_TYPE_MAP:
|
|
|
|
/* Unmap the mapped data. */
|
|
|
|
r = sys_safeunmap(D, (vir_bytes)dsp->u.map.data);
|
|
|
|
if(r != OK)
|
New RS and new signal handling for system processes.
UPDATING INFO:
20100317:
/usr/src/etc/system.conf updated to ignore default kernel calls: copy
it (or merge it) to /etc/system.conf.
The hello driver (/dev/hello) added to the distribution:
# cd /usr/src/commands/scripts && make clean install
# cd /dev && MAKEDEV hello
KERNEL CHANGES:
- Generic signal handling support. The kernel no longer assumes PM as a signal
manager for every process. The signal manager of a given process can now be
specified in its privilege slot. When a signal has to be delivered, the kernel
performs the lookup and forwards the signal to the appropriate signal manager.
PM is the default signal manager for user processes, RS is the default signal
manager for system processes. To enable ptrace()ing for system processes, it
is sufficient to change the default signal manager to PM. This will temporarily
disable crash recovery, though.
- sys_exit() is now split into sys_exit() (i.e. exit() for system processes,
which generates a self-termination signal), and sys_clear() (i.e. used by PM
to ask the kernel to clear a process slot when a process exits).
- Added a new kernel call (i.e. sys_update()) to swap two process slots and
implement live update.
PM CHANGES:
- Posix signal handling is no longer allowed for system processes. System
signals are split into two fixed categories: termination and non-termination
signals. When a non-termination signaled is processed, PM transforms the signal
into an IPC message and delivers the message to the system process. When a
termination signal is processed, PM terminates the process.
- PM no longer assumes itself as the signal manager for system processes. It now
makes sure that every system signal goes through the kernel before being
actually processes. The kernel will then dispatch the signal to the appropriate
signal manager which may or may not be PM.
SYSLIB CHANGES:
- Simplified SEF init and LU callbacks.
- Added additional predefined SEF callbacks to debug crash recovery and
live update.
- Fixed a temporary ack in the SEF init protocol. SEF init reply is now
completely synchronous.
- Added SEF signal event type to provide a uniform interface for system
processes to deal with signals. A sef_cb_signal_handler() callback is
available for system processes to handle every received signal. A
sef_cb_signal_manager() callback is used by signal managers to process
system signals on behalf of the kernel.
- Fixed a few bugs with memory mapping and DS.
VM CHANGES:
- Page faults and memory requests coming from the kernel are now implemented
using signals.
- Added a new VM call to swap two process slots and implement live update.
- The call is used by RS at update time and in turn invokes the kernel call
sys_update().
RS CHANGES:
- RS has been reworked with a better functional decomposition.
- Better kernel call masks. com.h now defines the set of very basic kernel calls
every system service is allowed to use. This makes system.conf simpler and
easier to maintain. In addition, this guarantees a higher level of isolation
for system libraries that use one or more kernel calls internally (e.g. printf).
- RS is the default signal manager for system processes. By default, RS
intercepts every signal delivered to every system process. This makes crash
recovery possible before bringing PM and friends in the loop.
- RS now supports fast rollback when something goes wrong while initializing
the new version during a live update.
- Live update is now implemented by keeping the two versions side-by-side and
swapping the process slots when the old version is ready to update.
- Crash recovery is now implemented by keeping the two versions side-by-side
and cleaning up the old version only when the recovery process is complete.
DS CHANGES:
- Fixed a bug when the process doing ds_publish() or ds_delete() is not known
by DS.
- Fixed the completely broken support for strings. String publishing is now
implemented in the system library and simply wraps publishing of memory ranges.
Ideally, we should adopt a similar approach for other data types as well.
- Test suite fixed.
DRIVER CHANGES:
- The hello driver has been added to the Minix distribution to demonstrate basic
live update and crash recovery functionalities.
- Other drivers have been adapted to conform the new SEF interface.
2010-03-17 02:15:29 +01:00
|
|
|
printf("DS: sys_safeunmap failed. Grant already revoked?\n");
|
2010-01-14 16:24:16 +01:00
|
|
|
|
|
|
|
/* Revoke all the mapped grants. */
|
|
|
|
r = sys_saferevmap_addr((vir_bytes)dsp->u.map.data);
|
|
|
|
if(r != OK)
|
|
|
|
return r;
|
|
|
|
|
|
|
|
/* Free snapshots. */
|
|
|
|
top = MIN(NR_DS_SNAPSHOT - 1, dsp->u.map.sindex);
|
|
|
|
for(i = 0; i <= top; i++) {
|
|
|
|
free(dsp->u.map.snapshots[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
free(dsp->u.map.realpointer);
|
|
|
|
break;
|
|
|
|
default:
|
2006-07-13 16:50:23 +02:00
|
|
|
return EINVAL;
|
|
|
|
}
|
2010-01-14 16:24:16 +01:00
|
|
|
|
|
|
|
/* Update subscribers having a matching subscription. */
|
|
|
|
update_subscribers(dsp, 0);
|
|
|
|
|
|
|
|
/* Clear the entry. */
|
|
|
|
dsp->flags = 0;
|
|
|
|
|
|
|
|
return OK;
|
2005-10-20 22:29:52 +02:00
|
|
|
}
|
|
|
|
|
2010-01-14 16:24:16 +01:00
|
|
|
/*===========================================================================*
|
|
|
|
* do_snapshot *
|
|
|
|
*===========================================================================*/
|
|
|
|
PUBLIC int do_snapshot(message *m_ptr)
|
|
|
|
{
|
|
|
|
struct data_store *dsp;
|
|
|
|
struct dsi_map *p;
|
|
|
|
char key_name[DS_MAX_KEYLEN];
|
|
|
|
int i, r;
|
|
|
|
|
|
|
|
/* Get key name. */
|
|
|
|
if((r = get_key_name(m_ptr, key_name)) != OK)
|
|
|
|
return r;
|
|
|
|
|
|
|
|
/* Lookup the entry. */
|
|
|
|
if((dsp = lookup_entry(key_name, DSF_TYPE_MAP)) == NULL)
|
|
|
|
return ESRCH;
|
|
|
|
|
|
|
|
if(!check_auth(dsp, m_ptr->m_source, DSF_PRIV_SNAPSHOT))
|
|
|
|
return EPERM;
|
|
|
|
|
|
|
|
/* Find a snapshot slot. */
|
|
|
|
p = &dsp->u.map;
|
|
|
|
p->sindex++;
|
|
|
|
i = p->sindex % DS_MAX_KEYLEN;
|
|
|
|
if(p->sindex < DS_MAX_KEYLEN) {
|
|
|
|
if((p->snapshots[i] = malloc(p->length)) == NULL) {
|
|
|
|
p->sindex--;
|
|
|
|
return ENOMEM;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Store the snapshot. */
|
|
|
|
memcpy(p->snapshots[i], p->data, p->length);
|
|
|
|
|
|
|
|
/* Copy the snapshot index. */
|
|
|
|
m_ptr->DS_NR_SNAPSHOT = p->sindex;
|
|
|
|
|
|
|
|
return OK;
|
|
|
|
}
|
2005-10-20 22:29:52 +02:00
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* do_getsysinfo *
|
|
|
|
*===========================================================================*/
|
2010-04-07 13:25:51 +02:00
|
|
|
PUBLIC int do_getsysinfo(const message *m_ptr)
|
2005-10-20 22:29:52 +02:00
|
|
|
{
|
2010-01-14 16:24:16 +01:00
|
|
|
vir_bytes src_addr;
|
|
|
|
size_t length;
|
2005-10-20 22:29:52 +02:00
|
|
|
int s;
|
|
|
|
|
|
|
|
switch(m_ptr->m1_i1) {
|
|
|
|
case SI_DATA_STORE:
|
2010-01-14 16:24:16 +01:00
|
|
|
src_addr = (vir_bytes)ds_store;
|
|
|
|
length = sizeof(struct data_store) * NR_DS_KEYS;
|
|
|
|
break;
|
|
|
|
case SI_SUBSCRIPTION:
|
|
|
|
src_addr = (vir_bytes)ds_subs;
|
|
|
|
length = sizeof(struct subscription) * NR_DS_SUBS;
|
|
|
|
break;
|
2005-10-20 22:29:52 +02:00
|
|
|
default:
|
2010-01-14 16:24:16 +01:00
|
|
|
return EINVAL;
|
2005-10-20 22:29:52 +02:00
|
|
|
}
|
|
|
|
|
2010-01-14 16:24:16 +01:00
|
|
|
if (OK != (s=sys_datacopy(SELF, src_addr,
|
|
|
|
m_ptr->m_source, (vir_bytes)m_ptr->m1_p1, length))) {
|
2006-07-13 16:50:23 +02:00
|
|
|
printf("DS: copy failed: %d\n", s);
|
2010-01-14 16:24:16 +01:00
|
|
|
return s;
|
2006-07-13 16:50:23 +02:00
|
|
|
}
|
2005-10-20 22:29:52 +02:00
|
|
|
|
2010-01-14 16:24:16 +01:00
|
|
|
return OK;
|
2006-07-13 16:50:23 +02:00
|
|
|
}
|
|
|
|
|