Presentation is loading. Please wait.

Presentation is loading. Please wait.

OS porting onto MPX5200 Krishna Prakash Aravind Jakkani Malhar Mehta.

Similar presentations


Presentation on theme: "OS porting onto MPX5200 Krishna Prakash Aravind Jakkani Malhar Mehta."— Presentation transcript:

1 OS porting onto MPX5200 Krishna Prakash Aravind Jakkani Malhar Mehta

2 Agenda Problem Statement Hardware Building kernel image and board setup TFTP NFS Setup procedure Status Trade-offs Things we would do differently

3 Problem Statement Assist the Satellite Design Lab (SDL) of the Aerospace Engineering Department in setting up an embedded system development platform SDL team led by Henri Kjellberg under Dr. Lightsey's supervision Setup an OS on the CRX02 Platform running a FreescaleTM MPC5200 microprocessor that implements PowerPC ISA Provide features for compiling C code and executing the binary on the board

4 Problem Overview Long term impact – Board to be used as part of a closed loop simulation system o Host PC to send data via MATLAB through Serial Port to embedded system o Flight guidance navigation and control algorithms running on the board o Embedded system to process the data and provide feedback Establish serial communication between the board and Matlab

5 Hardware CRX02 Carrier Board o 18V – 30V Power Supply Input o One 100Mbit Ethernet Connectivity o Two serial ports o Two CAN ports o Two USB (USB 1.1) ports o Compact Flash slot MPX5200 Module o MPC5200 Microcontroller – 400MHz o 64MB DDR-SDRAM o 16MB Flash Memory o Two 208 pin MPX Connectors Power Supply with adapter, cables etc.

6 Hardware (2) External Requirements o RS-232C cable o Computer with a serial port and running HyperTerminal (Windows) / Kermit (Linux) or equivalent o A TCP-IP based Ethernet Network with 10/100 BaseT Cable Connection o A server offering TFTP / NFS protocol with Denx ELDK installed and available through NFS

7 MPC5200 Processor Based on MPC603e PowerPC® core Double Precision FPU Instruction and Data MMU 16K Instruction and 16K Data Caches 133 MHz DDR Interface (266 MHz effective) USB 1.1 Host Programmable Serial Controllers Serial Peripheral Interface (SPI) GPIO (up to 56) I2C, I2S PCI Version 2.2 10/100 Ethernet MAC

8 PowerPC 603e µP Part of PowerPC RISC Architecture Family Lower Power Implementation 52-bit Virtual Addressing, 32-bit Physical Addressing 8, 16, 32 bit Integer Data Types 32, 64 bit Floating-Point Data Types Four S/W controllable Power-saving modes: o Nap, Doze, Sleep – Static o Dynamic PM Superscalar processor – issues / retires up to 3 Instrs / cycle Supports OoOE

9 PowerPC 603e µP (2) Five Execution Units – IU, FPU (Pipelined), BPU, LSU, SRU Up to five instructions in parallel – High throughput / Performance Two Register Files: o 32 GPRs for integer operands o 32 FPRs for single or double precision operands 16K Instruction and 16K Data Cache o Four-way set-associative, physically addressed; LRU replacement algorithm o 64 Entry, two-way set-associative ITLB and DTLB Independent pipelines with feed forwarding – Reduces data dependencies

10 ELDK Embedded Linux Development Kit – From Denx Computer Systems Includes GNU cross development tools o Compilers, binutils, gdb etc Includes pre-built tools for PowerPC targets Available as open-source ELDK will be installed on the host machine and host the root file system of the board /target_cpu/ - root location for the board

11 ELDK (2) install script comes with the source o Used for initial installation o Allows parameter to specify install location and choose targets to install for o MPC5200 – ppc6xx target Exporting the root fs over NFS, requires running of ELDK_MAKEDEV and ELDK_FIXOWNER scripts o Scripts require superuser privileges on the host o MAKEDEV script creates necessary device nodes in the ELDK_root/target_cpu/dev directory o Some target utilities have same privileges as user who installs o Utilities like mount, su require superuser privileges to function correctly o FIXOWNER script fixes this if ELDK was installed by a user without superuser privileges

12 Building a Kernel Image MAKEDEV script creates basic nodes under /dev/ of the root location Create additional nodes as needed Download packed linux image available from open source repository o We have used linux-2.6.16.11 kernel Unpack the linux image to /usr/src There are patches available for CRX02 use for particular Kernel versions Download and apply the correct patch Set the PATH, CROSS_COMPILE and ARCH variables o PATH= /usr/bin: /bin:$PATH o export CROSS_COMPILE=ppc_6xx- o export ARCH=ppc Use the makefiles available to build the Kernel image - uImage Image created in /arch/ppc/boot/images Copy the image to a location accessible from root (exposed through NFS)

13 Board – Host setup Connect the board to the host through Serial port Connect the board to the same n/w as the host through the Ethernet port o For convenience we used a switch to setup a LAN Configure Kermit (Linux) or HyperTerminal (Windows) to communicate through the correct serial port with the board o Baud Rate – 9600 Power-on the board to get to the U-Boot prompt in the terminal printenv can be used to print the current value of environment variables Use setenv to define / redefine variables saveenv can be used to save the current state of variables to flash

14 TFTP Trivial File Transfer Protocol Simple version of FTP Uses UDP Port 69 Very small memory usage Reads / writes files to / from remote server No user authentication / encryption Doesn’t have directory listing capability Mainly used to load a basic kernel to perform the initial installation

15 TFTP Implementation TFTP package installed through YaST Functionality verified through localhost Problems transferring files through remote server Lack of root privileges on other linux hosts – unable to install TFTP package Windows based clients on personal laptops – unable to communicate with server Installed SuSE Linux on personal laptop – still couldn’t transfer between remote locations Verified UDP Port 69 to be open to all clients on the host nmap command from remote system gives Port 69 to be Open | Filtered – Possible Issue Solution – Attempt transfer through NFS Protocol before further debug

16 NFS Network File System Protocol Allows client to access files over N/W Accesses similar to how local storage might be accessed NFS server setup and running on host – GUI based application available on SuSE Linux Names and parameters of directory to be exported setup by Admin o /etc/exports Need to determine the clients (IP Address range) on network that can access the files

17 NFS Implementation Problems with NFS Server when multiple directories are exposed File transfer works well when only single directory is added to /etc/exports for NFS Board mounts the remote file system using NFS protocol, as its own root Workaround – place the Kernel image to be downloaded in the same path as root location Option Parameters – rw, no_root_squash, sync Create dummy node /dev/nfs if it doesn’t exist on host Download kernel image through NFS protocol

18 Downloading image / Booting Linux Run dhcp command from U-Boot to get the ip address for the board and the gateway ip. Setup the correct ip addresses o ipaddr – IP Address of the board o serverip – IP address of the host (having ELDK) o gatewayip – obtained through DHCP Specify the correct path for the boot image as well as for the root of the fs Use NFS protocol to download the boot image Use bootm command to boot from a particular location in memory This should boot from the kernel image If the boot is successful, a login prompt is provided Login as root and we will be able to access the fs exported over NFS

19 Current Status and Ongoing Work Successfully able to port Linux OS on to the CRX02 Platform Able to access and modify the root fs exported over NFS Verified simple C programs o Programs were both compiled and executed on the board Currently having to load the Kernel image through NFS after power- on o Planning to have the image saved to Flash and autoboot on power-on o Another option is to automate the image copy and load operation Plan to use both the serial ports o One port connected to linux host (with ELDK) and another to Windows host (running MATLAB) Setup serial communication between the board and host Once we are able to establish two-way serial communication between the board and the host, we can provide APIs to the SDL team that they can use to talk to the board

20 Implementation Trade-offs Copying the linux kernel onto the onboard flash memory Advantages o Kernel need not be fetched from the host o Faster bootup Disadvantages o Makes kernel upgrade / modification tedious o If there are many development boards, each one needs to be changed individually A better option would be to automate the kernel copy and linux boot-up process

21 Things we would do differently Wasted a lot of time trying to set up tftpboot Would probably skip that step, and jump directly to NFS NFS has more features, and enables kernel copy as well as remote directory mount

22 Questions?

23 Thank you!


Download ppt "OS porting onto MPX5200 Krishna Prakash Aravind Jakkani Malhar Mehta."

Similar presentations


Ads by Google