140 likes | 306 Views
PaRTiKle. 2007.4.9. Bai Shuwei baishw06@lzu.cn http://dslab.lzu.edu.cn/memebers/baishw. Contents. What is PaRTiKle Memory Management Interrupt Management Thread Management Device Management. What is PaRTiKle. PaRTiKle – Particular Real-Time Kernel RT-kernel and library
E N D
PaRTiKle 2007.4.9 Bai Shuwei baishw06@lzu.cn http://dslab.lzu.edu.cn/memebers/baishw
Contents What is PaRTiKle Memory Management Interrupt Management Thread Management Device Management
What is PaRTiKle PaRTiKle – Particular Real-Time Kernel RT-kernel and library C full support C++, Ada, Java non-full support GPL V2.0
Linux System PaRTiKle USER APIs(ulibc) RT-KERNEL(klibc) Xm system calls XtratuM Kernel INTERRUPTS ANF TIMER PaRTiKle Architecture
Domain Kernel pool Irq_mask Event heap User Dynamical others Memory Management Domain HEAP(3M) memory_pool ->KERNEL_DYNAMIC_MEMORY(1M) _dyn_mem_pool->USER_DYNAMIC_MEMORY(1M)
Interrupt Management IRQ_NR: 16 (max: 32) -> xtratum domain events TRAP_NR: 16 (max: 20) event_handling_t
Thread Management Posix thread (not all) Posix mutex Posix condition Posix semphone Non-Posix timer
Device Management Device name add in prtkcf Device structure name are fixed **devtab root console
Exmaple // A Hello World example #include <stdio.h> #include <time.h> #include <sys/io.h> int main (int argc, char **argv) { struct timespec t = {5, 0}; int ent; char buf [20]; printf ("Hello World!!!\n"); //printf->write_scr->printk scanf ("%d", &ent); scanf ("%s", buf); printf ("ent: %d\n", ent); printf ("buf: %s\n", buf); ent = inb (0x378); */ // while (1); nanosleep (&t, 0); // exit (0); return 0; }
Exmaple Create the new in the c_example directory ;;Compile the new file # make ;;Run the new file # ../../../../xtratum/user_tools/xmloader/loader.xm hello_world.prtk ;;Check the result # dmesg >> PaRTiKle Core << Detected 1602.317 MHz processor. Setting up the dynamic memory manager (2048 kbytes at 0x200400c) Free system memory 3071 Kb PaRTiKle (54 Kb [.text=34 .data=8 .rodata=2 .bss=6] Kb) App. (34 Kb [.text=17 .data=1 .rodata=9 .bss=0] Kb) - init console: ok - init root: ok - init test: ok - init rtf: ok Jumping to the user's code Hello World!!! System exit status: 0. System halted.
Appendix I prtkcf dev cons cons-xm root test rtf # tty lib c port dev errno fs heap ……
Appendix I prtkcf heap irqs pthread rtl sched semaphore setup signal syscalls time link koutput rtc tsc xmtimer # files are taken relative to the PaRTiKle $ROOT root /dev / /tmp / /usr / /usr/NOTES /NOTES
Appendix II rtf-device ……….. int init_rtf(void) { int index; for(index = 0; index < MAX_FIFO_COUNT; index ++) { fifos[index].rtf_flag = 0; fifos[index].rtf_minor = -1; } return 0; } struct Dev rtfdevtab = { dc: 'c', name: "rtf", init: init_rtf, open: rtf_open, read: rtf_read, write: rtf_write, close: rtf_close, ioctl: rtf_ioctl, mmap: rtf_mmap };