Click here

Sunday, February 9, 2014

Compiling and Running 32 bit UML on 64 bit Debian operating system

Steps followed
============
1) apt-get install uml-utilities
2) sudo apt-get install gcc-multilib
C_INCLUDE_PATH=/usr/include/$(gcc -print-multiarch)
http://stackoverflow.com/questions/12591629/gcc-cannot-find-bits-predefs-h-on-i686
Since we are compiling the UML kernel for 32 bit in 64 bit operating system, we need a gcc-multilib package to solve the library issues
3) #include<sys/stat.h> in ./arch/um/os-Linux/mem.c
http://stackoverflow.com/questions/5918539/c-warning-implicit-declaration-of-function-fchmod
4) The below patch needs to be applied
 In some cases gcc >= 4.5.2 will optimize away current_thread_info().
To prevent gcc from doing so the stack address has to be obtained
via inline asm.

LKML-Reference: http://marc.info/?i=201104132150.05623.richard@...>

Acked-by: Kirill A. Shutemov <kirill@...>
Signed-off-by: Richard Weinberger <richard@...>
---
 arch/um/include/asm/thread_info.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/um/include/asm/thread_info.h b/arch/um/include/asm/thread_info.h
index e2cf786..5bd1bad 100644
--- a/arch/um/include/asm/thread_info.h
+++ b/arch/um/include/asm/thread_info.h
@@ -49,7 +49,10 @@ static inline struct thread_info *current_thread_info(void)
 {
         struct thread_info *ti;
         unsigned long mask = THREAD_SIZE - 1;
-       ti = (struct thread_info *) (((unsigned long) &ti) & ~mask);
+       void *p;
+
+       asm volatile ("" : "=r" (p) : "0" (&ti));
+       ti = (struct thread_info *) (((unsigned long)p) & ~mask);
         return ti;
 }

--
1.7.4.2

http://sourceforge.net/mailarchive/message.php?msg_id=27397459

Compilation steps
================
1) make mrproper ARCH=um
2) make menuconfig ARCH=um SUBARCH=i386
http://uml.devloop.org.uk/faq.html
3) make ARCH=um SUBARCH=i386

No comments:

Post a Comment

Omicron - people gathers in crowd

Amidst omicron thread, people are gathered in crowd at markets and public places to buy their daily needs. Because of full lockdown at Sunda...