arm & ucos - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · real-time...

102
1 ARM & ARM & uCOS uCOS Ajou Ajou University University Real Real - - time Packet Analysis Lab. time Packet Analysis Lab. Chang Chang - - yeon, Cho. <[email protected]> yeon, Cho. <[email protected]> Copyright Copyright 2006 by iprinceps 2006 by iprinceps No parts of this document may be reproduced in any form, in an e No parts of this document may be reproduced in any form, in an e lectronic retrieval system or otherwise, lectronic retrieval system or otherwise, without the prior written permission of the publisher. without the prior written permission of the publisher.

Upload: nguyenthuan

Post on 06-Feb-2018

238 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

1

ARM & ARM & uCOSuCOS

AjouAjou UniversityUniversity

RealReal--time Packet Analysis Lab.time Packet Analysis Lab.

ChangChang--yeon, Cho. <[email protected]>yeon, Cho. <[email protected]>

Copyright Copyright ⓒⓒ 2006 by iprinceps2006 by iprincepsNo parts of this document may be reproduced in any form, in an eNo parts of this document may be reproduced in any form, in an electronic retrieval system or otherwise, lectronic retrieval system or otherwise, without the prior written permission of the publisher.without the prior written permission of the publisher.

Page 2: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

2

ARM ArchitectureARM Architecture

Page 3: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.3

ARM Architecture ARM Architecture –– About CompanyAbout Company

1985. Acorn Computer Group develops the world’s first commercial RISC processor1990. 12 ARM pins out of Acorn and Apple1991. the first embeddable RISC core ARM61993. TI, Cirrus, Samsung license ARM, ARM7 core1995. Thumb architecture, StrongARM1996. ARM9TDMI family announced1998. ARM10 family announced2002. ARM11

The industry's leading provider of 32-bit embedded RISC microprocessors with almost 75% of the market

Page 4: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.4

ARM Architecture ARM Architecture –– About ARM MPUAbout ARM MPU

ARM (Advanced RISC Machine) ArchitectureIt’s RISC (Reduced Instruction Set Computer)

Large uniform register fileLoad/store architectureSimple addressing modeUniform and fixed-length instruction field

In addition,Shift + ALU data processingAuto increment/decrement addressingLoad and store multipleConditional execution

CharacteristicSmall die size Low powerThumb instruction High code density

High Performance, Lower Cost, Less Power

Page 5: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.5

ARM Architecture ARM Architecture –– ProgressionProgression

T: Thumb extensionD: Debug extension M: Hardware multiplierI: Embedded ICE extensionE: DSP EnhancedJ: Java extensionV6: Media extension

ARM7

StrongARM

V4

ARM7TDMI

V4T

ARM920T

SecureCore

ARM9E

V5TE

ARM1020E

ARM926EJ

V5TEJ

V6

Page 6: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.6

ARM Architecture ARM Architecture –– Embedded ProductsEmbedded Products

Page 7: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.7

ARM Architecture ARM Architecture –– ARM7ARM7

ALE A[31:0] ABE

Increment B

usB

Bus

A B

us

AL

U

Bus

nENOUT DBE nENIN D[31:0]

Address Register

Add Inc

Register Bank(31x32 + 6 CPSR/SPSR)

32x8 MPY

Barrel Shifter

32-bit ALU

Write Data Register Read Data Register/IR & Decoder

Scan Control

InstructionDecoder

&ControlLogic

DBGRQIBREAKPTIDBGACKECLKnEXECISYNCBL[3:0]APEMCLKnWAITMAS[1:0]nIRQnFIQnRESETABORTnTRANSnMREQnOPCSEQLOCKnCPICPACPBnM[4:0]TBETBITHIGHZ

Page 8: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.8

ARM Architecture ARM Architecture –– PipelinePipeline

ARM7 Pipeline (3 stage)

Fetch : instruction 을 읽어옴

Decode : 읽어 온 instruction을 분석

Execution : 분석한 instruction 을 실행

FETCH DECODE EXECUTE

FETCH DECODE EXECUTE

FETCH DECODE EXECUTE

Page 9: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.9

ARM Architecture ARM Architecture –– PipelinePipeline

ARM9 Pipeline (5 stage)

Fetch : instruction 을 읽어옴

Decode : 읽어 온 instruction을 분석

Execution : 분석한 instruction 을 실행

Memory : 메모리 영역을 억세스

Write : 처리 결과를 레지스터에 저장

Page 10: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.10

ARM Architecture ARM Architecture –– ARM Core ComparisonARM Core Comparison

Cache(I/D)

MMU AHB Bus Thumb DSP Jazelle Clock

ARM7TDMI x x o o x x 133

ARM720T 8K Unified o o o x x 100

ARM920 16K/16K o o o x x 250

ARM940 4K/4K MPU o o x x 180

ARM926EJ Various o Dual o o o 220-250

ARM1020E 32K/32K o Dual o o x 325

ARM1020EJ Various MMU+MPU

Dual o o o 266-325

StrongARM 16K/16K o NA x x x 206

Xscale 32K/32K o NA o o x 400

Page 11: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

11

ARM ProgrammerARM Programmer’’s Models Model

Page 12: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.12

ARM ProgrammerARM Programmer’’s Model s Model –– Data TypesData Types

Supported Data TypesByte

8 bitsHalfword

16 bits (aligned to 2-byte boundaries)Word

32 bits (aligned to 4-byte boundaries)

NotesUnsigned: 0 ~ 2N – 1Signed: -2N-1 ~ +2N-1 – 1All data operations are performed on word quantitiesLoad/Store transfer B, HW, W with zero-extending and sign-extendingARM instruction are exactly 1 wordThumb instruction are exactly 1 halfword

Page 13: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.13

ARM ProgrammerARM Programmer’’s Model s Model –– Processor ModesProcessor Modes

User and System mode share one bank of registersException mode: their own registers

FIQ mode has private R8 ~ R14the other modes have private R13 ~ R14

Mode Description ID CommentsUser Normal program execution mode usr restriction

System Privileged mode for operating system sys OS taskFIQ When a fast interrupt fiq High-speed ch.IRQ When a normal interrupt irq

Supervisor Exception mode for operating system svc SWIAbort When data or instruction prefetch abort abt Vir. Mem, MProUndef When an undefined instruction und HW Emulation

Page 14: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.14

ARM ProgrammerARM Programmer’’s Model s Model –– ARM RegistersARM Registers

R0R1R2R3R4R5R6R7R8R9R10R11R12R13R14

PC(R15)

User & System FIQ IRQ Supervisor Abort Undef

R0R1R2R3R4R5R6R7

R8_fiqR9_fiq

R10_fiqR11_fiqR12_fiq

CPSR

PC(R15)

CPSR

R0R1R2R3R4R5R6R7R8R9R10R11R12

PC(R15)

CPSR

R0R1R2R3R4R5R6R7R8R9R10R11R12

PC(R15)

CPSR

R0R1R2R3R4R5R6R7R8R9R10R11R12

PC(R15)

CPSR

R0R1R2R3R4R5R6R7R8R9R10R11R12

R13_undR14_und

PC(R15)

CPSRSPSR_fiq

R13_abtR14_abt

SPSR_abt

R13_svcR14_svc

SPSR_svc

R13_irqR14_irq

SPSR_irq

R13_fiqR14_fiq

SPSR_fiq

Program Counter

Program Status Register

Page 15: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.15

ARM ProgrammerARM Programmer’’s Model s Model –– ARM RegistersARM Registers

R0R1R2R3R4R5R6R7R8R9

R10R11R12R13R14

PC(R15)

User & System FIQ IRQ Supervisor Abort Undef

R8_fiqR9_fiq

R10_fiqR11_fiqR12_fiq

CPSR

R13_undR14_und

SPSR_und

R13_abtR14_abt

SPSR_abt

R13_svcR14_svc

SPSR_svc

R13_irqR14_irq

SPSR_irq

R13_fiqR14_fiq

SPSR_fiq

Program Counter

Program Status Register

Totally 37 Registers = 31 GPR + 1 PC + 6 PSRs

Page 16: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.16

ARM ProgrammerARM Programmer’’s Model s Model –– ARM RegistersARM Registers

Unbanked Registers: R0 ~ R7Same to all modes

Banked Registers: R8 ~ R14R8 ~ R12

If simple interrupts -> FIQ can be very fast using only R8 ~ R14R13 ~ R14

R13– Usually used for Stack Pointer (SP)

R14– Usually used for Link Register (LR)– When subroutine call (BL, BLX), receives PC value– When exception, set to exception return address

R15: Program CounterThe value is the address of the instruction + 8 or 12

Page 17: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.17

ARM ProgrammerARM Programmer’’s Model s Model –– ARM RegistersARM Registers

Program Status Register (PSR)

CPSR (Current PSR): Hold the current status informationSPSR (Saved PSR): Reserve the CPSR during exceptions

Condition Code FlagsN Negative result from ALUZ Zero result from ALU

C ALU operation caused Carry

V ALU operation oVerflowed

Control bitsI 1: disables IRQF 1: disables FIQT 1: Thumb, 0: ARM

Mode bitsM[4:0] Mode

0b10000 User0b11111 System0b10001 FIQ0b10010 IRQ0b10011 Supervisor0b10111 Abort0b11011 Undefined

N Z C V I F T MReserved31 30 29 28 27 8 7 6 5 4 0

Control fieldExtension fieldStatus fieldFlag field

Page 18: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.18

ARM ProgrammerARM Programmer’’s Model s Model –– ARM RegistersARM Registers

N (Negative/Less Than Flag)연산 결과가 음수 1, 양수 0

Z (Zero Flag)연산 결과가 0 1, 0이 아니면 0

C (Carry/Borrow/Extend Flag)자리 올림이나 내림이 발생한 경우, Shift 연산 등에서 사용

Carry 가 발생할 경우 C = 1Borrow 가 발생할 경우 C = 0

V (Overflow Flag)연산의 결과 (덧셈, 뺄셈)가 오버플로우 되었을 경우 1

Status flags are updated only if a data processing instruction has the “S” bit set (ex. SUBS)

N Z C V I F T MReserved31 30 29 28 27 8 7 6 5 4 0

Control fieldExtension fieldStatus fieldFlag field

Page 19: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.19

ARM ProgrammerARM Programmer’’s Model s Model –– ExceptionsExceptions

Exception Type Priority Mode Vector High Vector0x00000000 0xFFFF0000

0xFFFF00040xFFFF00080xFFFF000C0xFFFF0010

Reserved 0x00000014 0xFFFF00140xFFFF00180xFFFF001C

0x000000040x000000080x0000000C

Data Abort 2 Abort 0x00000010

IRQ 4 IRQ 0x00000018FIQ 3 FIQ 0x0000001C

SupervisorUndefinedSupervisor

Abort

Reset 1Undefined Instruction 6

SWI 6Prefetch Abort 5

R14_<mode> = return addressSPSR_<mode> = CPSRCPSR[4:0] = exception mode numberCPSR[5] = 0 // in ARM stateIf <mode> == reset or FIQ

CPSR[6] = 1 // disable FIQCPSR[7] = 1 // disable IRQPC = vector address

CPSR = SPSR_<mode>PC = R14_<mode>

ByMOVS|SUBS PC, XX orLDM with Restore CPSR

When an exception occurs To return from exception

Page 20: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.20

ARM ProgrammerARM Programmer’’s Model s Model –– VectorsVectors

Exception handlers are entered via hardware vectorsLocated in the bottom 8 words of memory

Most vectors contain a branch instruction to jump to their handlerThe FIQ handler is in-line for maximum speed

Branch to Handler0x00

0x04

0x08

0x0c

0x10

0x14

0x18

0x1c

ResetUndefined InstructionSoftware InterruptPrefetch Memory AbortData Memory AbortReservedNormal InterruptFast Interrupt

Branch to HandlerBranch to HandlerBranch to HandlerBranch to HandlerBranch to Handler

FIQ Handler

Interrupt Handler

Branch to Handler

Page 21: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.21

ARM ProgrammerARM Programmer’’s Model s Model -- EndianEndian

Big Endian Processor : (Motorola, SPARC)High-order-byte-first, human-friendly type

Little Endian Processor: ( DEX VAX, Intel X86)Low-order-byte-first, computer-friendly type

RISC Microprocessors support Dual-Endiansince its simple instruction and operand type.

B0B1B2B3MSB LSB

B3B2B1B0N

N+1N+2N+3

Little Endian

Store 4Bytes Word to Memory at N

N+3N+2N+1N

Big Endian

B3B2B1B0

Page 22: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

22

Basic Startup CodeBasic Startup Code

Page 23: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.23

Startup Code Startup Code –– Exception Handler EntryException Handler Entry

Exception Handler Entry

Page 24: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.24

Startup Code Startup Code –– Initialization CodeInitialization Code

Initializing any critical devicesDisable Watch-dog Timer first.Disable Interrupt, or may cause spurious interrupt when enabled.

Initializing the memory systemBefore Interrupts are enabledBefore any code is called that access the RAM (e.g. Stack)

ResetHandlerldr r0,=BTCON ; Disable Watch-Dog Timerldr r1,=0xa507 strh r1,[r0]

ldr r0,=INTMASK ; All interrupt disableldr r1,=0x0 str r1,[r0]

LDR r4, =FMACON ; 2 clk, CPU holdingLDR r3, =0x82STRB r3, [r4]

ldr r0,=SMRDATAldmia r0,{r1-r3}ldr r0,=MEMCON0 ; BWSCON Addressstmia r0,{r1-r3}

Page 25: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.25

Startup Code Startup Code –– Initialization CodeInitialization Code

Initializing the stack pointerssp_SVC

always be initialized.sp_IRQ, sp_FIQ

Must be initialized if it’s used.sp_ABT, sp_UND

Must be initialized if it’s used.Not used in simple system.Initialized for debugging purposes.

sp_USRSet up stack pointer when changeto user mode to start Apps.

InitStacks mrs r0,cpsr bic r0,r0,#MODEMASK orr r1,r0,#UNDEFMODE|NOINT ; NOINT 0xc0 msr cpsr_cxsf,r1 ; UndefMode ldr sp,=UndefStack

orr r1,r0,#ABORTMODE|NOINT msr cpsr_cxsf,r1 ; AbortMode ldr sp,=AbortStack

orr r1,r0,#IRQMODE|NOINT msr cpsr_cxsf,r1 ; IRQMode ldr sp,=IRQStack

orr r1,r0,#FIQMODE|NOINT msr cpsr_cxsf,r1 ; FIQMode ldr sp,=FIQStack

bic r0,r0,#MODEMASK|NOINT orr r1,r0,#SVCMODE msr cpsr_cxsf,r1 ; SVCMode ldr sp,=SVCStack

; USER mode is not initialized. mov pc,lr

^ 0x80A000UserStack # _SVC_STKSIZESVCStack # _UND_STKSIZEUndefStack # _ABT_STKSIZEAbortStack # _IRQ_STKSIZEIRQStack # _FIQ_STKSIZEFIQStack # 0

Page 26: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.26

Startup Code Startup Code –– Initializing C environmentInitializing C environment

C environment .code section (RO) : Code and constant data..data section (RW) : Read and writable data..bss section (ZI) : Zero-out data.

0x0000_0000.code section

InitializedRW DataLoad

Image.

Flash ROM

.data section(RW secion)

.bss section(ZI section)

SDRAMZero-outthis area.

CopyInitializedRW Data.

#include <stdio.h>

int a;int b = 1234;int c = 0;

int main(){

printf(" a = %d\n", a);printf(" b = %d\n", b);printf(" c = %d\n", c);

}

a = 0 b = 1234 c = 0

Page 27: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.27

Startup Code Startup Code –– Initializing C environmentInitializing C environment

Section-related symbolsImage$${Section}$${Base/Limit}{Section} : RO, RW, ZI{Base/Limit} : Base or limit pointer

IMPORT |Image$$RO$$Limit| ; End of ROM code (=start of ROM data)IMPORT |Image$$RW$$Base| ; Base of RAM to initializeIMPORT |Image$$ZI$$Base| ; Base and limit of areaIMPORT |Image$$ZI$$Limit| ; to zero initializeIMPORT Main

LDR r0, =|Image$$RO$$Limit| ; Get pointer to ROM dataLDR r1, =|Image$$RW$$Base| ; and RAM copyLDR r3, =|Image$$ZI$$Base| ; Zero init base => top of initialised data

CMP r0, r1 ; Check that they are differentBEQ %F1

0CMP r1, r3 ; Copy init dataLDRCC r2, [r0], #4STRCC r2, [r1], #4BCC %B0

1LDR r1, =|Image$$ZI$$Limit| ; Top of zero init segmentMOV r2, #0

2CMP r3, r1 ; Zero initSTRCC r2, [r3], #4BCC %B2

.code section

InitializedRW Data

.data section(RW secion)

.bss section(ZI section)

Image$$RO$$Base

Image$$RO$$Limit

Image$$RW$$Base

Image$$ZI$$BaseImage$$RW$$Limit

Image$$ZI$$Limit

Page 28: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.28

Startup Code Startup Code –– Initializing C environmentInitializing C environment

Need not initializing the C environment

Boot Code

.data section(RW secion)

.bss section(ZI section)

Image$$RO$$Base

Image$$RW$$BaseImage$$RO$$Limit

Image$$ZI$$BaseImage$$RW$$Limit

Image$$ZI$$Limit

.code section

ApplicationImage

Boot Code copy the applicationImage from Flash ROM.

Page 29: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

29

OSOS

Page 30: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.30

OSOS

OS 란?Operating System의 약자

사전적 의미 : 효율적 조작을 목적으로 하는 제어 프로그램

일반 응용 프로그램들이 각자의 작업을 수행하기 위해 시스템 자원을 요구할 때 서로 간의 충돌 없이 효율적으로 사용할 수 있도록 자원을 관리하고 프로그램들의 작업 명령을 받아서 처리 하는 시스템 소프트웨어

Ex) DOS, Windows 98/NT, Mac OS, UNIX, Linux, OS/2…

Page 31: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.31

OS OS

RTOS 란?Real-Time Operating System의 약자

Real-Time Concepts

상대적인 관점임(vs. 일반적인 OS 처리)

극히 짧은 시간 내에 제공되어야 하는 서비스는 DSP나 ASIC 등으로 특화 되어H/W Real-Time으로 분류

일반적 의미 : 주어진 제약 시간 안에 할당된 일을 처리할 수 있는 S/W Real-Time을 의미

Cf) Hard real-time, Soft real-time

RT Systems : 제어 시스템에서, 요구하는 시간 내에 결과를 출력하는 시스템

Page 32: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.32

OS OS

RTOS 의 구조

H/W

S/WOS

Device Driver

Application

(Task)

Application

(Task)

Memory

Management

Comm.

Management

Task

Management

Time

Management

KernelScheduler

Page 33: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.33

OS OS

RTOS 의 적용 분야

RTOS는 여러 시스템에 적용되나 특히 임베디드 시스템에 많이 사용됨

일반 OS 시스템 설계보다 디자인이 더 어려움

시간 제약이 있는 시스템에 사용

영상, 의료, 음향 기계 등의 시간 의존적 시스템

흐름 제어, 엔진제어, 로봇 등의 자동화 시스템

복합 기능의 가전 기기 등

네트워크 접속, 고성능 전화 설비 등 통신 시스템

Page 34: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.34

OS OS –– 프로그래밍프로그래밍 방식방식 분류분류

순차적 단순 프로그래밍

간단한 제어 시스템에 유리

Ex) Foreground/Background 방식

OS를 기반으로 한 프로그래밍

일반적으로 큰 프로그램에 유리

프로그램의 모듈화가 용이함

Scheduler를 이용한 Multi-Task가 가능함

메모리/IO 등의 자원 관리가 쉬움

OS에 필요한 overhead(메모리, CPU 등) 존재

Ex) Dos, WinCE, pSOS, VxWorks, Embedded Linux, Nucleus, Xinu, IOS, uC/OS, eCOS 등

Page 35: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.35

OS OS –– FourgroundFourground/Background/Background

Background : Function을 이용하여 원하는 기능을 불러 프로그램을 무한 수행하는 것

Foreground : 인터럽트에 의해 ISR(Interrupt Service Routine)을 수행하는 것

Page 36: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.36

OS OS –– OS Based ProgrammingOS Based Programming

일반 Embedded OS 기반

PC와 같이 시간적으로 처리지연이 발생해도 문제가 없으며, 다양한 App. S/W가 지원되는 경우 유리

WinCE : 친숙한 개발환경, License, Guarantee…Embedded Linux : Free, 개발 환경 구축 필요

Real-Time OS 기반

정확한 처리시간이 필요한 임베디드 시스템에 적합

VxWorks : License, Guarantee…RTLinux : 일반 리눅스 커널의 Scheduler를 변경

In-house RTOS (자체 개발한 OS) : RTOS 시장의 50%이상으로 유료 or 무료

Page 37: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.37

OSOS

OS 의 기본 개념

Task, Resource, Event

Critical Section, Mutual Exclusion, Deadlock

Multi-Tasking, Context Switching

Kernel, Scheduler

Non-Preemptive, Preemptive

Priority, CPU Utilization

Synchronization

Inter-task Communication

Reentrancy

Interrupts, Clock Tick

Page 38: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.38

OSOS

Task, Resource, EventTask

= Thread

하나의 간단한 프로그램으로 CPU를 사용하는 작업

각각의 우선순위, 스택 영역을 가짐

Resource

태스크가 사용하는 Entity(프로세서, I/O, 메모리 등)

Shared Resource

여러 Task에 의해 공용되는 자원

Event

Task에게 작업을 시작하도록 지시할 수 있는 상황

신호나 메시지를 주고 받음

Page 39: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.39

OSOS

Critical Section, Mutual ExclusionCritical Section

여러 Task 들이 공유 자원에 접근하는 코드 부분

Mutual Exclusion

오류 방지를 위해 배타적으로 공유 자원을 사용함

방법 : Test & Set, Scheduler 정지, Semaphore 등

Deadlock

공유 자원 문제로 Task들이 서로 끝없이 기다리게 되는 상태를 말함

주로 대규모 Multi-Task Kernel에서 일어남

해결책 : 사전 자원 점유, 자원 해제 순위, Semaphore 등의 사용

Page 40: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.40

OSOS

Multi-TaskingScheduling을 통하여 Task를 전환하여 여러 작업들이 동시에 수행되는 것처럼 보이게 하는 것

모듈 구조의 Application을 제공

실시간 Application에서의 복잡성을 줄여줌

CPU의 활용도를 극대화

한 순간에 한 개의 Task 만이 수행 될 수 있으므로 다른 Task는 대기 준비 모드

Page 41: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.41

OSOS

Context SwitchingMulti-task가 가능하도록 Task를 바꾸기 위한 교환 과정

다른 Task를 수행하기 위해 현재 수행 중인 Task의 Context를 스택에 저장

새로운 태스크의 Context를 불러들임

실제 작업을 위한 시간이 아니므로 Overhead

* Context : CPU Register, Stack 등의 자원

Page 42: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.42

OSOS

KernelOS 핵심 기능의 집합체

Task간의 Communication, Task 관리를 위한 Multi-tasking 시스템 관리자

Context Switching과 같은 기본적인 서비스를 제공

CPU 사용률 향상을 위해 필수적으로 필요한 세마포어, 메일박스, 메시지큐, Time Delay등의 통신 방식 제공

선점, 비선점 커널

Page 43: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.43

OSOS

Scheduler다음 수행할 작업을 결정하는 커널의 한 부분

대부분의 실시간 커널은 우선순위에 기반

배타적 우선순위 방식

동일 우선순위 허용 방식

Kernel이 어떠한 Scheduling 방식을 채택했는가에 따라 분류

Non-Preemptive Kernel

Preemptive Kernel

Ex) Time Slice, Round-Robin, FIFO, EDF...

Page 44: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.44

OSOS

Non-Preemptive Kernel현재 진행중인 프로세스가CPU 사용을 포기하기 전까지는 다른 프로세스가 진입할 수 없는 구조

장점 : 짧은 Interrupt Latency

단점 : 나쁜 Task-Level Response

Page 45: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.45

OSOS

Preemptive Kernel높은 우선순위의 Task가 언제라도 CPU의 제어권을 넘겨 받을 수 있도록 대기

거의 모든 Real-time 시스템의 체제가 선점 커널을 사용

장점 : Deterministic

단점 : 자원 관리에 복잡한알고리즘이 필요

Page 46: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.46

OSOS

PriorityTask 처리의 우선 순위를 뜻함

Static Priorities : 컴파일 시에 결정되어 프로그램 수행 중에 바꿀 수 없는 우선순위 방식

Dynamic Priorities : 프로그램 수행 중에 우선 순위가 바뀔 수 있음

Priority Inversion Problem : Real-Time Kernel에서 많이 발생되는 문제

TASK1(H)

TASK2(M)

TASK3(L)(1)

(2) (3)

(4)

(5)

(6)

(7)

(8)

(9)

(10)

(11)

(12)

우선순위 역전

Task 3 GetsSemaphore

Task 1 PreemptsTask 3

Task 1 triesto get semaphore

Task 2 PreemptsTask 3

Task 3Resumes

Task 3 Releasesthe Semaphore

Page 47: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.47

OSOS

CPU Utilization

일반적으로 높은 우선순위의 작업이 작업 실행 횟수가 더 많음

Page 48: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.48

OSOS

Reentrancy코드의 재진입 가능여부를 나타냄

1개 이상의 Task가동작할 때 공유자원을 오류 없이 사용할수 있는 함수

Page 49: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.49

OSOS

Synchronization

Synchronization : Event 발생을 생성하거나 기다리게 하여 작업의 시작을맞추거나 알려주는 것

Semaphore등으로 신호를 전달할 수 있음

Page 50: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.50

OSOS

Event Flags여러 Event가 발생하였을 때Task의 동기화를 위한 장치

Disjunctive Sync. : Task 가어떠한 Event 에도 반응하여동기화 되는 것

Conjunctive Sync. : 모든Event가 다 발생해야지 동기화 되는 것

Page 51: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.51

OSOS

Inter-Task Communication= IPC(Inter Process Communication)

Task 혹은 ISR이 다른 Task 들과 정보 교환을 목적으로 통신하는 것

보통 전역 데이터나 메시지 전달 방식을 사용

전역 변수 사용시 접근의 배타성 확보 필요

통신 방법

Semaphore, Mutual Exclusion (MUTEX)

Mailbox, Message Queue

Event Flags

Page 52: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.52

OSOS

Interrupts하드웨어 메커니즘

불특정한 시간에 발생하는 Event에 대해 ISR을 만들어 이를 처리할 수 있게CPU 할당을 해주는 서비스

실시간 시스템에서는 가능한 한 Interrupt Disable Time이 적도록 해야 함

Interrupt Nesting

Interrupt Latency, Response, Recovery

NMI(Non-maskable Interrupts)

Page 53: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.53

OSOS

Clock TicksOS 의 모든 일은 Tick 단위로 처리됨

주기적인 특별한 인터럽트로 시스템의 심장

간격은 10~200ms사이

주기가 짧을수록 시스템에 부하를 많이 줌

Page 54: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

54

uCuC/OS/OS--IIII

Page 55: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.55

uCOSuCOS

uC/OS 란?Jean J. Labrosse의 저서인 “The Real-Time Kernel”에 속한 부록

Code가 몇 개의 파일로 되어 있는 가장 간단한 구조의 RTOS임

도서와 같이 제공되어 RTOS의 학습에 적합

최근 License를 부여하고 있으나 학습용에는필요 없음

Page 56: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.56

uCOSuCOS

uCOS 의 특징

코드의 대부분이 이식이 가능한 C로 구성

임베디드 시스템을 위해 OS의 ROM화 가능

옵션설정으로 메모리(ROM, RAM 등)의 크기 조정 가능

선점형 실시간 커널로서 동작하므로 높은 우선순위 태스크의 응답시간이 빠름

64개까지의 Multitasking 가능(8개는 시스템이 사용)

기능이나 서비스의 실행시간 예측 가능

Task의 Stack 크기를 각기 다르게 설정 가능

Stack 체크 기능이 있음

IPC(Event Flag, Mailbox, Message Queue, Semaphore, Mutex) 제공

Fixed-sized memory partition

Time-related function

255레벨의 Nesting Interrupts 가능

파일 시스템, Network에 대한 기본적인 지원이 되지 않음 3rd Party지원

or 유료 구현가능

Page 57: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.57

uCOSuCOS

uCOS-II 의 개요

Kernel Structure

Task, 스케줄링, 인터럽트, 시스템 초기화 등

Task Management

Task 의 생성, 우선순위 변경 등

Time Management

Task 의 Tick 카운터 관리 등

Intertask Communication

ISR, 공유자원 간의 내부적 통신(IPC) 등

Memory Management

동적메모리 할당, 고정 메모리 블록 등

Porting

Page 58: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.58

uCOSuCOS

Kernel StructureCritical Section

Tasks, Task State, Task Control Block

Ready List

Task Scheduling

Locking and Unlocking the Scheduler

Interrupt under uC/OS-II

Idle Task, Statistics Task, Clock Tick

uC/OS-II Initialization

Starting uC/OS-II

Page 59: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.59

uCOSuCOS

Kernel Structure – Critical SectionuC/OS-Ⅱ에서는 코드의 critical sections에 접근할 때 disable/enable interrupts 방법을 사용하여 보호

disable/enable interrupt를 위해 2개의 macros 지원OS_ENTER_CRITICAL( )OS_EXIT_CRITICAL( )

상기의 Macro는 processor specific하므로 OS_CPU.H 에서 포팅 필요

Page 60: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.60

uCOSuCOS

Kernel Structure – Critical Section:examplesx86에서의 인터럽트 Enable/Disable의 예

Method 1#define OS_ENTER_CRITICAL( ) asm CLI#define OS_EXIT_CRITICAL( ) asm STIa total of 4 cycles

Method 2#define OS_ENTER_CRITICAL( ) asm PUSHF;CLI#define OS_EXIT_CRITICAL( ) asm POPFOS_ENTER_CRITICAL : 12 clock cycles

OS_EXIT_CRITICAL : 8 clock cycles

Page 61: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.61

uCOSuCOS

Kernel Structure – Task States (1)

WAITING

DORMANT

READY RUNNING

ISR

OSMBoxPost()OSQPost()OSPostFront()OSSemPost()OSTaskRusume()OSTaskDlyResume()OSTimeTick()

OSMBoxPend()OSQPend()OSSemPend()OSTaskSuspend()OSTimeDly()OSTimeDlyHMSM()

OSTaskDel()

OSTaskDel()

OSTaskCreate()OSTaskCreateExt()

Preempted

OSStart()OSIntExit()

OS_TASK_SW()

Interrupt

OSIntExit()

Page 62: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.62

uCOSuCOS

Kernel Structure – Task States (2)DORMANT

Task가 ROM 또는 RAM에 있지만 OS에 등록이 되지 않은 상태

스스로 or 다른 Task에 의해 Delete된 상태

READY

수행되어야 할 Task들이 등록된 상태

언제라도 수행될 준비가 되어있는 상태

mulitasking은 OSStart()에 의해 시작

OSStart()에 의해 높은 우선순위 Task가 실행되기 위해 스케쥴링

RUNNING

하나의 task 만이 RUN 상태

WAITING

Task가 delay되면 WAITING 상태

Timer가 expire 될 수도 있고, Ready 상태로 갈 수도 있다.

ISR

RUNNING 상태의 Task는 인터럽트 가능

Page 63: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.63

uCOSuCOS

Kernel Structure – Task State : After OSInit()

0[0]0[1]0[2]000

0

[63]

0

[62]

0[61] 0

**

.

.

.

.

.

.

.

[3]

OSTCBStkptr

OSRCBStkBottom

OSTCBNextOSTCBPrev

OSTCBStkptr

OSRCBStkBottom

OSTCBNextOSTCBPrev

OSTCBPrioTbl[]

OS_TCB OS_TCB

OS_TaskStat() OS_TaskIdle()

Task Stack Task Stack

OSTCBList

00

Page 64: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.64

uCOSuCOS

Kernel Structure – OS_TCB Free List

OS_TCB OS_TCB OS_TCB

OSTCBFreeList 0

OS_MAX_TASKS

Page 65: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.65

uCOSuCOS

Kernel Structure – Ready List (1)각 Task는 실행되기 위에 OSRdyGrp and OSRdyTbl[] 에 등록됨

OSRdyTbl[]Table of tasks which are ready to run.INT8U OSRdyTbl[OS_LOWEST_PRIO/8 + 1]

OSRdyGrpEach bit represents a groupINT8U OSRdyGrp

그룹당 8개의 task를 가지고 있고, OSRdyTbl[ ]의 각 bit들은 task들에 대응

Ex. ) Bit i in OSRdyGrp is 1 when any bit in SRdyTbl[i] is 1.

Page 66: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.66

uCOSuCOS

Kernel Structure – Ready List (2)

Page 67: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.67

uCOSuCOS

Kernel Structure – SchedulinguC/OS_II 항상 가장 높은 우선 순위의 Task를 실행

scheduler : 가장 높은 우선 순위의 Task를 선정 작업

OSSched(): Task-level scheduling

OSIntExit(): ISR-level scheduling

Page 68: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.68

uCOSuCOS

Kernel Structure – Locking and UnlockingOSSchedLock()

이상의 scheduling을 방지함

호출된 이후에는 현재 Task를 suspend 시킬 수 없음

Ex: OSMboxPend(), OSTimeDly()…OSSchedLock()과 OSSchedUnLock() 은 항상 pair로 사용

OSLockNestingOSSchedLock() 이 불린 회수를 표시

OSLockNesting = 0 이면 scheduling이 가능한 상태임

Page 69: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.69

uCOSuCOS

Kernel Structure – Step of OSSched()Step1 : OSSched()가 ISR (i.e.,OSIntNesting > 0)이나 scheduling disabled (i.e., OSLockNesting > 0)상태인지 체크하여 맞다면, OSSched() 빠져나감

OSIntNesting is incremented in OSIntEnter().

OSLockNesting is incremented when your application called OSSchedLock() at least once.

Step2 : 아니면, Ready List 중 가장 높은 우선 순위의 Task를 실행 준비함

Step3 : 가장 높은 우선 순위 Task가 RUN 상태인지 체크

Step4 : 아니면, OS_TASK_SW() 를 호출하여 context switching 시작

Page 70: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.70

uCOSuCOS

Kernel Structure – Idle TaskμC/OS-Ⅱ는 항상 하나의 Task는 수행 중이어야 하므로 실제 일을 하지 않는 Task를 하나 수행함

OS_LOWEST_PRIO : 이 Idle Task의 우선순위는 가장 낮음

OSIdleCtr : Idle Task가 수행되면 계속 이 값을 증가 시키고 프로그램의CPU 사용률 측정에 사용

void OSTaskIdle (void *pdata) {pdata = pdata; for (;;) {

OS_ENTER_CRITICAL();OSIdleCtr++;OS_EXIT_CRITICAL();

}}

Page 71: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.71

uCOSuCOS

Kernel Structure – Statistic TaskOSTaskStat( )

OS_TASK_STAT_EN = 1로 설정하면 사용가능

매 초마다 값을 계산함

OSCPUUsage

– signed 8-bit integer 값으로 실제 값

– 프로그램에서 사용한 CPU Time을 %로 표시

OSIdleCtrMax : 지금까지 중 최대 사용값 표시

OSStatInit( )

위의 statistic task를 사용하기 위해서는 이 함수를 초기에 호출하여 설정하여야함

)1(100(%) axOSIdleCtrMOSIdleCtrOSCPUUsage −=

Page 72: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.72

uCOSuCOS

Kernel Structure – Servicing an INT

TASK TASK

TASK

Task ResponseInterrupt disabled

Interrupt Response

Vectoring

Saving ContextNotify kernel User ISR

codeNotify kernel

Restore Context

Return from interrupt

Interrupt RecoveryInterrupt Request

ISR signals a taskNew HPT

Interrupt RecoveryTask Response

No New HPT Or OSLockNesting>0

Return from interrupt

Notify kernel

Restore Context

Page 73: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.73

uCOSuCOS

Kernel Structure – OSIntEnter()OS에게 인터럽트에 진입함을 알려주기 위하여 OSIntEnter() 함수를 호출함

전역 변수인 OSIntNesting 를 증가하여 interrupt nesting을 표현

void OSIntEnter (void){

OS_ENTER_CRITICAL();OSIntNesting++;OS_EXIT_CRITICAL();

}

Page 74: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.74

uCOSuCOS

Kernel Structure – OSIntExit()ISR이 끝나면 OSIntExit() 를 호출하여 interrupt nesting counter값을 감소시킴

nesting counter = 0이면 인터럽트가 끝났으므로OS는 Highest Priority Task를 실행시키기 위해 scheduling을 함

Highest Priority Task가 실행준비가 되면 인터럽트에서 실행할 Task로 진입

Page 75: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.75

uCOSuCOS

Kernel Structure – OSIntCtxSw()Why not using OS_TASK_SW()?

인터럽트 수행시 이미 CPU register 등을 저장하였으므로 일의 양을 줄일 수 있음

OSIntCtxSw() 는 단순히 processor의 stack pointer(SP) 만 조정하면 됨

Page 76: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.76

uCOSuCOS

Kernel Structure – Clock Tick시스템의 심장인 Clock Tick은 특별한 주기 Timer Interrupt로서 사용

전형적으로 10 ~ 200ms를 주기로 사용함(PC의 경우 default tick rate = 18.20648Hz)

A tick source:

A hardware timer

AC power line(50/60HZ) signal

Ticker interrupts는 multitasking이 시작된 이후에 Enable 해야 함(crash 방지)

Page 77: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.77

uCOSuCOS

Kernel Structure – Delayed Tick

높은 우선 순위의 Task나 ISR을 실행시키기 위해 1Tick Delay가 필요할 수 있음

20ms

Tick Interrupt

Tick ISR

All HigherPriority Tasks

Delayed Task

19ms 17ms 27ms

Page 78: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

78

uCuC/OS/OS--IIII

Page 79: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.79

uCOSuCOS

Task Management최대 64개의 TASK를 관리

최상위, 최하위 우선순위의 TASK 4개씩 : 시스템용

각각의 Task는 Return Type과 Argument를 가지고 있지만 Return값을 전달하지않음

void yourTask(void *pdata){for(;;){

/* User Code */Osxxxx();

/* User Code */}

}

void yourTask(void *pdata){for(;;){

/* User Code */OSTaskDel(OS_PRIO_SELF);

}}

무한 반복형 Task 1회 수행형 Task

Page 80: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.80

uCOSuCOS

Task ManagementTask Creation

Task Deletion

Change a Task’s Priority

Suspend and Resume a Task

Obtain Information about a Task

Page 81: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.81

uCOSuCOS

Task Management – Task CreationTASK들은 Multitasking의 시작 전이나 다른 TASK에 의해 생성

스택도 같이 생성이 되며, 스택 영역은 C 컴파일의 malloc()과 같은 기능의함수로 동적 할당 가능

ISR(Interrupt Service Routine)에서는 TASK를 생성할 수 없음

Two functions for creating a task :

OSTaskCreate()

OSTaskCreateExt()

Page 82: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.82

uCOSuCOS

Task Management – Task StacksTask 함수의 외부에서 정의되어야 할 자료

정적으로 정의 할 경우

– static OS_STK MyTaskStack[stack_size];

– OS_STK MyTaskStack[stack_size];

동적으로 정의 할 경우

– malloc()

OS_STK *OS_STK *pstkpstk;;pstkpstk = (OS_STK *)= (OS_STK *)malloc(stack_sizemalloc(stack_size););if if pstkpstk !=(OS_STK*)0){!=(OS_STK*)0){ /*Make sure /*Make sure mallocmalloc() has enough space*/() has enough space*/

Create the task;Create the task;}}

Page 83: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.83

uCOSuCOS

Task Management – Task StacksStack grows

From low to high memory.

– OS_STK_GROWTH is set to 0 in OS_CPU.H

From high to low memory.

– OS_STK_GROWTH is set to 1 in OS_CPU.H

OS_STK OS_STK TaskStack[TASK_STACK_SIZETaskStack[TASK_STACK_SIZE];];OSTaskCreate(taskOSTaskCreate(task, , pdatapdata, &TaskStack[0], , &TaskStack[0], prioprio););

OS_STK OS_STK TaskStack[TASK_STACK_SIZETaskStack[TASK_STACK_SIZE];];OSTaskCreate(taskOSTaskCreate(task, , pdatapdata, &TaskStack[TASK_STACK_SIZE, &TaskStack[TASK_STACK_SIZE--1], 1], prioprio););

Page 84: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.84

uCOSuCOS

Task Management – FunctionsOSTaskDel() - Deleting a Task

Task를 삭제할 수 있는 함수

Task 스스로도 호출 가능

해당 Task는 DORMANT 상태로 진입

OSTaskDelReq()- Requesting to Delete a Task

해당 Task가 스스로 삭제되도록 요청

현재 수행중인 Task가 삭제되기를 요청하면 삭제될 수 있음

OSTaskChangePrio() – Changing a Task’s Priority

Task 생성시에 우선 순위가 결정되어 있음

그러나 이 함수를 사용하여 변경가능

우선순위 역전 현상을 해결가능

Page 85: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.85

uCOSuCOS

Task Management – FunctionsOSTaskSuspend() – Suspending a Task

Suspend된 task는 OSTaskResume()에 의해 다시 동작 가능한 상태로 변경됨

스스로 혹은 다른 Task를 Suspend 할 수 있음

주의 사항 : event (e.g., a message, a semaphore)를 기다리고 있는 Task의 경우에는 신호 전달에 문제 발생 주의

OSTaskResume() – Resuming a Task

OSTaskResume()을 호출하면 다시 동작 가능한 상태로 될 수 있음

OSTaskQuery() – Getting Info. about a Task

Tasks 그 자체나 다른 Task에 대한 기타 정보를 획득(OS_CFG.H에 정의한 Task 정보를 바탕)

원하는 Task의 OS_TCB의 정보를 갖고 있음

Page 86: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.86

uCOSuCOS

Time ManagementClock time을 이용

시간과 관련된 함수를 제공

OSTimeDly()

OSTimeDlyHMSM()

OSTimeDlyResume()

OSTimeGet()

OSTimeSet()

Page 87: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.87

uCOSuCOS

Intertask Communication & Sync.공유 데이터를 보호하고 TASK간의 통신을 위한 여러 가지 방법들

여러 TASK들이 사용하고 있는 데이터들이 임의로 변경되지 않도록 함

한 TASK가 만들어낸 정보를 다른 TASK가 이용하기 위하여 전달할 수 있는채널

synchronization과 coordination을 구현하기 위한 방법 semaphore

IPC를 구현 하는 방법 mailbox, message queue

기타 : Mutex., Event Flags

Page 88: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.88

uCOSuCOS

Intertask Communication & Sync.SemaphoreMailboxMessage QueueEvent FlagsMutex

Page 89: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.89

uCOSuCOS

IPC & Sync - SemaphoreSemaphore를 사용하기 전에 이 자원에 대한 생성이 필요

Semaphore 사용법(initial value 설정)

shared resource

n identical resources

5가지 semaphore service

OSSemCreate()

OSSemPend(), OSSemPost()

OSSemAccept(), OSSemQuery()

Page 90: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.90

uCOSuCOS

IPC & Sync – Relationships (Tasks, ISRs)

Task

ISR

OR

N

N

Task

OSSempend()

OSSemAccept()

OSSemQuery()

OSSemCreate()

OSSemPost()

OsSemPost()

OSSemAccept()

Page 91: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.91

uCOSuCOS

IPC & Sync – Message MailBoxTask가 독립적으로 움직이지만 이들 사이의 데이터 교환을 위한 통로가 필요

MailBox : Task간에 직접 data(message)를 주고 받는 데에 사용

하나의 message (mailbox is full)만 전달 가능

구성

message를 포함한 데이터 구조체를 가리키는 Pointer

대기 중인 TASK의 리스트

단순히 post와 pend 여부만을 검사하여 binary semaphore처럼도 사용 가능

Page 92: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.92

uCOSuCOS

IPC & Sync – Message MailBoxMailbox는 OS_MBOX_EN = 1로 하여야 사용가능

사용하기 전에 이 자원에 대한 생성이 필요

5가지의 Mailbox service

OSMboxCreate()

OSMboxPost()

OSMboxPend()

OSMboxAccept()

OSMboxQuery()

기능과 사용법은 Semaphore와 동일

Page 93: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.93

uCOSuCOS

IPC & Sync – Relationships

OSEventType*OSEventPtrOSEventTblOSEventGrp

ⅡMailbox

ECB

Message

Task

ISR

Task

OSMboxCreate()

OSMboxPost()

OSMboxPost()OSMboxAccept()

OSMboxPend()OSMboxAccept()OSMboxQuery()

Page 94: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.94

uCOSuCOS

IPC & Sync – Message QueueMessage mailbox의 array와 같음

OS_Q_EN = 1로 하여야 사용 가능

사용되기 전에 생성되어야 함

FIFO와 LIFO queue 모두 사용 가능

Resource의 개수만큼 message 포함 가능

Counting semaphore로 사용 가능

Page 95: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.95

uCOSuCOS

IPC & Sync – Message Queue

Task

ISR

Message Queue Task

Message*Message*Message*Message*Message*Message*Message*

OSQPost()OSQPostFront()OSQFlush()

OSQPost()OSQPostFront()OSQFlush()

* OSQPend()OSQAccept()OSQQuery()

ISR

OSQPend()OSQAccept()OSQQuery()

Size = NOSQCreate()

Page 96: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

96

ARM Development EnvironmentARM Development Environment

Page 97: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.97

ARM DevelopmentARM Development

ARM Major Components

Code Generation ToolsARM and Thumb

ANSI C Compilers

Embedded C++ Compilers

Assemblers, Linker

C and C++ runtime libraries

CodeWarrior IDEProject manager

Integrated build facilities

Integrated editor

GUI tool configuration

DebuggersGUI (AXD)

Command-line

Debug TargetsARMulator, Instruction Set Simulator

Angel debug monitor

Multi-ICE JTAG

ARM Firmware SuiteAngel debug monitor

MicroHAL

ARM Applications Library

DocumentationOnline – hypertext based

Hardcopy

On-line help

Page 98: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.98

ARM DevelopmentARM Development

Development Environment

ICE

Debug Host

Target Board

JTAG Cable

Parallel Port CableorUSB/Ethernet Cable

Serial Port Cable

Page 99: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.99

ARM DevelopmentARM Development

About Code Warrior for the ADSMetrowerks CodeWarior IDE version 4.0

ARM-specific configuration panels that enable you to Configure the ARM development tools

Project Manager

armccC Compiler

armasmAssembler

armlinkLinker

armlibLibrarian

Image Code runsource

*.c

*.s

*.o

*.o

*.axf

*.b

Page 100: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.100

ARM DevelopmentARM Development

Software Development ProcessC

소스파일어셈블리소스파일

컴파일러 어셈블러

형식변환기

ROMWriter

시뮬레이터에뮬레이터매스크 공정

링커

라이브러리처리기

오브젝트파일

오브젝트파일

라이브러리

실행파일

ROM,프로세서

하드웨어에뮬레이션

소프트웨어에뮬레이션

HEX파일

다운로더

시스템메모리

EPROM,프로세서

Page 101: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.101

ARM DevelopmentARM Development

ProjectNew Project

Executable Image, Object Library, Makefile Importer Wizard

Add Files to Project

Current Build TargetRelease

Debug

DebugRel

Page 102: ARM & uCOS - pds3.egloos.compds3.egloos.com/pds/200610/02/48/ucos-ii on arm.pdf · Real-time Packet Analysis Lab. 3 ARM Architecture – About Company 1985. Acorn Computer Group develops

Real-time Packet Analysis Lab.102

ARM DevelopmentARM Development

Build Target SettingTarget Settings

ARM C Compiler

Architecture or Processor

Byte order

Optimization Level

Preprocessor

ARM Linker

LinkType

RO base(0x0c100000)

RW base

ARM from ELF

Output format