Adeos nanokernel for 2.5.38 1/2: no-arch code
Subsystems (4)
PATCH 1/1 Adeos nanokernel for 2.5.38 1/2: no-arch code
This is a patch for adding the Adeos nanokernel to the Linux kernel as described earlier:
http://marc.theaimsgroup.com/?l=linux-kernel&m=102309348817485&w=2
Here are the files added:
include/linux/adeos.h | 188 ++++++++++++ kernel/adeos.c | 712 ++++++++++++++++++++++++++++++++++++++++++++++
Here are the files modified:
include/linux/init_task.h | 51 +++ include/linux/sched.h | 4 init/Config.in | 1 init/main.c | 3 kernel/Makefile | 3 kernel/fork.c | 8 kernel/ksyms.c | 32 ++ kernel/printk.c | 114 +++++++ kernel/sched.c | 8 kernel/sysctl.c | 3 12 files changed, 1125 insertions, 2 deletions
These modifications are only aimed at making sure that Linux plays nice with the other domains in the pipeline.
The project's web site is located here:
http://www.nongnu.org/adeos/
Any feedback is appreciated.
include/linux/adeos.h +188 -0
@@ -0,0 +1,188 @@ +/* +* include/linux/adeos.h +* +* Copyright (C) 2002 Philippe Gerum. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139, +* USA; either version 2 of the License, or (at your option) any later +* version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef __LINUX_ADEOS_H +#define __LINUX_ADEOS_H + +#include <asm/adeos.h> + +#define ADEOS_VERSION_STRING "2.5r1c4/x86" + +#define ADEOS_ROOT_PRI 100 +#define ADEOS_ROOT_ID 0 +#define ADEOS_ROOT_NPTDKEYS 4/* Must be <= 32 */ + +#define ADEOS_OTHER_CPUS (-1) +#define ADEOS_RESET_TIMER 0x1 + +#define IPIPE_STALL_FLAG 0/* Stalls a pipeline stage */ +#define IPIPE_SYNC_FLAG 1/* IRQ sync is undergoing */ +#define IPIPE_XPEND_FLAG 2/* Exception notification is pending */ +#define IPIPE_SLEEP_FLAG 3/* Domain has suspended itself */ + +#define IPIPE_HANDLE_FLAG 0 +#define IPIPE_PASS_FLAG 1 +#define IPIPE_CALLASM_FLAG 2 +#define IPIPE_ENABLE_FLAG 3 +#define IPIPE_DYNAMIC_FLAG IPIPE_HANDLE_FLAG +#define IPIPE_EXCLUSIVE_FLAG 4 + +#define IPIPE_HANDLE_MASK (1 << IPIPE_HANDLE_FLAG) +#define IPIPE_PASS_MASK (1 << IPIPE_PASS_FLAG) +#define IPIPE_CALLASM_MASK (1 << IPIPE_CALLASM_FLAG) +#define IPIPE_ENABLE_MASK (1 << IPIPE_ENABLE_FLAG) +#define IPIPE_DYNAMIC_MASK IPIPE_HANDLE_MASK +#define IPIPE_EXCLUSIVE_MASK (1 << IPIPE_EXCLUSIVE_FLAG) + +#define IPIPE_DEFAULT_MASK (IPIPE_HANDLE_MASK|IPIPE_PASS_MASK) + +typedef struct adattr { + +unsigned domid;/* Domain identifier -- Magic value set by caller */ +const char *name;/* Domain name -- Warning: won't be dup'ed! */ +int priority;/* Priority in interrupt pipeline */ +void (*entry)(void );/* Domain entry point */ +int estacksz;/* Stack size for entry context -- 0 means unspec */ +void (*dswitch)(void );/* Handler called each time the domain is switched in */ +int nptdkeys;/* Max. number of per-thread data keys */ +void (*ptdset)(int ,void *);/* Routine to set pt values */ +void *(*ptdget)(int );/* Routine to get pt values */ + +}adattr_t ; + +extern adomain_t *adp_cpu_current[], + *adp_root; + +#define adp_current (adp_cpu_current[adeos_processor_id()]) + +int adeos_register_domain (adomain_t *adp, +adattr_t *attr); + +int adeos_unregister_domain (adomain_t *adp); + +void adeos_renice_domain (adomain_t *adp, +int newpri); + +void adeos_suspend_domain (void ); + +int adeos_virtualize_irq (unsigned irq, +void (*handler)(unsigned irq), +int (*acknowledge)(unsigned irq), +unsigned modemask); + +int adeos_control_irq (unsigned irq, +unsigned clrmask, +unsigned setmask); + +int FASTCALL (adeos_propagate_irq (unsigned irq)); + +unsigned adeos_alloc_irq (void ); + +int adeos_free_irq (unsigned irq); + +int FASTCALL (adeos_trigger_irq (unsigned irq)); + +int FASTCALL (adeos_trigger_ipi (int cpuid)); + +void adeos_stall_ipipe (void ); + +static inline void adeos_stall_ipipe_from (adomain_t *adp) { + + ipipe_declare_cpuid; +set_bit (IPIPE_STALL_FLAG ,&adp->cpudata[cpuid].status); +} + +void adeos_unstall_ipipe (void ); + +void adeos_unstall_ipipe_from (adomain_t *adp); + +static inline unsigned long adeos_test_ipipe_from (adomain_t *adp) { + +return test_bit (IPIPE_STALL_FLAG ,&adp->cpudata[adeos_processor_id ()].status); +} + +static inline unsigned long adeos_test_ipipe (void ) { + +return adeos_test_ipipe_from (adp_current); +} + +static inline unsigned long adeos_test_and_stall_ipipe_from (adomain_t *adp) { + +return test_and_set_bit (IPIPE_STALL_FLAG ,&adp->cpudata[adeos_processor_id ()].status); +} + +static inline unsigned long adeos_test_and_stall_ipipe (void ) { + +return adeos_test_and_stall_ipipe_from (adp_current); +} + +static inline void adeos_restore_ipipe_from (adomain_t *adp,unsigned long flags) { + + ipipe_declare_cpuid; + +if (flags) +set_bit (IPIPE_STALL_FLAG ,&adp->cpudata[cpuid].status); +else + { +clear_bit (IPIPE_STALL_FLAG ,&adp->cpudata[cpuid].status); + +if (adp == adp_current && + adp->cpudata[cpuid].irq_pending_hi !=0 ) +ipipe_sync_irqs (); + } +} + +static inline void adeos_restore_ipipe (unsigned long flags) { + +adeos_restore_ipipe_from (adp_current,flags); +} + +int adeos_catch_event (unsigned event, +void (*handler)(adevinfo_t *)); + +static inline void adeos_propagate_event (adevinfo_t *evinfo) { + + evinfo->propagate =1 ; +} + +void (*adeos_hook_dswitch (void (*handler)(void )))(void ); + +void adeos_init_attr (adattr_t *attr); + +int adeos_get_sysinfo (adsysinfo_t *sysinfo); + +int adeos_tune_timer (unsigned long ns, +int flags); + +int adeos_alloc_ptdkey (void ); + +int adeos_free_ptdkey (int key); + +int adeos_set_ptd (int key, +void *value); + +void *adeos_get_ptd (int key); + +unsigned long adeos_critical_enter (void (*syncfn)(void )); + +void adeos_critical_exit (unsigned long flags); + +#endif /* !__LINUX_ADEOS_H */
include/linux/init_task.h +51 -0
65 lines not on this page · raw message
include/linux/sched.h +4 -0
@@ -398,6 +398,10 @@ struct task_struct {/* journalling filesystem info */ void *journal_info;struct dentry *proc_dentry; + +#ifdef CONFIG_ADEOS +void *ptd[ADEOS_ROOT_NPTDKEYS ]; +#endif /* CONFIG_ADEOS */ };extern void __put_task_struct (struct task_struct *tsk);
init/Config.in +1 -0
@@ -5,6 +5,7 @@ endmenu mainmenu_option next_comment comment 'General setup' +bool 'Adaptive Domain Environment support' CONFIG_ADEOS bool 'Networking support' CONFIG_NET bool 'System V IPC' CONFIG_SYSVIPC bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT
init/main.c +3 -0
@@ -396,6 +396,9 @@ asmlinkage void __init start_kernel(voidbuild_all_zonelists ();printk ("Kernel command line: %s\n" , saved_command_line);parse_options (command_line); +#ifdef CONFIG_ADEOS +__adeos_init (); +#endif /* CONFIG_ADEOS */ trap_init ();init_IRQ ();sched_init ();
kernel/Makefile +2 -1
@@ -3,7 +3,7 @@ # export-objs = signal.o sys.o kmod.o context.o ksyms.o pm.o exec_domain.o \ - printk.o platform.o suspend.o dma.o + printk.o platform.o suspend.o dma.o adeos.o obj-y = sched.o fork.o exec_domain.o panic.o printk.o \ module.o exit.o itimer.o time.o softirq.o resource.o \
@@ -17,6 +17,7 @@ obj-$(CONFIG_MODULES) += ksyms.o obj-$(CONFIG_PM) += pm.o obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o obj-$(CONFIG_SOFTWARE_SUSPEND) += suspend.o +obj-$(CONFIG_ADEOS) += adeos.o ifneq ($(CONFIG_IA64),y) # According to Alan Modra <[email protected]>, the -fno-omit-frame-pointer is
kernel/adeos.c +712 -0
712 lines not on this page · raw message
kernel/fork.c +8 -0
@@ -846,6 +846,14 @@ static struct task_struct *copy_process( nr_threads++;write_unlock_irq (&tasklist_lock); +#ifdef CONFIG_ADEOS + { +int k; + +for (k =0 ; k <ADEOS_ROOT_NPTDKEYS ; k++) + p->ptd[k] =NULL ; + } +#endif /* CONFIG_ADEOS */ retval =0 ; fork_out:
kernel/ksyms.c +32 -0
@@ -612,3 +612,35 @@ EXPORT_SYMBOL(__per_cpu_offset);/* debug */ EXPORT_SYMBOL (dump_stack); + +#ifdef CONFIG_ADEOS +EXPORT_SYMBOL (adeos_register_domain); +EXPORT_SYMBOL (adeos_unregister_domain); +EXPORT_SYMBOL (adeos_renice_domain); +EXPORT_SYMBOL (adeos_suspend_domain); +EXPORT_SYMBOL (adeos_virtualize_irq); +EXPORT_SYMBOL (adeos_control_irq); +EXPORT_SYMBOL (adeos_propagate_irq); +EXPORT_SYMBOL (adeos_alloc_irq); +EXPORT_SYMBOL (adeos_free_irq); +EXPORT_SYMBOL (adeos_trigger_irq); +EXPORT_SYMBOL (adeos_trigger_ipi); +EXPORT_SYMBOL (adeos_stall_ipipe); +EXPORT_SYMBOL (adeos_unstall_ipipe); +EXPORT_SYMBOL (adeos_unstall_ipipe_from); +EXPORT_SYMBOL (adeos_catch_event); +EXPORT_SYMBOL (adeos_hook_dswitch); +EXPORT_SYMBOL (adeos_init_attr); +EXPORT_SYMBOL (adeos_get_sysinfo); +EXPORT_SYMBOL (adeos_tune_timer); +EXPORT_SYMBOL (adeos_alloc_ptdkey); +EXPORT_SYMBOL (adeos_free_ptdkey); +EXPORT_SYMBOL (adeos_set_ptd); +EXPORT_SYMBOL (adeos_get_ptd); +EXPORT_SYMBOL (adeos_critical_enter); +EXPORT_SYMBOL (adeos_critical_exit); +EXPORT_SYMBOL (adp_cpu_current); +EXPORT_SYMBOL (adp_root); +/* Private symbols. */ +EXPORT_SYMBOL (__adeos_online_cpus); +#endif /* CONFIG_ADEOS */
kernel/printk.c +113 -1
244 lines not on this page · raw message
kernel/sched.c +8 -0
@@ -1041,6 +1041,14 @@ asmlinkage void preempt_schedule(void) {struct thread_info *ti =current_thread_info (); +#ifdef CONFIG_ADEOS +/* The in-kernel preemption routine might be indirectly called +from code running in other domains, so we must ensure that +scheduling only takes place on behalf of the root (Linux) +one. */ +if (adp_current != adp_root) +return ; +#endif /* CONFIG_ADEOS */ /* * If there is a non-zero preempt_count or interrupts are disabled, * we do not want to preempt the current task. Just return..
kernel/sysctl.c +3 -0
@@ -362,6 +362,9 @@ void __init sysctl_init(void)#ifdef CONFIG_PROC_FS register_proc_table (root_table, proc_sys_root);init_irq_proc (); +#ifdef CONFIG_ADEOS +__adeos_init_proc (); +#endif /* CONFIG_ADEOS */ #endif }
Hi!
Quoted 3 lines
This is a patch for adding the Adeos nanokernel to the Linux kernel as described earlier:
http://marc.theaimsgroup.com/?l=linux-kernel&m=102309348817485&w=2
Maybe adding Docs/adeos.txt is good idea... (sorry can't access web right now) -- so this is aimed at being free rtlinux replacement?
Pavel
Signature · 2 lines
Philips Velo 1: 1"x4"x8", 300gram, 60, 12MB, 40bogomips, linux, mutt, details at http://atrey.karlin.mff.cuni.cz/~pavel/velo/index.html.
Em Sun, Sep 22, 2002 at 10:58:57PM -0400, Karim Yaghmour escreveu:
Quoted 25 lines
diff -urpN
linux-2.5.38/kernel/printk.clinux-2.5.38-adeos/kernel/printk.ckernel/printk.c +10
-0@@ -194,17 +194,33 @@ int do_syslog(int type, char * buf, intif (error) goto out; i =0 ; +#ifdef CONFIG_ADEOS +ipipe_hw_spin_lock_disable (&logbuf_lock); +#else /* !CONFIG_ADEOS */ spin_lock_irq (&logbuf_lock); +#endif /* CONFIG_ADEOS */ while ((log_start != log_end) && i < len) { c =LOG_BUF (log_start); log_start++; +#ifdef CONFIG_ADEOS +ipipe_hw_spin_unlock_enable (&logbuf_lock); +#else /* !CONFIG_ADEOS */ spin_unlock_irq (&logbuf_lock); +#endif /* CONFIG_ADEOS */ __put_user (c,buf); buf++; i++; +#ifdef CONFIG_ADEOS +ipipe_hw_spin_lock_disable (&logbuf_lock);
kernel/printk.c int do_syslog(int type, char * buf, int · line 224
Quoted 10 lines
kernel/printk.c +6
-0+#else /* !CONFIG_ADEOS */ spin_lock_irq (&logbuf_lock); +#endif /* CONFIG_ADEOS */ } +#ifdef CONFIG_ADEOS +ipipe_hw_spin_unlock_enable (&logbuf_lock); +#else /* !CONFIG_ADEOS */ spin_unlock_irq (&logbuf_lock); +#endif /* CONFIG_ADEOS */ error = i;
Why this ifdef hell and not something like:
lockbuf_lock(); bla logbuf_unlock();
and have this defined in a header, say printk.h or whatever, with the ifdefs?
- Arnaldo
PATCH 1/1 Adeos nanokernel for 2.5.38 1/2: no-arch code
This is a patch for adding the Adeos nanokernel to the Linux kernel as described earlier:
http://marc.theaimsgroup.com/?l=linux-kernel&m=102309348817485&w=2
Here are the files added:
include/linux/adeos.h | 188 ++++++++++++ kernel/adeos.c | 712 ++++++++++++++++++++++++++++++++++++++++++++++
Here are the files modified:
include/linux/init_task.h | 51 +++ include/linux/sched.h | 4 init/Config.in | 1 init/main.c | 3 kernel/Makefile | 3 kernel/fork.c | 8 kernel/ksyms.c | 32 ++ kernel/printk.c | 114 +++++++ kernel/sched.c | 8 kernel/sysctl.c | 3 12 files changed, 1125 insertions, 2 deletions
These modifications are only aimed at making sure that Linux plays nice with the other domains in the pipeline.
The project's web site is located here:
http://www.nongnu.org/adeos/
Any feedback is appreciated.
include/linux/adeos.h +188 -0
@@ -0,0 +1,188 @@ +/* +* include/linux/adeos.h +* +* Copyright (C) 2002 Philippe Gerum. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139, +* USA; either version 2 of the License, or (at your option) any later +* version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef __LINUX_ADEOS_H +#define __LINUX_ADEOS_H + +#include <asm/adeos.h> + +#define ADEOS_VERSION_STRING "2.5r1c4/x86" + +#define ADEOS_ROOT_PRI 100 +#define ADEOS_ROOT_ID 0 +#define ADEOS_ROOT_NPTDKEYS 4/* Must be <= 32 */ + +#define ADEOS_OTHER_CPUS (-1) +#define ADEOS_RESET_TIMER 0x1 + +#define IPIPE_STALL_FLAG 0/* Stalls a pipeline stage */ +#define IPIPE_SYNC_FLAG 1/* IRQ sync is undergoing */ +#define IPIPE_XPEND_FLAG 2/* Exception notification is pending */ +#define IPIPE_SLEEP_FLAG 3/* Domain has suspended itself */ + +#define IPIPE_HANDLE_FLAG 0 +#define IPIPE_PASS_FLAG 1 +#define IPIPE_CALLASM_FLAG 2 +#define IPIPE_ENABLE_FLAG 3 +#define IPIPE_DYNAMIC_FLAG IPIPE_HANDLE_FLAG +#define IPIPE_EXCLUSIVE_FLAG 4 + +#define IPIPE_HANDLE_MASK (1 << IPIPE_HANDLE_FLAG) +#define IPIPE_PASS_MASK (1 << IPIPE_PASS_FLAG) +#define IPIPE_CALLASM_MASK (1 << IPIPE_CALLASM_FLAG) +#define IPIPE_ENABLE_MASK (1 << IPIPE_ENABLE_FLAG) +#define IPIPE_DYNAMIC_MASK IPIPE_HANDLE_MASK +#define IPIPE_EXCLUSIVE_MASK (1 << IPIPE_EXCLUSIVE_FLAG) + +#define IPIPE_DEFAULT_MASK (IPIPE_HANDLE_MASK|IPIPE_PASS_MASK) + +typedef struct adattr { + +unsigned domid;/* Domain identifier -- Magic value set by caller */ +const char *name;/* Domain name -- Warning: won't be dup'ed! */ +int priority;/* Priority in interrupt pipeline */ +void (*entry)(void );/* Domain entry point */ +int estacksz;/* Stack size for entry context -- 0 means unspec */ +void (*dswitch)(void );/* Handler called each time the domain is switched in */ +int nptdkeys;/* Max. number of per-thread data keys */ +void (*ptdset)(int ,void *);/* Routine to set pt values */ +void *(*ptdget)(int );/* Routine to get pt values */ + +}adattr_t ; + +extern adomain_t *adp_cpu_current[], + *adp_root; + +#define adp_current (adp_cpu_current[adeos_processor_id()]) + +int adeos_register_domain (adomain_t *adp, +adattr_t *attr); + +int adeos_unregister_domain (adomain_t *adp); + +void adeos_renice_domain (adomain_t *adp, +int newpri); + +void adeos_suspend_domain (void ); + +int adeos_virtualize_irq (unsigned irq, +void (*handler)(unsigned irq), +int (*acknowledge)(unsigned irq), +unsigned modemask); + +int adeos_control_irq (unsigned irq, +unsigned clrmask, +unsigned setmask); + +int FASTCALL (adeos_propagate_irq (unsigned irq)); + +unsigned adeos_alloc_irq (void ); + +int adeos_free_irq (unsigned irq); + +int FASTCALL (adeos_trigger_irq (unsigned irq)); + +int FASTCALL (adeos_trigger_ipi (int cpuid)); + +void adeos_stall_ipipe (void ); + +static inline void adeos_stall_ipipe_from (adomain_t *adp) { + + ipipe_declare_cpuid; +set_bit (IPIPE_STALL_FLAG ,&adp->cpudata[cpuid].status); +} + +void adeos_unstall_ipipe (void ); + +void adeos_unstall_ipipe_from (adomain_t *adp); + +static inline unsigned long adeos_test_ipipe_from (adomain_t *adp) { + +return test_bit (IPIPE_STALL_FLAG ,&adp->cpudata[adeos_processor_id ()].status); +} + +static inline unsigned long adeos_test_ipipe (void ) { + +return adeos_test_ipipe_from (adp_current); +} + +static inline unsigned long adeos_test_and_stall_ipipe_from (adomain_t *adp) { + +return test_and_set_bit (IPIPE_STALL_FLAG ,&adp->cpudata[adeos_processor_id ()].status); +} + +static inline unsigned long adeos_test_and_stall_ipipe (void ) { + +return adeos_test_and_stall_ipipe_from (adp_current); +} + +static inline void adeos_restore_ipipe_from (adomain_t *adp,unsigned long flags) { + + ipipe_declare_cpuid; + +if (flags) +set_bit (IPIPE_STALL_FLAG ,&adp->cpudata[cpuid].status); +else + { +clear_bit (IPIPE_STALL_FLAG ,&adp->cpudata[cpuid].status); + +if (adp == adp_current && + adp->cpudata[cpuid].irq_pending_hi !=0 ) +ipipe_sync_irqs (); + } +} + +static inline void adeos_restore_ipipe (unsigned long flags) { + +adeos_restore_ipipe_from (adp_current,flags); +} + +int adeos_catch_event (unsigned event, +void (*handler)(adevinfo_t *)); + +static inline void adeos_propagate_event (adevinfo_t *evinfo) { + + evinfo->propagate =1 ; +} + +void (*adeos_hook_dswitch (void (*handler)(void )))(void ); + +void adeos_init_attr (adattr_t *attr); + +int adeos_get_sysinfo (adsysinfo_t *sysinfo); + +int adeos_tune_timer (unsigned long ns, +int flags); + +int adeos_alloc_ptdkey (void ); + +int adeos_free_ptdkey (int key); + +int adeos_set_ptd (int key, +void *value); + +void *adeos_get_ptd (int key); + +unsigned long adeos_critical_enter (void (*syncfn)(void )); + +void adeos_critical_exit (unsigned long flags); + +#endif /* !__LINUX_ADEOS_H */
include/linux/init_task.h +51 -0
65 lines not on this page · raw message
include/linux/sched.h +4 -0
@@ -398,6 +398,10 @@ struct task_struct {/* journalling filesystem info */ void *journal_info;struct dentry *proc_dentry; + +#ifdef CONFIG_ADEOS +void *ptd[ADEOS_ROOT_NPTDKEYS ]; +#endif /* CONFIG_ADEOS */ };extern void __put_task_struct (struct task_struct *tsk);
init/Config.in +1 -0
@@ -5,6 +5,7 @@ endmenu mainmenu_option next_comment comment 'General setup' +bool 'Adaptive Domain Environment support' CONFIG_ADEOS bool 'Networking support' CONFIG_NET bool 'System V IPC' CONFIG_SYSVIPC bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT
init/main.c +3 -0
@@ -396,6 +396,9 @@ asmlinkage void __init start_kernel(voidbuild_all_zonelists ();printk ("Kernel command line: %s\n" , saved_command_line);parse_options (command_line); +#ifdef CONFIG_ADEOS +__adeos_init (); +#endif /* CONFIG_ADEOS */ trap_init ();init_IRQ ();sched_init ();
kernel/Makefile +2 -1
@@ -3,7 +3,7 @@ # export-objs = signal.o sys.o kmod.o context.o ksyms.o pm.o exec_domain.o \ - printk.o platform.o suspend.o dma.o + printk.o platform.o suspend.o dma.o adeos.o obj-y = sched.o fork.o exec_domain.o panic.o printk.o \ module.o exit.o itimer.o time.o softirq.o resource.o \
@@ -17,6 +17,7 @@ obj-$(CONFIG_MODULES) += ksyms.o obj-$(CONFIG_PM) += pm.o obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o obj-$(CONFIG_SOFTWARE_SUSPEND) += suspend.o +obj-$(CONFIG_ADEOS) += adeos.o ifneq ($(CONFIG_IA64),y) # According to Alan Modra <[email protected]>, the -fno-omit-frame-pointer is
kernel/adeos.c +712 -0
712 lines not on this page · raw message
kernel/fork.c +8 -0
@@ -846,6 +846,14 @@ static struct task_struct *copy_process( nr_threads++;write_unlock_irq (&tasklist_lock); +#ifdef CONFIG_ADEOS + { +int k; + +for (k =0 ; k <ADEOS_ROOT_NPTDKEYS ; k++) + p->ptd[k] =NULL ; + } +#endif /* CONFIG_ADEOS */ retval =0 ; fork_out:
kernel/ksyms.c +32 -0
@@ -612,3 +612,35 @@ EXPORT_SYMBOL(__per_cpu_offset);/* debug */ EXPORT_SYMBOL (dump_stack); + +#ifdef CONFIG_ADEOS +EXPORT_SYMBOL (adeos_register_domain); +EXPORT_SYMBOL (adeos_unregister_domain); +EXPORT_SYMBOL (adeos_renice_domain); +EXPORT_SYMBOL (adeos_suspend_domain); +EXPORT_SYMBOL (adeos_virtualize_irq); +EXPORT_SYMBOL (adeos_control_irq); +EXPORT_SYMBOL (adeos_propagate_irq); +EXPORT_SYMBOL (adeos_alloc_irq); +EXPORT_SYMBOL (adeos_free_irq); +EXPORT_SYMBOL (adeos_trigger_irq); +EXPORT_SYMBOL (adeos_trigger_ipi); +EXPORT_SYMBOL (adeos_stall_ipipe); +EXPORT_SYMBOL (adeos_unstall_ipipe); +EXPORT_SYMBOL (adeos_unstall_ipipe_from); +EXPORT_SYMBOL (adeos_catch_event); +EXPORT_SYMBOL (adeos_hook_dswitch); +EXPORT_SYMBOL (adeos_init_attr); +EXPORT_SYMBOL (adeos_get_sysinfo); +EXPORT_SYMBOL (adeos_tune_timer); +EXPORT_SYMBOL (adeos_alloc_ptdkey); +EXPORT_SYMBOL (adeos_free_ptdkey); +EXPORT_SYMBOL (adeos_set_ptd); +EXPORT_SYMBOL (adeos_get_ptd); +EXPORT_SYMBOL (adeos_critical_enter); +EXPORT_SYMBOL (adeos_critical_exit); +EXPORT_SYMBOL (adp_cpu_current); +EXPORT_SYMBOL (adp_root); +/* Private symbols. */ +EXPORT_SYMBOL (__adeos_online_cpus); +#endif /* CONFIG_ADEOS */
kernel/printk.c +113 -1
244 lines not on this page · raw message
kernel/sched.c +8 -0
@@ -1041,6 +1041,14 @@ asmlinkage void preempt_schedule(void) {struct thread_info *ti =current_thread_info (); +#ifdef CONFIG_ADEOS +/* The in-kernel preemption routine might be indirectly called +from code running in other domains, so we must ensure that +scheduling only takes place on behalf of the root (Linux) +one. */ +if (adp_current != adp_root) +return ; +#endif /* CONFIG_ADEOS */ /* * If there is a non-zero preempt_count or interrupts are disabled, * we do not want to preempt the current task. Just return..
kernel/sysctl.c +3 -0
@@ -362,6 +362,9 @@ void __init sysctl_init(void)#ifdef CONFIG_PROC_FS register_proc_table (root_table, proc_sys_root);init_irq_proc (); +#ifdef CONFIG_ADEOS +__adeos_init_proc (); +#endif /* CONFIG_ADEOS */ #endif }
Em Sun, Sep 22, 2002 at 10:58:57PM -0400, Karim Yaghmour escreveu:
Quoted 25 lines
diff -urpN
linux-2.5.38/kernel/printk.clinux-2.5.38-adeos/kernel/printk.ckernel/printk.c +10
-0@@ -194,17 +194,33 @@ int do_syslog(int type, char * buf, intif (error) goto out; i =0 ; +#ifdef CONFIG_ADEOS +ipipe_hw_spin_lock_disable (&logbuf_lock); +#else /* !CONFIG_ADEOS */ spin_lock_irq (&logbuf_lock); +#endif /* CONFIG_ADEOS */ while ((log_start != log_end) && i < len) { c =LOG_BUF (log_start); log_start++; +#ifdef CONFIG_ADEOS +ipipe_hw_spin_unlock_enable (&logbuf_lock); +#else /* !CONFIG_ADEOS */ spin_unlock_irq (&logbuf_lock); +#endif /* CONFIG_ADEOS */ __put_user (c,buf); buf++; i++; +#ifdef CONFIG_ADEOS +ipipe_hw_spin_lock_disable (&logbuf_lock);
kernel/printk.c int do_syslog(int type, char * buf, int · line 224
Quoted 10 lines
kernel/printk.c +6
-0+#else /* !CONFIG_ADEOS */ spin_lock_irq (&logbuf_lock); +#endif /* CONFIG_ADEOS */ } +#ifdef CONFIG_ADEOS +ipipe_hw_spin_unlock_enable (&logbuf_lock); +#else /* !CONFIG_ADEOS */ spin_unlock_irq (&logbuf_lock); +#endif /* CONFIG_ADEOS */ error = i;
Why this ifdef hell and not something like:
lockbuf_lock(); bla logbuf_unlock();
and have this defined in a header, say printk.h or whatever, with the ifdefs?
- Arnaldo
Quoted 8 lines · Arnaldo Carvalho de Melo
Why this ifdef hell and not something like:
lockbuf_lock(); bla logbuf_unlock();and have this defined in a header, say
printk.hor whatever, with the ifdefs?
You're right, this is somewhat insane ;)
We'll fix it, thanks.
Karim
===================================================
Karim Yaghmour
[email protected]
Embedded and Real-Time Linux Expert
===================================================
Hi!
Quoted 3 lines
This is a patch for adding the Adeos nanokernel to the Linux kernel as described earlier:
http://marc.theaimsgroup.com/?l=linux-kernel&m=102309348817485&w=2
Maybe adding Docs/adeos.txt is good idea... (sorry can't access web right now) -- so this is aimed at being free rtlinux replacement?
Pavel
Signature · 2 lines
Philips Velo 1: 1"x4"x8", 300gram, 60, 12MB, 40bogomips, linux, mutt, details at http://atrey.karlin.mff.cuni.cz/~pavel/velo/index.html.
Hello Pavel,
Quoted 6 lines · Pavel Machek
Quoted 3 lines
This is a patch for adding the Adeos nanokernel to the Linux kernel as described earlier:
http://marc.theaimsgroup.com/?l=linux-kernel&m=102309348817485&w=2Maybe adding
Docs/adeos.txtis good idea... (sorry can't access web right now) --
Right, we'll do that.
Quoted 1 line
so this is aimed at being free rtlinux replacement?
I'm not sure "replacement" is the appropriate description for this. The scheme used by rtlinux and rtai is a master-slave scheme where Linux is a slave to the rt executive. Adeos makes the entire scheme obsolete by making all the OSes running on the same hardware clients of the same nanokernel, regardless of whether the client OSes provide hard RT or not. None of these OSes need to have a "other OS" task, as rtlinux and rtai clearly do. Rather, when an OS is done using the machine, it tells Adeos that it's done and Adeos returns control to whichever other OS is next in the interrupt pipeline.
To be honest, nothing in Adeos is "new". Adeos is implemented on classic early '90s nanokernel research. I've listed a number of nanokernel papers in the paper I wrote on Adeos. A complete list of nanokernel papers would probably have hundreds of entries. Some of these nanokernels even had OS schedulers (exokernel for instance). All Adeos implements is a scheme for sharing the interrupts among the various OSes using an interrupt pipeline.
Karim
===================================================
Karim Yaghmour
[email protected]
Embedded and Real-Time Linux Expert
===================================================
Quoted 8 lines · Karim Yaghmour
To be honest, nothing in Adeos is "new". Adeos is implemented on classic early '90s nanokernel research. I've listed a number of nanokernel papers in the paper I wrote on Adeos. A complete list of nanokernel papers would probably have hundreds of entries. Some of these nanokernels even had OS schedulers (exokernel for instance). All Adeos implements is a scheme for sharing the interrupts among the various OSes using an interrupt pipeline.
Hi,
are you planning to add spaces & portals, like in Space or Pebble?
best,
Jacob
Quoted 10 lines · Jacob Gorm Hansen
Quoted 8 lines · Karim Yaghmour
To be honest, nothing in Adeos is "new". Adeos is implemented on classic early '90s nanokernel research. I've listed a number of nanokernel papers in the paper I wrote on Adeos. A complete list of nanokernel papers would probably have hundreds of entries. Some of these nanokernels even had OS schedulers (exokernel for instance). All Adeos implements is a scheme for sharing the interrupts among the various OSes using an interrupt pipeline.
Quoted 3 lines
Hi,
are you planning to add spaces & portals, like in Space or Pebble?
I'm not sure whether what we plan to offer actually fits Space's definition of spaces, but domains already exist and portals should be trivial to implement over what we already have. For details on what plan to offer in terms of spaces, take a look at the paper I wrote describing how to implement Linux SMP clusters:
http://opersys.com/ftp/pub/Adeos/practical-smp-clusters.ps
Basically, Adeos would hand over RAM regions according to each OS instance's requests. In such a case, each kernel would have its own virtual memory and communication would be possible using "bridges", shared physical RAM regions. Many OSes can coexist in the same virtual address space, but the mechanisms for managing the virtual address space are not up to Adeos.
Karim
===================================================
Karim Yaghmour
[email protected]
Embedded and Real-Time Linux Expert
===================================================
Quoted 8 lines · Karim Yaghmour
To be honest, nothing in Adeos is "new". Adeos is implemented on classic early '90s nanokernel research. I've listed a number of nanokernel papers in the paper I wrote on Adeos. A complete list of nanokernel papers would probably have hundreds of entries. Some of these nanokernels even had OS schedulers (exokernel for instance). All Adeos implements is a scheme for sharing the interrupts among the various OSes using an interrupt pipeline.
Hi,
are you planning to add spaces & portals, like in Space or Pebble?
best,
Jacob
Quoted 10 lines · Jacob Gorm Hansen
Quoted 8 lines · Karim Yaghmour
To be honest, nothing in Adeos is "new". Adeos is implemented on classic early '90s nanokernel research. I've listed a number of nanokernel papers in the paper I wrote on Adeos. A complete list of nanokernel papers would probably have hundreds of entries. Some of these nanokernels even had OS schedulers (exokernel for instance). All Adeos implements is a scheme for sharing the interrupts among the various OSes using an interrupt pipeline.
Quoted 3 lines
Hi,
are you planning to add spaces & portals, like in Space or Pebble?
I'm not sure whether what we plan to offer actually fits Space's definition of spaces, but domains already exist and portals should be trivial to implement over what we already have. For details on what plan to offer in terms of spaces, take a look at the paper I wrote describing how to implement Linux SMP clusters:
http://opersys.com/ftp/pub/Adeos/practical-smp-clusters.ps
Basically, Adeos would hand over RAM regions according to each OS instance's requests. In such a case, each kernel would have its own virtual memory and communication would be possible using "bridges", shared physical RAM regions. Many OSes can coexist in the same virtual address space, but the mechanisms for managing the virtual address space are not up to Adeos.
Karim
===================================================
Karim Yaghmour
[email protected]
Embedded and Real-Time Linux Expert
===================================================
Hi!
Quoted 11 lines
Quoted 6 lines
Quoted 3 lines
This is a patch for adding the Adeos nanokernel to the Linux kernel as described earlier:
http://marc.theaimsgroup.com/?l=linux-kernel&m=102309348817485&w=2Maybe adding
Docs/adeos.txtis good idea... (sorry can't access web right now) --Right, we'll do that.
Quoted 1 line
so this is aimed at being free rtlinux replacement?
Quoted 9 lines
I'm not sure "replacement" is the appropriate description for this. The scheme used by rtlinux and rtai is a master-slave scheme where Linux is a slave to the rt executive. Adeos makes the entire scheme obsolete by making all the OSes running on the same hardware clients of the same nanokernel, regardless of whether the client OSes provide hard RT or not. None of these OSes need to have a "other OS" task, as rtlinux and rtai clearly do. Rather, when an OS is done using the machine, it tells Adeos that it's done and Adeos returns control to whichever other OS is next in the interrupt pipeline.
Are you actually able to use Adeos for something reasonable? You can't run two copies of linux, because they would fight over memory; right?
Do you have something that can run alongside linux?
Pavel
Signature · 2 lines
Casualities in World Trade Center: ~3k dead inside the building, cryptography in U.S.A. and free speech in Czech Republic.
Quoted 1 line · Pavel Machek
Are you actually able to use Adeos for something reasonable?
Sure, see below.
Quoted 2 lines
You can't
run two copies of linux, because they would fight over memory; right?
Currently we can't, you're right. But I've already detailed how to do this in a paper I wrote last july on how to obtain Linux SMP clusters with as few modifications to the kernel as possible. The paper is available on the web:
http://opersys.com/ftp/pub/Adeos/practical-smp-clusters.ps
(If you stil can't access the web as said in the other email, I can send you a copy off-list if you want.)
Quoted 1 line
Do you have something that can run alongside linux?
Certainly. According to some reports it's already used in some commercial systems and, as today's RTAI announcement reads, it will be the basis for the next release of RTAI.
What we need now is ports to other architectures than the i386. This should be fairly simple for anyone familiar enough with the Linux interrupt layer for any other arch.
Karim
===================================================
Karim Yaghmour
[email protected]
Embedded and Real-Time Linux Expert
===================================================
Hi!
Quoted 10 lines
Quoted 2 lines
You can't
run two copies of linux, because they would fight over memory; right?Currently we can't, you're right. But I've already detailed how to do this in a paper I wrote last july on how to obtain Linux SMP clusters with as few modifications to the kernel as possible. The paper is available on the web:
http://opersys.com/ftp/pub/Adeos/practical-smp-clusters.ps
(If you stil can't access the web as said in the other email, I can send you a copy off-list if you want.)
Its okay now, thanx.
Quoted 5 lines
Quoted 1 line
Do you have something that can run alongside linux?
Certainly. According to some reports it's already used in some commercial systems and, as today's RTAI announcement reads, it will be the basis for the next release of RTAI.
Ok. Good luck pushing it through linus ;-).
Pavel
Signature · 2 lines
Casualities in World Trade Center: ~3k dead inside the building, cryptography in U.S.A. and free speech in Czech Republic.
Hi!
Quoted 11 lines
Quoted 6 lines
Quoted 3 lines
This is a patch for adding the Adeos nanokernel to the Linux kernel as described earlier:
http://marc.theaimsgroup.com/?l=linux-kernel&m=102309348817485&w=2Maybe adding
Docs/adeos.txtis good idea... (sorry can't access web right now) --Right, we'll do that.
Quoted 1 line
so this is aimed at being free rtlinux replacement?
Quoted 9 lines
I'm not sure "replacement" is the appropriate description for this. The scheme used by rtlinux and rtai is a master-slave scheme where Linux is a slave to the rt executive. Adeos makes the entire scheme obsolete by making all the OSes running on the same hardware clients of the same nanokernel, regardless of whether the client OSes provide hard RT or not. None of these OSes need to have a "other OS" task, as rtlinux and rtai clearly do. Rather, when an OS is done using the machine, it tells Adeos that it's done and Adeos returns control to whichever other OS is next in the interrupt pipeline.
Are you actually able to use Adeos for something reasonable? You can't run two copies of linux, because they would fight over memory; right?
Do you have something that can run alongside linux?
Pavel
Signature · 2 lines
Casualities in World Trade Center: ~3k dead inside the building, cryptography in U.S.A. and free speech in Czech Republic.
Quoted 1 line · Pavel Machek
Are you actually able to use Adeos for something reasonable?
Sure, see below.
Quoted 2 lines
You can't
run two copies of linux, because they would fight over memory; right?
Currently we can't, you're right. But I've already detailed how to do this in a paper I wrote last july on how to obtain Linux SMP clusters with as few modifications to the kernel as possible. The paper is available on the web:
http://opersys.com/ftp/pub/Adeos/practical-smp-clusters.ps
(If you stil can't access the web as said in the other email, I can send you a copy off-list if you want.)
Quoted 1 line
Do you have something that can run alongside linux?
Certainly. According to some reports it's already used in some commercial systems and, as today's RTAI announcement reads, it will be the basis for the next release of RTAI.
What we need now is ports to other architectures than the i386. This should be fairly simple for anyone familiar enough with the Linux interrupt layer for any other arch.
Karim
===================================================
Karim Yaghmour
[email protected]
Embedded and Real-Time Linux Expert
===================================================
Hi!
Quoted 10 lines
Quoted 2 lines
You can't
run two copies of linux, because they would fight over memory; right?Currently we can't, you're right. But I've already detailed how to do this in a paper I wrote last july on how to obtain Linux SMP clusters with as few modifications to the kernel as possible. The paper is available on the web:
http://opersys.com/ftp/pub/Adeos/practical-smp-clusters.ps
(If you stil can't access the web as said in the other email, I can send you a copy off-list if you want.)
Its okay now, thanx.
Quoted 5 lines
Quoted 1 line
Do you have something that can run alongside linux?
Certainly. According to some reports it's already used in some commercial systems and, as today's RTAI announcement reads, it will be the basis for the next release of RTAI.
Ok. Good luck pushing it through linus ;-).
Pavel
Signature · 2 lines
Casualities in World Trade Center: ~3k dead inside the building, cryptography in U.S.A. and free speech in Czech Republic.