Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer System Laboratory

Similar presentations


Presentation on theme: "Computer System Laboratory"— Presentation transcript:

1 Computer System Laboratory
Lab3 SW Emulator

2 Experimental Goal Understand the basic process of bootloader & download this trivial bootloader to target board by Domingo Lab3 2019/4/26

3 Environment Host System Build System Target System Software
Windows XP/Ubuntu 8.04 Build System Ubuntu 8.04 Target System XScale PXA270 Software Bootloader source code Makefile & linker script Test program Microtime Domingo IDE You can download all the source codes from RSWiki CSL Course Software Lab3 2019/4/26

4 Equipment –PXA270 Lab3 2019/4/26

5 Introduction to ARM The ARM processor design is based on RISC principles Load-store architecture Fixed-length 32-bit instructions 3-address instruction formats The ARM processor has 37 registers, each of these registers is 32 bit wide 31 general-purpose registers & 6 status registers The ARM processor has 7 processor modes They are User, FIQ, IRQ, Supervisor, Abort, Undefined & System mode Mode changes can be made by writing directly to CPSR (explain later), or can be caused by exception arising The modes other than User mode are known as privileged modes The privileged modes other than System mode are known as exception modes Lab3 2019/4/26

6 Banked Registers The ARM processor has a different register bank for each processor mode, as shown in picture below Each column of picture shows which registers are visible in the indicated processor mode Banked registers are registers which are visible in particular processor mode Lab3 2019/4/26

7 Banked Registers (Cont.)
Lab3 2019/4/26

8 Program Status Registers
The ARM processor uses Current Program Status Register (CPSR) to monitor and control internal operations The bits at the bottom of the CPSR control the processor mode, instruction set (‘ T ’) & interrupt enables (‘ I ’ & ‘ F ’) and write to these bits in User mode are ignored Each exception mode has a Saved Program Status Register (SPSR), that is used to preserve the value of the CPSR when the associated exception occurs Lab3 2019/4/26

9 Exceptions The ARM processor has 7 exception types
The picture below shows the types of exception and the processor mode that is used to process each type When exception arises, execution is forced from a fixed memory address corresponding to the type of exception The fixed address are called the exception vectors Lab3 2019/4/26

10 Misc. On reset, the ARM processor starts up in Supervisor (SVC) mode, in ARM state, with IRQ and FIQ disabled, and then the processor fetches and executes code from 0x The Thumb instruction set is designed to allow better code density than ARM instruction set, we do not discuss it here There are many ARM software development tools on the market, such as ADS, RVDS, IAR EWARM & Keil MDK-ARM, but they are not free Recommended Reference Books ARM Architecture Reference Manual ARM System-on-Chip Architecture 2/e Lab3 2019/4/26

11 Exception Vectors Code
The instruction at each exception vector will usually contain a branch to the exception handler All GNU assembler directives have names that begin with a period (‘ . ’), they behave similarly to preprocessor directives in the C programming language .section "Vect" _reset_entry: b Reset_Handler b Undefined_Handler b SWI_Handler b Prefetch_Handler b Abort_Handler b IRQ_Handler b FIQ_Handler Lab3 2019/4/26

12 Initialization Code There are some tasks should be accomplished before calling C main function Initialize the memory system Initialize the stack pointers Copy the content of the initialized data section to specified address Reserve spaces for unitialized data section in RAM Tips init.s does not perform memory system initialization Use Domingo’s peripheral configuration manager instead for memory system initialization Need to use Domingo for running and debugging foo.c Lab3 2019/4/26

13 Linker Script The main purpose of the linker script is to control the memory layout of the executable Please refer to the website below According to our linker script (i.e. foo.ld), the executable should be downloaded to memory at 0xa Now, we can compile trivial bootloader Just download codes from RSWiki and make (check Lab1’s arm-elf toolchain path in PATH) The resulting foo.bin is the executable we want Lab3 2019/4/26

14 File Transfer If you did not create Build System, you need to switch to Windows to download bootloader using Domingo Use one of the following methods to transfer executable Install EXT2IFS, By R217 workstation By USB, , or else Lab3 2019/4/26

15 Hardware Setup Connect target board and ICE via JTAG
Connect RS232 null cable and parallel cable to your PC Connect Ethernet cable to your PC Connect target board and ICE via JTAG Lab3 2019/4/26

16 Introduction to Domingo
Domingo is an integrated development environment developed by Microtime Computer Inc. Domingo adopts visual project management which integrates with editor, compiler and debugger let you manage project just from a single environment Lab3 2019/4/26

17 Connect with Domingo Step1 : power on the board
Step2 : install Domingo IDE in Windows Step3 : start Domingo and choose No Project Lab3 2019/4/26

18 Connect with Domingo (Cont.)
Step4 : import creator_pxa270.pcm and click OK Lab3 2019/4/26

19 Download Executable to Board
Step1 : click Debug  Load Module Step2 : load foo.bin (load address 0xa ) Lab3 2019/4/26

20 Download Executable to Board (Cont.)
Step3 : change the PC value in registers Step4 : click Debug  Free Go You will see LED lighting Lab3 2019/4/26


Download ppt "Computer System Laboratory"

Similar presentations


Ads by Google