21 2 2004 4 Journal of the Graduate School of the Chinese Academy of Sciences Vol. 21 April No. 2 2004 :1002 1175 (2004) 0220254205 RTEMS 1 1 1 2 (1, 100084 ; 2, 100039) (2003 1 13 ; 2003 3 6 ) RTEMS,,. RTEMS,,, TP316. 2 1 RTEMS(Real Time Executive for Multiprocessor System). Ada C 2. Real Time Executive for Missile System,, C RTEMS M Multi2 processor. RTEMS VxWorks, PowerPC 604 CPU (300MHz) MVME2306,RTEMS pthreads 14. 9 s, 19. 2 s [1 ]. RTEMS [ 2 ]. RTEMS,,, (RM : Rate Monotonic),,,,,., TCPΠIP. RTEMS API POSIX 1003. 1b RTEID(Real Time Executive Interface Definition)ΠORKID(Open Real2Time Kernel Interface Defi2 nition),. 2 RTEMS. 1 RTEMS : Application Dependent Software Standard Application Components Device Drivers RTEMS Target Hardware
2, : RTEMS 255 RTEMS (device drivers). RTEMS IΠO,. RTEMS ( 2) [3 ]., (initialization manager) (task manager) (clock manager).,,. RTEMS,. 2 RTEMS 3,.,,. RTEMS, 2 PC : Linux Redhat 8. 0, RTEMS, RTEMS snapshot ss220021007. RTEMS.,. RTEMS :binutils22. 13. tar. bz2,gcc23. 2. tar. gz,newlib21. 10. 0. tar. gz,. diff. RTEMS ftp (ftp :ΠΠftp. OARcorp. com). ΠrtemsΠarchive, ΠrtemsΠtools., ΠrtemsΠtools,, binutils22. 13,gcc2 3. 2,newlib21. 10. 0. RTEM newlib, gcc23. 2 newlib : > ln 2s.. Πnewlib21. 10. 0Πnewlib newlib RTEMS, gcc binutils RTEMS,. diff, Linux patch. RTEMS, binutils gcc. binutils. ΠrtemsΠbuild : >.. Πbinutils22. 13Πconfigure22target = i3862rtems22prefix = ΠoptΠrtems, i3862rtems, ΠoptΠrtems. i386, i386, m68k ppc,
256 21 : > make2w all install binutils. make GNU make. binutils,. ΠrtemsΠ build, gcc. build gcc : >..Πgcc23. 2Πconfigure 22target = i3862rtems22prefix = ΠoptΠrtems22with2gnu2as \ 22with2gnu2ld22with2newlib22verbose22enable2threads \ 22enable2language = c,c + + gcc, binutils. binutils gcc, ΠoptΠrtems.,, PATH ΠoptΠrtemsΠbin, PATH. 4 RTEMS, Linux RTEMS., RTEMS. RTEMS snapshot, ftp. rtems2ss2yyyymmdd. tar. bz2, rtems2ss2 yyyymmdd, RTEMS. RTEMS (Board Support Package, BSP), BSP.,, pc386 BSP RTEMS COM2. PC pc386 BSP PCΠ104., BSP, rtems2ss2yyyymmddπcπsrcπlibπlibbspπi386πpc386πconsoleπconsole. c # define : rtems - termios - initialize () ; # define RTEMS - RUNTIME - CONSOLE - SELECT # ifdef RTEMS - RUNTIME - CONSOLE - SELECT BSP, RTEMS. gcc. shell : >.. Πrtems 2ss2yyyymmddΠconfigure22target = i3862rtems22prefix = ΠoptΠrtems \ 22enable2cxx 2 enable2rdbg22enable2networking22enable2posix22enable2itron > make RTEMS - BSP = pc386 > make RTEMS - BSP = pc386 install, BSP, make RTEMS - BSP. :RTEMS - BSP = gen68360 mvme167, gen68360 mvme167 M68K. 5 RTEMS, RTEMS API,
2, : RTEMS 257 API API, API.,RTEMS main, main BSP.. RTEMS API, RTEMS. API. Classic API init (), POSIX API POSIX - init (). RTEMS ftp hello. RTEMS, : Π3 Simple test program22 simplified version of sample test hello. 3 Π # define TEST - INIT # include < bsp. h > # include < stdio. h > rtems - task Init (rtems - task - argument ignored) { } Π3 3 Π printf ( \ n \ n333 HELLO WORLD TEST 333 \ n ) ; printf ( Hello World \ n ) ; printf ( 333 END OF HELLO WORLD TEST 333 \ n ) ; exit ( 0 ) ; Π3 configuration information 3 Π # define CONFIGURE - TEST - NEEDS - CONSOLE - DRIVER Π3 3 Π # define CONFIGURE - RTEMS - INIT - TASKS - TABLE Π3 Classic API 3 Π # define CONFIGURE - MAXIMUM - TASKS 1 Π3 3 Π # define CONFIGURE - INIT # include < confdefs. h > Π3 end of file 3 Π hello. exe,. (,PROM images,grub ), BOOTP + TFTP. BOOTP, TFTP, BOOTP TFTP ; http :ΠΠwww. rom2o2matic. net EtherBoot Bootstrap,,Bootstrap hello. exe.,hello,. : Initialized console on port CONSOLE 333 HELLO WORLD TEST 333 Hello World 333 END OF HELLO WORLD TEST 333 EXECUTIVE SHUTDOWN! Any key to reboot 6, RTEMS RTEMS, RTEMS, RTEMS. RTEMS
258 21 [ 1 ] T Straumann. Open source real time operating system overview. 8th International Conference on Accelerator &Large Experimental Physics Control Systems. California :San Jose,2001 [ 2 ] Antoine Colin,Isabelle Puaut. Worst2Case execution time analysis of the RTEMS real2time operating system,real2time systems. 13th Euromicro Con2 ference on 2001. 191 198 [ 3 ] http :ΠΠwww. OARcorp. com Installation of Cross Development Environment of RTEMS SHAO Ming2Chao 1 DU Qiang 1 LI Jian2Min 1 ZHAO Ji2Jiu 2 (1 Engineering Physics Department, Tsinghua University, Beijing 100084, China ; 2 Institute of High Energy Physics, Chinese Academy of Sciences, Beijing 100039, China) Abstract RTEMS,Real2Time Executive for Multiprocessor System,is a real2time kernel which provides high per2 formance environment for embedded applications. The main purpose of this article is to present the process of install2 ing a GNU cross development environment and compilation of RTEMS kernel. And an example application running on the target is shown to validate the cross development environment. Key words RTEMS,real2time operating system,embedded system,cross compilation