This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

HOWTO: Linux kernel compilation for ARM using cygwin


   thanks to all suggestions and help that I received from you in the last
days, I was able of succesfully compiling a Linux kernel using Cygwin.

Here I report all the steps that I made, just in case someone else need this info.

Thanks again,


1. Install cygwin among with the following packets:
   libncurses, libncurses-devel, ELFIO, wget, gcc-core, gcc-g++,
   cpio, make, patch, tar, vim, gettext, libintl
   Note: install these packages using cygwin's setup.exe

2. Download and install on Windows an ELF toolchain for ARM from:
   Note: the default host toolchain of Cygwin is not ELF
   Note: the toolchains of the Yagarto project are not compliant with Cygwin

3. Create on Windows the directory C:\kernel

4. Open a cygwin shell

5. Mount the directory as "managed":
   mount -f -o managed C:\\kernel $HOME/kernel
   Note: an ext2 partition is not necessary to compile the kernel.

6. Enter into the kernel directory:
   cd $HOME/kernel

7. Download the kernel:

8. Extract the archive:
   tar -xvjf linux-2.6.22.tar.bz2

9. Patch the kernel in the following points:

diff -ur linux-2.6.22/scripts/mod/file2alias.c
--- linux-2.6.22/scripts/mod/file2alias.c       2007-07-09 01:32:17.000000000 +0200
+++ linux-2.6.22-new/scripts/mod/file2alias.c   2007-08-01 16:32:17.078125000 +0200
@@ -29,7 +29,12 @@

#include <ctype.h>

+/* Added by cloud */
+#ifdef __CYGWIN__
+typedef __uint32_t     __u32;
 typedef uint32_t       __u32;
 typedef uint16_t       __u16;
 typedef unsigned char  __u8;

diff -ur linux-2.6.22/scripts/mod/modpost.h linux-2.6.22-new/scripts/mod/modpost.h
--- linux-2.6.22/scripts/mod/modpost.h  2007-07-09 01:32:17.000000000 +0200
+++ linux-2.6.22-new/scripts/mod/modpost.h      2007-08-01 16:37:04.281250000 +0200
@@ -11,6 +11,13 @@

#include "elfconfig.h"

+#ifdef __CYGWIN__
+typedef uint16_t Elf32_Section;
+typedef uint16_t Elf64_Section;

#define Elf_Ehdr Elf32_Ehdr

10. Configure the kernel:
    make ARCH=arm CROSS_COMPILE=arm-elf- HOST_LOADLIBES="-lintl -lncurses"

11. Build the kernel:
    make ARCH=arm CROSS_COMPILE=arm-elf- HOST_LOADLIBES="-lintl -lncurses"

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]