مجلة مجتمع لينوكس العربي العدد التاسع 9
مجلة تعنى بالبرمجيات الحرة والمصادرة المفتوحة
بالإمكان معرفة الأجزاء السابقة
والحديثة مستقبلا إن شاء الله عبر الرابط التالي :
www.linuxac.org
مجلة مجتمع لينوكس العربي العدد التاسع 9
مجلة تعنى بالبرمجيات الحرة والمصادرة المفتوحة
بالإمكان معرفة الأجزاء السابقة
والحديثة مستقبلا إن شاء الله عبر الرابط التالي :
www.linuxac.org
الملف الأول من ملفات مساق متكامل في الخوارزميات وأساسيات البرمجة بلغة جافا
اقدمها لطلبتي ولكافة المهتمين ،،،
هذا الملف يركز على مفهوم الخوارزميات وطبيعتها
تابعوني على https://www.facebook.com/MahmoudRFarra
الملف الأول من ملفات مساق متكامل في الخوارزميات وأساسيات البرمجة بلغة جافا
اقدمها لطلبتي ولكافة المهتمين ،،،
هذا الملف يركز على مفهوم الخوارزميات وطبيعتها
تابعوني على https://www.facebook.com/MahmoudRFarra
17. Hello World in RT Linux
pthread_t thread;
void * start_routine(void * arg) {
. . .
}
int init_module(void) {
return pthread_create(&thread, NULL,
start_routine, 0);
}
int cleanup_module(void) {
pthread_delete(thread);
}
18. Hello World in RT Linux
void * start_routine(void *arg) {
struct sched_param p;
p.sched_priority = 1;
pthread_setschedparam(pthread_self(),
SCHED_FIFO, &p);
pthread_make_periodic_np(pthread_self(),
gethrtime(), 500000000);
while (1) {
pthread_wait_np();
rtl_printf(“Hello World !n”);
}
return 0;
}
19. 19
Linux Kernel (ليونكس نواة)
System libraries
Device drivers Linux kernel
Hardware
I/O Hardware Interrupts
User Processes
20. 20
RTLinux Kernel
Hardware
System libraries
Device drivers Linux kernel
I/O Software Interrupts
User Processes
RTLinux Plug-in
Real Time Tasks
RT-Scheduler
I/O Hardware Interrupts
Linux is executed in the background
Direct
h/w
access
21. 21
Linux Kernel: code
perspective (الكود تجسيد)
Linux Monolithic kernel core
M1
M2
M3
M4
KernelLoadableModules
RAM DISK
Module M2 service
(system call)
User
Process
M2
THE
controller
24. RTLINUX MODULES
Int init_module();
Void cleanup_module();
Init_module is called when the module is
first loaded into the kernel.
This function returns 0 if the module is
successfully loaded. It returns a
negative value in case of failure. When
the module is loaded is to be unloaded ,
the cleanup_module() is called.