Here is a "PLDWorld.com"... // EXCALIBUR... // Additional Resources // µc/os-ii... Page 1 of 23 Additional Resources: µc/os-ii Author: Source: HiTEL D

Similar documents
untitled

Microsoft PowerPoint - ARM9_uCOS-II_2004_10_14_for_print1.ppt

Microsoft Word - 1. ARM Assembly 실습_xp2.doc

6주차.key

Microsoft PowerPoint - 05-ARM-Instruction-Set.ppt

Deok9_Exploit Technique

PowerPoint Presentation

ESP1ºÎ-04

T100MD+

ARM Reverse Engineering

슬라이드 제목 없음

기술 이력서 2.0

hlogin2

슬라이드 1

2013년 1회 정보처리산업기사 실기.hwp

02 C h a p t e r Java

Microsoft PowerPoint - LN_1_ARM_CPU_0.ppt [호환 모드]

<목 차 > 제 1장 일반사항 4 I.사업의 개요 4 1.사업명 4 2.사업의 목적 4 3.입찰 방식 4 4.입찰 참가 자격 4 5.사업 및 계약 기간 5 6.추진 일정 6 7.사업 범위 및 내용 6 II.사업시행 주요 요건 8 1.사업시행 조건 8 2.계약보증 9 3

<4D F736F F F696E74202D20BBB7BBB7C7D15F FBEDFB0A3B1B3C0B05FC1A638C0CFC2F72E BC8A3C8AF20B8F0B5E55D>

q ARM (Advanced RISC Machines) v 1990년설립 v UK-based joint venture Ø Apple Computer, Acorn Computer Group, and VLSI Technology q 32-bit RISC Intellectu

PowerPoint 프레젠테이션

DE1-SoC Board

[8051] 강의자료.PDF

Microsoft Word - FunctionCall

(SW3704) Gingerbread Source Build & Working Guide

ARM01

1217 WebTrafMon II

(Asynchronous Mode) ( 1, 5~8, 1~2) & (Parity) 1 ; * S erial Port (BIOS INT 14H) - 1 -

INTRO Basic architecture of modern computers Basic and most used assembly instructions on x86 Installing an assembly compiler and RE tools Practice co

ARM 아키텍쳐 - ARM 아키텍쳐 - Programming 모델 - ARM 프로세서명령어 - 예외처리와시스템리셋 - ARM9TDMI 프로세서 한국기술교육대학교 전기전자통신공학부 장영조 한국기술교육대학교임베디드 SOC 설계및실습

PowerPoint 프레젠테이션

untitled

임베디드 시스템 구조

JMF2_심빈구.PDF

알람음을 출력하는 이동통신 단말기에 있어서, 실시간 알람음을 출력하는 음향 출력 수단; 디지털 멀티미디어 방송(DMB: Digital Multimedia Broadcasting, 이하 'DMB'라 칭함) 신호를 수신하면 오디오 형태로 변 환하여 DMB의 음향을 전달하는

PowerPoint 프레젠테이션

MicrocontrollerAcademy_Lab_ST_040709

Mango220 Android How to compile and Transfer image to Target

untitled

9

MAX+plus II Getting Started - 무작정따라하기

EmbeddedSoC_1주차.PDF

CANTUS Evaluation Board Ap. Note

Microsoft Word - KIS_Touchscreen_5Apr11_K_2.doc

1

Microsoft Word - ExecutionStack

IDA 5.x Manual hwp

Manufacturing6

<4D F736F F F696E74202D20322DBDC7BDC3B0A320BFEEBFB5C3BCC1A6>

Figure 5.01

김기남_ATDC2016_160620_[키노트].key

hd1300_k_v1r2_Final_.PDF

R50_51_kor_ch1

s SINUMERIK 840C Service and User Manual DATA SAVING & LOADING & & /

Remote UI Guide

< B3E2C1A632C8B8BFF6B5E531B1DE42C7FC2E687770>

MPLAB C18 C

wp1_ hwp

ARM 프로세서 입문

프로그램을 학교 등지에서 조금이라도 배운 사람들을 위한 프로그래밍 노트 입니다. 저 역시 그 사람들 중 하나 입니다. 중고등학교 시절 학교 도서관, 새로 생긴 시립 도서관 등을 다니며 책을 보 고 정리하며 어느정도 독학으르 공부하긴 했지만, 자주 안하다 보면 금방 잊어

untitled

LCD Monitor

Integ

歯MW-1000AP_Manual_Kor_HJS.PDF

(72) 발명자 이동희 서울 동작구 여의대방로44길 10, 101동 802호 (대 방동, 대림아파트) 노삼혁 서울 중구 정동길 21-31, B동 404호 (정동, 정동상 림원) 이 발명을 지원한 국가연구개발사업 과제고유번호 부처명 교육과학기술부

Chap04(Signals and Sessions).PDF

SRC PLUS 제어기 MANUAL

歯2350h.PDF

2014_트렌드씨_웹용_1월_s

??뀁?뀁?

<BBEABEF7B5BFC7E22DA5B12E687770>

Analytics > Log & Crash Search > Unity ios SDK [Deprecated] Log & Crash Unity ios SDK. TOAST SDK. Log & Crash Unity SDK Log & Crash Search. Log & Cras

목차 1. 개요 USB 드라이버 설치 (FTDI DRIVER) FTDI DRIVER 실행파일 USB 드라이버 확인방법 DEVICE-PROGRAMMER 설치 DEVICE-PROGRAMMER

(72) 발명자 서진교 경기 용인시 수지구 풍덕천2동 1167 진산마을 삼성5차아파트526동 1004호 조필제 경기 용인시 풍덕천동 유스빌 401호 - 2 -

10X56_NWG_KOR.indd

<B1E2BCFAB9AEBCAD28C0CCB5BFBCF6295F F6F6B696E672E687770>

PCServerMgmt7

No Slide Title

훈련교재 목록-내지-0520.indd

untitled

Windows Embedded Compact 2013 [그림 1]은 Windows CE 로 알려진 Microsoft의 Windows Embedded Compact OS의 history를 보여주고 있다. [표 1] 은 각 Windows CE 버전들의 주요 특징들을 담고

FARA PLC N70plus 시스템 사용자 메뉴얼

APOGEE Insight_KR_Base_3P11

VxWorks소개 및 디버깅 환경.ppt

임베디드시스템설계강의자료 6 system call 1/2 (2014 년도 1 학기 ) 김영진 아주대학교전자공학과

PowerPoint 프레젠테이션

Microsoft PowerPoint - Introduction.pptx

목차 1. 제품 소개 특징 개요 Function table 기능 소개 Copy Compare Copy & Compare Erase

Ä¡¿ì³»ÁöÃÖÁ¾

<31325FB1E8B0E6BCBA2E687770>

Chap06(Interprocess Communication).PDF

untitled

2. GCC Assembler와 AVR Assembler의차이 A. GCC Assembler 를사용하는경우 i. Assembly Language Program은.S Extension 을갖는다. ii. C Language Program은.c Extension 을갖는다.

일반적인 네트워크의 구성은 다음과 같다

example code are examined in this stage The low pressure pressurizer reactor trip module of the Plant Protection System was programmed as subject for

ODS-FM1

PRO1_16E [읽기 전용]

PWR PWR HDD HDD USB USB Quick Network Setup Guide xdsl/cable Modem PC DVR 1~3 1.. DVR DVR IP xdsl Cable xdsl Cable PC PC DDNS (


Orcad Capture 9.x

Transcription:

Page 1 of 23 Additional Resources: µc/os-ii Author: Source: HiTEL Digital Sig Date: 2004929 µ (1) uc/os-ii RTOS uc/os-ii EP7209 uc/os-ii, EP7209 EP7209,, CPU ARM720 Core CPU ARM7 CPU wwwnanowitcom10 ' ' uc/os-ii, 1 2 3 Stack 4 OSTaskStkInit 5 IRQ OSTickISR 6 OSStartHighRdy 7 OSCtxSw 8 OSIntCtxSw 9 http://wwwpldworldcom/_altera/html/_excalibur/ucos-ii/ucos-ii_portinghtm

Page 2 of 23 (2) EP7209 ARM7 StrongARM uc/os Context Switcher,, CPU EP7209 uc/os-ii wwwnanowitcom uc/os-ii 1 EP7209 CPU ARM720T 720 ARM7 MMU StrongARM MMU psos 25 ARM Software Development 251 Tool, ARM 1 Evaluation CD Linux, Linux SDT ARM7 C ASM 2 Board NANOWIT EP7209, 1Mega Byte Flash 375K SRAM RAM uc/os-ii, Serial Flash Write, uc/os Serial Timer 3 Kernel Source uc/os-ii labrosse, CPU Kernel 8086 wwwucos-iicom CPU ARM7 CPU,, ARM7 4 MicroC/OS-II (labrosse) http://wwwpldworldcom/_altera/html/_excalibur/ucos-ii/ucos-ii_portinghtm

Page 3 of 23, uc/os-ii, uc/os-ii 8 9 3 7 8 9, CPU, ARM7 5 ARM7 Data sheet EP7209 Data sheet ARM7, ARM7 CPU, CPU Data Sheet EP7209 Data Sheet IRQ, Serial ARM7, Core uc/os OS OS, OS, OS WinCE Embedded Linux, psos, VxWorks uc/os-ii OS, Linux, uc/os, (3) Stack uc/os RTOS Multi-Tasking Time Sharing,, CPU ( ) OS,? Context Switching CPU http://wwwpldworldcom/_altera/html/_excalibur/ucos-ii/ucos-ii_portinghtm

Page 4 of 23,, 8086 CPU 1 2 3 4 ( - ) 5 6,, Multi-Tasking CPU 10, CPU ( ) Tasking 1 1 1 2, 3, 4 10 1 ( CPU ),,, 3, CPU, Multi-Tasking,,? 10 10, 1, CPU C, Single-Tasking, Multi-Tasking?, Task Stack Task,?, Multi-Tasking, Task Stack,, Context Switching,, http://wwwpldworldcom/_altera/html/_excalibur/ucos-ii/ucos-ii_portinghtm

Page 5 of 23 RTOS Multi-Tasking Task Task Process Thread (?) CPU RTOS Task, Task TCB Task Control Block TCB Task Stack Task Task Priority Multi-Tasking Stack, Context Switching, Task Stack OS OS, uc/os CPU C Context Switcher Stack,,, Linux psos uc/os CPU CPU,,, Task Context Switching, Task * ARM7 Context Context CPU ARM Context? ARM r0-r12, r13 (sp), r14 Link r15 r0-r12, Stack 8086 Stack 226Page Stack (High Memory) 15 r15(pc) 14 r14(lr) 13 r12 12 r11 11 r10 10 r9 9 r8 8 r7 7 r6 6 r5 5 r4 4 r3 3 r2 2 r1 1 r0 http://wwwpldworldcom/_altera/html/_excalibur/ucos-ii/ucos-ii_portinghtm

Page 6 of 23 0 CPSR <- ptcb->ostcbstkptr Stack (Low Memory) CPSR ARM7 Flag? Task A Task TCB TCB ptcb ptcb- >OSTCBStkPtr Task CPU r13 r13 ARM7?, Task, ptcb- >OSTCBStkPtr r13, r13 TCB, r13 r15 r15,, JUMP, r15 Task ( Linux psos uc/os OS Linux ) (4) OSTaskStkInit uc/os C 8086, lx86l 8086 Os_cpu_cc OSTaskStkInit Hook,, C OSTaskStkInit http://wwwpldworldcom/_altera/html/_excalibur/ucos-ii/ucos-ii_portinghtm

Page 7 of 23 OSTaskStkInit * OSTaskStkInit Task? Task TCB, TCB Task Stack, Task,, TCB Stack OSTaskStkInit Task uc/os, Task OSTaskCreate RTOS Task Visual C Java Thread OSTaskCreate OS_Taskc OSTaskCreate INT8U OSTaskCreate (void (*task)(void *pd), -> 1 void *pdata, -> 2 OS_STK *ptos, -> 3 INT8U prio) -> 4, Task, Task, Task Task, Task, Task, Task Task ( ),,?, Context Switching "Context Switching,, ", Task,, Task Task?,?, Stack TASK Ready Q, Task TCB CPU Task Stack '? http://wwwpldworldcom/_altera/html/_excalibur/ucos-ii/ucos-ii_portinghtm

Page 8 of 23 OSTaskStkInit Stack Task * OSTaskStkInit, Stack Stack Ready Q ( Task ) ' ' Stack (High Memory) 15 r15(pc) 14 r14(lr) 13 r12 12 r11 11 r10 10 r9 9 r8 8 r7 7 r6 6 r5 5 r4 4 r3 3 r2 2 r1 1 r0 0 CPSR <- ptcb->ostcbstkptr Stack (Low Memory) OSTaskStkInit 01: void * OSTaskStkInit(void (*task)(void *pd),void *pdata, 02: void *ptos,int16u opt) 03: { 04: INT32U *stk; 05: opt = opt; 06: stk = (INT32U *)ptos; 07: *(--stk) = (INT32U)task; // r15 08: *(--stk) = (INT32U)0; // r14 09: *(--stk) = (INT32U)0; // r12 10: *(--stk) = (INT32U)0; // r11 11: *(--stk) = (INT32U)0; // r10 12: *(--stk) = (INT32U)0; // r9 13: *(--stk) = (INT32U)0; // r8 14: *(--stk) = (INT32U)0; // r7 15: *(--stk) = (INT32U)0; // r6 16: *(--stk) = (INT32U)0; // r5 17: *(--stk) = (INT32U)0; // r4 18: *(--stk) = (INT32U)0; // r3 19: *(--stk) = (INT32U)0; // r2 20: *(--stk) = (INT32U)0; // r1 21: *(--stk) = (INT32U)pdata; // r0 http://wwwpldworldcom/_altera/html/_excalibur/ucos-ii/ucos-ii_portinghtm

Page 9 of 23 22: *(--stk) = (INT32U)0; // CPSR 23: return ((void *)stk); 24: } 24,? OSTaskStkInit Task, Task CPU Program Counter Task Stack, 4 8086 INT16U *stk; INI32U ARM7 32, 5, 6 stk 7 22 *(--stk), Full & Decrement Stack r15 r0, CPSR r15, Task r15 Task r14 r1 r13 sp r0 pdata 8086, C 8086 Stack ARM, r0 pdata r0 C ARM7,,, ' ',?,,,,, http://wwwpldworldcom/_altera/html/_excalibur/ucos-ii/ucos-ii_portinghtm

Page 10 of 23, (5) IRQ OSTickISR IRQ uc/os RTOS, RTOS RTOS, 1/100 OSTimeTick, OSTickISR, 1/100, OSTimeTick, Timer Context Switching TaskA, 100 Tick Block, Block, TaskB Ready TaskB TaskB 100 Tick, TaskA TaskB TaskA Context Switching Tick RTOS, 1 Timer 1/100, 100 Tick 1, 100 Tick Context Switching Tick, 100,? Stack A A? (Stack), Context Switching,?, Context Switching, Context Switching, Context Switching, http://wwwpldworldcom/_altera/html/_excalibur/ucos-ii/ucos-ii_portinghtm

Page 11 of 23!!!!!! Stack Context Switching? Stack r15 r0, CPSR ARM7 ARM7 Data Sheet EP7209 6 Supervisor -, IRQ, CPU IRQ, r13 r14 IRQ r13 Stack Pointer, IRQ Stack?, Task Stack, IRQ SVC r13, 8086, ARM, ARM ----------------------------------- 01: IRQHandler 02: stmfd sp!,{r0-r3} 03: mov r1,#register_base 04: ldr r2,=intsr1 05: ldr r0,[r1,r2] 06: tst r0,#0x100 07: bne TimerIRQ ; Check Timer IRQ 08: ldmfd sp!,{r0-r3} 09: subs pc,lr,#4 10: TimerIRQ 11: ldr r2,=tc1eoi ; Timer 1 Interrupt Clear 12: str r0,[r1,r2] 13: 14: mov r2,sp ; copy IRQ's sp -> r2 15: add sp,sp,#16 ; recover IRQ's sp 16: sub r3,lr,#4 ; copy return address -> r3 17: 18: LDR r0,=irq_2 19: MOVS pc,r0 20: IRQ_2 21: stmfd sp!,{r3} ; push SVC's pc 22: stmfd sp!,{r4-r12,lr} ; push SVC's r14, r12-r4 23: mov r4,r2 24: ldmfd r4!,{r0-r3} 25: stmfd sp!,{r0-r3} ; push SVC's r3-r0 http://wwwpldworldcom/_altera/html/_excalibur/ucos-ii/ucos-ii_portinghtm

Page 12 of 23 26: mrs r5,cpsr 27: stmfd sp!,{r5} ; push SVC's PSR 28: B OSTickISR ; Real Body ----------------------------------- Timer IRQ, Vector Table 01, IRQ 1 CPU IRQ, 2 r13 r14 IRQ, 3 IRQ CPSR SPSR, CPSR IRQ 4 irq r14 ' +4' ARM7 Exception 2 stmfd sp!,{r0-r3} r0 r3 4?! IRQ, SVC Task 3 6, IRQ Timer IRQ EP7209 5 r0 IRQ, 6 Timer IRQ, 10 8,9 IRQ Return IRQ 10, 11,12, CPU, IRQ, 14 Stack r0 r3 IRQ IRQ,, 14, r0-r3 IRQ 14 mov r2,sp r2 IRQ IRQ SVC, r0 r3 15 add sp,sp,#16, IRQ, IRQ sp,, 16 sub r3,lr,#4 lr, r14_irq? ' +4' r3? r3 IRQ SVC IRQ r14 r13_irq(sp) r2 http://wwwpldworldcom/_altera/html/_excalibur/ucos-ii/ucos-ii_portinghtm

Page 13 of 23 18: LDR r0,=irq_2 19: MOVS pc,r0 20: IRQ_2 IRQ SVC MOVS pc IRQ_2,, IRQ SVC, IRQ 1 SPSR IRQ PSR CPSR 2 r13 r14 SVC r13 r14 (1) CPSR IRQ IRQ IRQ IRQ (2), r13 add sp,sp,#16 stmfd 21 stmfd sp!,{r3} r3 Stack Stack??? IRQ SVC Task!!!, r15 r3? sub r3,lr,#4 r3 (!!!) 22 stmfd sp!,{r4-r12,lr} ARM? r14 r4 r12, Stack? r0 r3 irq? IRQ IRQ? r2 IRQ sp r0 r3 IRQ 23,24 25 Task r0-r3? CPSR CPSR Stack, r5 Stack 26, 27!!! IRQ Stack?, TT http://wwwpldworldcom/_altera/html/_excalibur/ucos-ii/ucos-ii_portinghtm

Page 14 of 23,!!! 8086, 28 OSTickISR Pseudocode OSTaskISR 1 2 OSIntEnter(), OSIntNesting 3 OSTimeTick() 4 OSIntExit() 5 6 (1) IRQ (2) OSTickISR ----------------------------------- 01: OSTickISR 02: LDR r0,=osintnesting ; Notify uc/os-ii of ISR 03: LDRB r1,[r0] 04: ADD r1,r1,#1 05: STRB r1,[r0] 06: BL OSTimeTick ; Process system tick 07: BL OSIntExit ; Notify uc/os-ii of end of ISR 08: LDMFD sp!,{r0} 09: MSR CPSR_xsf,r0 10: LDMFD sp!,{r0 - r12, lr, pc} ----------------------------------- 2-5 OSIntNesting++ 6 OSTimeTick(), 7 OSIntExit 8 10 ( ) Stack 8 CPSR (9 ), 10 IRQ ARM7 uc/os-ii ARM7 uc/os-ii 70% http://wwwpldworldcom/_altera/html/_excalibur/ucos-ii/ucos-ii_portinghtm

Page 15 of 23 (6) OSStartHighRdy OSStartHighRdy uc/os 198 Page OS_CPU_AASM OSStartHighRdy uc/os Task uc/os? 01: void main (void) 02: { 03: PC_DispClrScr(DISP_FGND_WHITE + DISP_BGND_BLACK); 04: OSInit(); 05: PC_DOSSaveReturn(); 06: PC_VectSet(uCOS, OSCtxSw); 07: RandomSem = OSSemCreate(1); 08: OSTaskCreate(TaskStart, (void *)0, 09: (void *)&TaskStartStk[TASK_STK_SIZE - 1], 0); 10: OSStart(); 11: } 8086 main 8 Task, 10 OSStart, OSStartHighRdy, OSStartHighRdy Context Switching, Task Context Switching Task, Task Stack, OSStartHighRdy Task,? OSStartHighRdy OSStartHighRdy 5 1 OSTaskSwHook() 2 Task Stack Point sp 3 OSRunning TRUE 4 sp 5 Task, ----------------------------------- 01: OSStartHighRdy 02: BL OSTaskSwHook 03: LDR r0,=osrunning http://wwwpldworldcom/_altera/html/_excalibur/ucos-ii/ucos-ii_portinghtm

Page 16 of 23 04: MOV r1,#1 05: STRB r1,[r0] 06: LDR r0,=ostcbhighrdy 07: LDR r0,[r0] 08: LDR sp,[r0] 09: LDMFD sp!,{r0} 10: MSR CPSR_xsf,r0 11: LDMFD sp!,{r0 - r12, lr, pc} ----------------------------------- 2 Hook, 3-4 OSRunning TRUE 6-8 TCB Task Stack sp 9-11 Task Stack 5, (7) OSCtxSw OSCtxSw OSCtxSw() os_cpuh OS_TASK_SW() OS_TASK_SW() OSSched() 8086 #define OS_TASK_SW() asm INT ucos, ARM7 INT SWI, 8086 OSCtxSw OSSched() uc/os Task, Task Task OSCtxSw Context Switching http://wwwpldworldcom/_altera/html/_excalibur/ucos-ii/ucos-ii_portinghtm

Page 17 of 23, Task OSIntCtxSw,, OSCtxSw, OSStartHighRdy, Task, 201 OSCtxSw 1 Register Task Stack 2 Stack Pointer TCB OSTCBStkPtr 3 OSTaskSwHook() 4 OSTCBCur = OSTCBHighRdy 5 OSPrioCur = OSPrioHighRdy 6 Task Stack Pointer sp 7 8 Task (1),(2) (3) User Hook, (4) (5) OSTCBCur Task TCB OSTCBHighRdy ReadyQ Task TCB, uc/os, Task, OSSched(), OS_TASK_SW(), Context Switching OSCtxSw Context Switching, (4) (5) (6) (8) OSStartHighRdy() Task ----------------------------------- 01: OSCtxSw 02: STMFD sp!,{lr} 03: STMFD sp!,{r0 - r12, lr} 04: MRS r0,cpsr 05: STMFD sp!,{r0} 06: LDR r0,=ostcbcur 07: LDR r0,[r0] 08: STR sp,[r0] 09: BL OSTaskSwHook 10: LDR r0,=ostcbcur 11: LDR r1,=ostcbhighrdy 12: LDR r2,[r1] 13: STR r2,[r0] 14: LDR r0,=ospriocur 15: LDR r1,=ospriohighrdy http://wwwpldworldcom/_altera/html/_excalibur/ucos-ii/ucos-ii_portinghtm

Page 18 of 23 16: LDRB r3,[r1] 17: STRB r3,[r0] 18: LDR sp,[r2] 19: LDMFD sp!,{r0} 20: MSR CPSR_xsf,r0 21: LDMFD sp!,{r0 - r12, lr, pc} ----------------------------------- 1 5 (1) 6 8 (2) OSTCBCur->OSTCBStkPtr=sp 9 (3) Hook 10 13 (4), (5) OSTCBCur = OSTCBHighRdy OSPrioCur = OSPrioHighRdy 18 (6) Task Stack sp 19,20,21 Stack Task, 2 (8) OSIntCtxSw OSIntCtxSw uc/os,,, uc/os Context Switching OSCtxSw OSIntCtxSw, OSCtxSw, OSIntCtxSw OSCtxSw, Call, Context Switching Context Switching http://wwwpldworldcom/_altera/html/_excalibur/ucos-ii/ucos-ii_portinghtm

Page 19 of 23 OSCtxSw, CPU, Task, Call OSIntCtxSw,, OSIntExit Context Switching OSIntCtxSw OSIntCtxSw Task ( ) CPU, Context Switching Task Task 201 1 ( ) 2 Stack Pointer TCB OSTCBStkPtr 3 OSTaskSwHook 4 OSTCBCur = OSTCBHighRdy 5 OSPrioCur = OSPrioHighRdy 6 Task Stack Pointer sp 7 8 Task OSCtxSw, (1) OSCtxSw 1 Register Task Stack 2 (1) 4, CPU 3, Stack (High Memory) 15 r15(pc) 14 r14(lr) 13 r12 12 r11 11 r10 10 r9 9 r8 8 r7 7 r6 http://wwwpldworldcom/_altera/html/_excalibur/ucos-ii/ucos-ii_portinghtm

Page 20 of 23 6 r5 5 r4 4 r3 3 r2 2 r1 1 r0 0 CPSR <- ptcb->ostcbstkptr Stack (Low Memory),,, sp OSIntCtxSw sp CPSR sp OSIntCtxSw (2) TCB OSTCBStkPtr (1) OSTickISR LDR r0,=osintnesting LDRB r1,[r0] ADD r1,r1,#1 STRB r1,[r0] BL OSTimeTick BL OSIntExit <- OSIntCtxSw LDMFD sp!,{r0} MSR CPSR_xsf,r0 LDMFD sp!,{r0 - r12, lr, pc} 4 OSIntExit, OS_Corec OSIntExit, OSIntExit, OSIntCtxSw, OSIntExit OSIntCtxSw, OSIntExit lr OSTickISR OSIntExit lr lr OSIntExit lr,, 01: OSIntCtxSw 02: ADD sp,sp,#4 http://wwwpldworldcom/_altera/html/_excalibur/ucos-ii/ucos-ii_portinghtm

Page 21 of 23 03: LDR r0,=ostcbcur 04: LDR r0,[r0] 05: STR sp,[r0] 06: BL OSTaskSwHook 07: LDR r0,=ostcbcur 08: LDR r1,=ostcbhighrdy 09: LDR r2,[r1] 10: STR r2,[r0] 11: LDR r0,=ospriocur 12: LDR r1,=ospriohighrdy 13: LDRB r3,[r1] 14: STRB r3,[r0] 15: LDR sp,[r2] 16: LDMFD sp!,{r0} 17: MSR CPSR_xsf,r0 18: LDMFD sp!,{r0 - r12, lr, pc} OSIntCtxSw 3 OSCtxSw 6 OSIntCtxSw 3 ADD sp,sp,#4 ARM 32, OSTickISR 4 (9) uc/os * OS_CPUH CPU ARM http://wwwpldworldcom/_altera/html/_excalibur/ucos-ii/ucos-ii_portinghtm

Page 22 of 23 - Type INT16U 16 unsigned, 86 unsigned int, ARM unsigned short - OS_STK_GROWTH OS_STK_GROWTH, ARM 1 Decrement Stack, IDLE Task - OS_ENTER_CRITICAL(), OS_EXIT_CRITICAL() Critical Section, CPSR I 1 splx() - OS_TASK_SW() 86 asm INT ucos, OSCtxSw() * EP7209 EP7209 SYSCON1,TC1D,INTMR1,TC1EOI SYSCON1 1 Prescale, 2KHz EP7209 Data Sheet 76 Page TC1D INTMR1 IRQ Enable, TC1EOI EP7209, ARM7 wwwucos-iicom ucos-ii ARM uc/os (?) Cirrus Logic EP7209 Processor Cirrus Logic Website http://wwwpldworldcom/_altera/html/_excalibur/ucos-ii/ucos-ii_portinghtm

Page 23 of 23 EP7209 Product Data Sheet (DEC '99, DS453PP2 : 212 Kb) EP7209 Development Kit Product Bulletin (JAN '00, DK453PP04 : 322 Kb) EP7209 Product Bulletin (DEC '99, PB453PP2 : 970 Kb) EP7209 Development Kit Quick Start User's Guide (SEP '01, DS453DKQS-1 : 463 Kb) Errata: EP7209 Data Sheet Change (JAN '00, ER453C1 : 6 Kb) Errata: EP7209 Rev D Silicon Change (JUN '00, ER453D1 : 12Kb) Send to a colleague Print this document ------------------- Copyleft 1998~2003,2004 Chang-woo YANG Last Modified: 09/30/2004 05:30:31 http://wwwpldworldcom/_altera/html/_excalibur/ucos-ii/ucos-ii_portinghtm