delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/08/02/04:57:31

X-Spam-Check-By: sourceware.org
Message-ID: <46B0C174.7020607@gmail.com>
Date: Wed, 01 Aug 2007 19:23:00 +0200
From: Claudio Scordino <cloud DOT of DOT andor AT gmail DOT com>
User-Agent: Thunderbird 1.5.0.12 (X11/20070604)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
CC: samuel DOT thibault AT ens-lyon DOT org, rvm AT CBORD DOT com, rurban AT x-ray DOT at,
0 DOT fractalus AT gmail DOT com, fischermi AT t-online DOT de, info AT yagarto DOT de
Subject: HOWTO: Linux kernel compilation for ARM using cygwin
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Hi,

    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,

           Claudio

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:
    http://www.gnuarm.org/bu-2.17_gcc-4.2.0-c-c++_nl-1.15.0_gi-6.6.exe
    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:
    wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.22.tar.bz2

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-new/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;
+#else
  typedef uint32_t       __u32;
+#endif
  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;
+#endif
+
+
  #if KERNEL_ELFCLASS == ELFCLASS32

  #define Elf_Ehdr    Elf32_Ehdr

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

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





--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019