Kernel Internals

From wikiPodLinux

Table of contents

About

This page gives information about how the Kernel starts up and works, specific to iPodLinux

Kernel Startup

Overview

For general startup information in Linux kernels, see these:

The configuration for bulding the kernel is stored in the file .config at the root of the linux directory tree.

Here's a list of resulting defines when the kernel gets built for iPL:

  • PROCESSOR = armv
  • MACHINE = ipod
  • TEXTADDR = 0x00008000 -- entry offset for the kernel initialization

Directories and files of interest:

  • arch/armnommu/mach-ipod/
  • arch/armnommu/mm/
  • include/asm-armnommu/arch-ipod/
  • arch/armnommu/kernel/head-arm-ipod.S -- kernel initialization starts here
  • arch/armnommu/kernel/entry-armv.S -- entry code for hardware interrupt calls
  • arch/armnommu/kernel/entry-common.S -- entry code for software interrupt calls

Initialization sequence

  1. The bootloader loads the kernel file into SDRAM at either 0x2800000 (PP5002) or 0x10000000 (PP502x) and jumps to offset 0x8000 in it.
  2. Inside arch/armnommu/kernel/head-arm-ipod.S:
    1. A small part of the code (between install_reloc_start and install_reloc_end) is copied to IRAM at 0x40010000,
    2. a few registers are prepared for modifying the Memory Controller,
    3. the moved code is executed, in which the memory controller registers are set, mapping the SDRAM to start at address 0 now.
    4. The Coprocessor is put to sleep (post_reloc_start).
    5. The Stack Pointer is set (8KB in size), BSS gets cleared (that's the memory area for global variables), then calls the following subroutines (all inside arch/armnommu/mach-ipod/hardware.c):
      • ipod_set_sys_info -- sets up the sysinfo_t struct
      • ipod_init_cache -- appears to enable the CPU's internal and/or 2nd level caches
      • ipod_set_cpu_speed -- appears to set the CPU's speed to 75 MHz
    6. Finally, it jumps to start_kernel.
  3. Inside init/main.c, function start_kernel():
    1. Invokes setup_arch(), which is inside arch/armnommu/kernel/setup.c and which, amoung other operations, can fetch arguments (command line) that may be passed from Loader 2.

To Be Continued...


Kernel Drivers

iPod specific kernel drivers

Navigation



  • Google Search (http://www.google.com/custom?sa=Google+Search&cof=S%3Ahttp%3A%2F%2Fwww.ipodlinux.org%3BVLC%3Apurple%3BAH%3Acenter%3BBGC%3Awhite%3BLH%3A141%3BLC%3Ablue%3BL%3Ahttp%3A%2F%2Fipodlinux.org%2Fstylesheets%2Fimages%2Fwiki.png%3BALC%3Ablue%3BLW%3A128%3BT%3Ablack%3BAWFID%3A70a74ab66f4d59ae%3B&domains=ipodlinux.org&sitesearch=ipodlinux.org)