90 likes | 237 Views
Porting Linux to the Puppeteer. Getting the kernel source. You will need a clean version of the linux kernel source This can be found at www.kernel.org or lots of mirror sites Probably best not to download the latest version Use the numbering system x.y.z Even is stable 2.4.9, 2.6.4 etc
E N D
Getting the kernel source • You will need a clean version of the linux kernel source • This can be found at www.kernel.org or lots of mirror sites • Probably best not to download the latest version • Use the numbering system x.y.z • Even is stable 2.4.9, 2.6.4 etc • Odd is development 2.3.7, 2.5.9 etc
Applying patches • Linux is primarily used on Intel Pentium machines • However other architectures are supported • alpha, arm, i386, ia64, m86k, mips, mips64, ppc s390, sh, sparc, sparc64 • To support other architectures patches need applying to make specific changes to the source
Getting the ARM patches • The ARM Linux patches can be found at www.arm.linux.org.uk • You need to find the patch that applies to your particular kernel • patch-2.4.18-rmk10.gz for 2.4.18 • There are specialised patches for specific features • The patch must be applied to a clean source tree – in the root of the kernel source • Patch –p1 patch-2.4.18-rmk10 • Beware of pre patches!
The Linux kernel source • In order to configure and port the kernel source you will need to know more about its structure. /usr/src/linux Documentation scripts init ipc kernel mm net Include Asm-alpha Asm-arm Asm-generic Asm-i386 ……… linux FS adfs affs autofs ext2 fat …… Drivers acorn atm block cdrom char i2c ……. Arch alpha arm i386 ia64 m68k ….. lib
The arch directories • These contain specific code for each port • It has • Kernel, lib, mm, boot plus variants and board specifics • Lib has optimised code for the hardware • i.e. memcpy, checksums.
Drivers directory • Largest amount of code – circa 1.5M • The area you are most likely to have to port/maintain • Details on buses • Categories of device driver • Char, block, net
The include directory • This is linked a configure time with architecture dependant subdirectories • For example asm-arm • Include/linux for kernel and user apps • Beware for some start up code – for example serial port code
Linux/init • This has 2 file: version.c and main.c • version.c has the version banner at boot time • main.c is the architecture independent boot code • start_kernel is the primary entry point