Presentation is loading. Please wait.

Presentation is loading. Please wait.

Linux 2.6.22 Kernel Port to the TLL6219 ARM 926 ‐ EJS Board Pablo Salinas-Bomfim Suhas Chakravarty Manan Kathuria.

Similar presentations

Presentation on theme: "Linux 2.6.22 Kernel Port to the TLL6219 ARM 926 ‐ EJS Board Pablo Salinas-Bomfim Suhas Chakravarty Manan Kathuria."— Presentation transcript:

1 Linux 2.6.22 Kernel Port to the TLL6219 ARM 926 ‐ EJS Board Pablo Salinas-Bomfim Suhas Chakravarty Manan Kathuria

2 Agenda Problem Statement Approach Kernel Internals Getting down and dirty Results Improvements

3 Problem Statement "To port a newer Linux Kernel to the class' Board: TLL6219 ARM 926 ‐ EJS Board " Why? Because it’s fun! Only brave men (and women) hack kernels Improvements and bug fixes obtained by migrating into a newer kernel To support Hard Real Time (RTAI patched) or improved soft- RT (Kernel Preemptiveness) To gain a better understanding of a Kernel architecture and functionality

4 Approach 1.Find a suitable Kernel to act as our ground base 2.RTAI analysis: Find a patch that could be applied to our selected Kernel and that was written for a similar architecture as the one we have 3.Compare current 2.6.16 Kernel to the chosen Kernel version 4.Modify the Kernel source code 5.Compile and fix errors and warnings 6.Boot board with newer kernel (and cross fingers) o If fails, go back to step 3 7.Apply modified RTAI patch 8.Perform same trial and error as before for making the RTAI patched kernel work

5 Linux Kernel Internals linux/arch/arm (Code) o arch/arm/mach-type: Clock registers,address of the tag list, etc o kernel: Core Kernel code o mm: Memory Management o nwfpe & fastfpe: Floating-point implementations o boot: Compressed kernel and.S files o tools: Scripts for auto-generating files o Non machine-specific directories (i.e. proc) linux/include/asm-arm (header files) linux/drivers (i.e. USB) linux/fs (for instance: jffs2) linux/net (for instance: TCP)

6 Linux Kernel Internals : Focus of Change Machine ID (linux/arch/arm/tools/mach-types) Config files (linux/arch/arm/def-configs) Kernel Basics (linux/include/asrm-arm/arch-imx21/memory.h o Mapping between physical and virtual memory Decompressor Symbols o ZTEXTADDR, ZBSSADDR, etc Kernel Symbols o PHYS_OFFSET: First RAM Physical Address o PAGE_OFFSET: Virtual start address of the first bank of RAM o others Architecture Specific Macros o BOOT_MEM, BOOT_PARAMS, etc PHYS_OFFSET: First RAM Physical Address

7 Getting down and dirty 1.Select Kernel for ground base 2.RTAI analysis Decisions taken: Decided that just porting the newer Kernel version was enough work for a one semester class project Use 2.6.22 Kernel that had partial support for the iMX21 SoC 2.6.16 TLL supported Kernel RTAI analysis 2.6.19 Vanilla Kernel 2.6.20 Vanilla Kernel 2.6.22 Kernel Patch for Atmel’s AT91 SoC One patch was missing

8 Getting down and dirty continued… 3.gvimdiff is your best friend for Kernel porting 4.grep and find very useful as well 5.Added or edited these files: arch/arm/tools/mach-types, arch/arm/boot/compressed/misc.c, arm/boot/compressed/head- vcmx212.S, arch/arm/boot/compressed/Makefile, arch/arm/mach-imx21/vcmx212.c, include/asm/mach-imx21/vcmx212.h, arch/arm/mach-imx21/Kconfig, arch/arm/mach- imx21/Makefile, drivers/mtd/maps/vcmx212.c, drivers/mtd/maps/Makefile, drivers/mtd/maps/Kconfig, include/asm/arch-imx/hardware.h, init/do_mounts.c, include/asm-arm/arch-imx21/imx-regs.h, arch/arm/mach-imx21/generic.c, arch/arm/mm/Kconfig, drivers/video/Kconfig, drivers/scsi/Kconfig, Makefile,.config Collaterals Tested softgun as a platform for Kernel debugging KDB as another option lxr - is a great resource

9 Results 2.6.22 Kernel Boots! Busybox shell says hello ! Footprint – 1039 KB ( compared to1056 KB for 2.6.16) No RTAI patch or Preemptive kernel No Ethernet support No proc fs support Had to create our own simpleinitstart (instead of the usual /sbin/init)

10 Improvements for Future Would have made sure we had better debugging tools than just printks before starting the Kernel porting Get an emulation system going (softgun or something like it)

11 References Coglinux Kernel 2.6.16-tllmx21 Kernel 2.6.22 source for generic iMX21 SoC Linux Kernel Resources Linux Kernel Archives: Embedded Linux Primer by Christopher Hallinan, Prentice Hall Publication Porting the Linux Kernel to a New ARM Platform (whitepaper ), Wookey and Tak-Shing, Aleph One, weblink : http://www.linux- http://www.linux- RTAI: o apps/Linux_Lecture_03_RTAI_Overview.pdf apps/Linux_Lecture_03_RTAI_Overview.pdf o o

12 The End Questions?

13 Backup Material

14 RTAI Real time extension to the Linux kernel o "A patch to the Linux kernel which introduces a hardware abstraction layer" called Adeos o A broad variety of services which make realtime programmers' lifes easier" RTAI is basically an Interrupt dispatcher RTAI considers Linux as a background task running when no real time activity occurs

15 RTAI What we had? Tested RTAI on Linux 2.6.23 AMD64 PC Most similar RTAI/LINUX scenario we could find: RTAI and Adeos patch for AT91 ARM926EJS board and 2.6.20 Kernel o AT91 Adeos patch for the 2.6.20 Kernel o RTAI patch for 2.6.20 Kernel o AT91 Adeos patch for RTAI HARDWARE HAL (Adeos) RTAI Linux Kernel LXRT Real Time Tasks User Space RTAPPSRTAPI Interrupts

16 Kernel Boot Process Boot loader (uMon in our case) copies compressed Kernel image into memory, and points to the kernel initial address linux/arch/arm/boot/compressed/head.S: Basic hardware setup o linux/arch/arm/boot/compressed/head-vcmx21.S: Execute architecture-specific code o arch/arm/mm/proc-arm926.S: Flush cache, turns cache write-back off and mmu o head.S: __enable_mmu  Enables mmu back o Also inside head.S: Set up stack, clear the BSS, turn cache and mmu back on o Call to C function decompress_kernel  Which prints on the screen the very (not) useful 'Uncompressing Linux..." message  Kernel is uncompressed

17 Kernel Boot Process continued… arch/arm/boot/compressed/head.S o Moves the PC to the beginning of the uncompressed kernel start_kernel function in init/main.c is invoked o Log messages start to appear on the screen o Setup scheduler o Initialize IRQ o Initialize PID o Load Device Drivers o Mount root device (/dev/mtdblock1) o etc kernel_init o run_init_process(/sbin/init)  Runs scripts pointed by /etc/inittab

Download ppt "Linux 2.6.22 Kernel Port to the TLL6219 ARM 926 ‐ EJS Board Pablo Salinas-Bomfim Suhas Chakravarty Manan Kathuria."

Similar presentations

Ads by Google