Re: [uml-user] Compiling modules on UML

2009-08-05 Thread H M Thalib
Hi

Manish Katiyar wrote:
> On Wed, Aug 5, 2009 at 8:44 PM, H M Thalib wrote:
>> Hi  Manish,
>>
>> Manish Katiyar wrote:
>>> On Wed, Aug 5, 2009 at 4:46 PM, Flavio wrote:
 2009/8/5 Manish Katiyar :
> My question is how do people build modules which are specific to a
> particular architecture on UML ? Is it possible ?
 Sure!
 Are you compiling the kernel modules from the host system? If not,
 try to do it.
 The exact procedure is the following:
 # mount -o loop rootfs loop_dir/
 # cd /uml/src/linux
 # make modules ARCH=um
 # make modules_install INSTALL_MOD_PATH=/uml/loop_dir ARCH=um
 # umount /uml/loop_dir

 Then, boot the UML again.
>>> Hi Flavio,
>>>
>>> I have done that step and my UML kernel boots fine. My question is in
>>> UML environment what will the ARCH resolve to ? will it be um or x86 ?
>>>
>>> Thanks -
>>> Manish
>>>
>>>
 Flavio

>>>
>>>
>> It will um. Actualy UML is a port of the Linux kernel as a normal Intel
>> Linux process.
> 
> So that would mean that any new kernel module that I compile has to be
> prefixed with ARCH=um ??? because my kernel source resides on host and
> has been configured as um. If I compile any x86 module from UML it
> will fail because the asm directory in kernel source points to asm-um
> and not asm-x86. Isn't it ?? Or I am just talking senseless :-( ...
> 

Yes, When you compile don't forget to specify the ARCH=um. If you didn't 
specify the ARCH then kernel build system will configure it for the 
host/development system mostly your x86 PC.

Mostly it modules should fail. but I am not sure.

> Below is how my directory structures look like.
> 
> -bash-3.2# ls -l /lib/modules/2.6.30.4/source/include/
> total 120
> -rw-r--r--  1 mkatiyar 5573   218 Jul 30 18:34 Kbuild
> drwxr-xr-x  3 mkatiyar 5573  4096 Jul 30 18:34 acpi
> lrwxrwxrwx  1 mkatiyar 5573 6 Aug  5 06:16 asm -> asm-um
> 
> -bash-3.2# ls -l /lib/modules/2.6.30.4/
> total 64
> lrwxrwxrwx 1 root root   42 Aug  4 13:36 build ->
> /home/mkatiyar/personal/uml/linux-2.6.30.4
> drwxr-xr-x 6 root root 4096 Aug  5 06:18 kernel
> -rw-r--r-- 1 root root  265 Aug  5 11:01 modules.alias
> ..
> ...
> -rw-r--r-- 1 root root  189 Aug  5 11:01 modules.usbmap
> lrwxrwxrwx 1 root root   42 Aug  5 06:18 source ->
> /home/mkatiyar/personal/uml/linux-2.6.30.4
> 
> -bash-3.2# ls -l /home/mkatiyar
> total 0
> lrwxrwxrwx 1 root root 32 Aug  4 14:48 personal ->
> /mnt/host/home/mkatiyar/personal
> 
> 
> -bash-3.2# mount
> /dev/ubda on / type auto (rw)
> none on /proc type proc (rw)
> none on /dev/pts type devpts (rw,gid=5,mode=620)
> none on /mnt/host type hostfs (rw)
> 
> 
> Thanks -
> Manish
> 
> 
> 
>> --
>> Thanks & Regards,
>> H M Thalib.
>>
> 
> 
> 


-- 
Thanks & Regards,
H M Thalib.

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
User-mode-linux-user mailing list
User-mode-linux-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user


Re: [uml-user] Compiling modules on UML

2009-08-05 Thread Manish Katiyar
On Wed, Aug 5, 2009 at 8:44 PM, H M Thalib wrote:
> Hi  Manish,
>
> Manish Katiyar wrote:
>>
>> On Wed, Aug 5, 2009 at 4:46 PM, Flavio wrote:
>>>
>>> 2009/8/5 Manish Katiyar :

 My question is how do people build modules which are specific to a
 particular architecture on UML ? Is it possible ?
>>>
>>> Sure!
>>> Are you compiling the kernel modules from the host system? If not,
>>> try to do it.
>>> The exact procedure is the following:
>>> # mount -o loop rootfs loop_dir/
>>> # cd /uml/src/linux
>>> # make modules ARCH=um
>>> # make modules_install INSTALL_MOD_PATH=/uml/loop_dir ARCH=um
>>> # umount /uml/loop_dir
>>>
>>> Then, boot the UML again.
>>
>> Hi Flavio,
>>
>> I have done that step and my UML kernel boots fine. My question is in
>> UML environment what will the ARCH resolve to ? will it be um or x86 ?
>>
>> Thanks -
>> Manish
>>
>>
>>> Flavio
>>>
>>
>>
>>
>
> It will um. Actualy UML is a port of the Linux kernel as a normal Intel
> Linux process.

So that would mean that any new kernel module that I compile has to be
prefixed with ARCH=um ??? because my kernel source resides on host and
has been configured as um. If I compile any x86 module from UML it
will fail because the asm directory in kernel source points to asm-um
and not asm-x86. Isn't it ?? Or I am just talking senseless :-( ...

Below is how my directory structures look like.

-bash-3.2# ls -l /lib/modules/2.6.30.4/source/include/
total 120
-rw-r--r--  1 mkatiyar 5573   218 Jul 30 18:34 Kbuild
drwxr-xr-x  3 mkatiyar 5573  4096 Jul 30 18:34 acpi
lrwxrwxrwx  1 mkatiyar 5573 6 Aug  5 06:16 asm -> asm-um

-bash-3.2# ls -l /lib/modules/2.6.30.4/
total 64
lrwxrwxrwx 1 root root   42 Aug  4 13:36 build ->
/home/mkatiyar/personal/uml/linux-2.6.30.4
drwxr-xr-x 6 root root 4096 Aug  5 06:18 kernel
-rw-r--r-- 1 root root  265 Aug  5 11:01 modules.alias
..
...
-rw-r--r-- 1 root root  189 Aug  5 11:01 modules.usbmap
lrwxrwxrwx 1 root root   42 Aug  5 06:18 source ->
/home/mkatiyar/personal/uml/linux-2.6.30.4

-bash-3.2# ls -l /home/mkatiyar
total 0
lrwxrwxrwx 1 root root 32 Aug  4 14:48 personal ->
/mnt/host/home/mkatiyar/personal


-bash-3.2# mount
/dev/ubda on / type auto (rw)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
none on /mnt/host type hostfs (rw)


Thanks -
Manish



>
> --
> Thanks & Regards,
> H M Thalib.
>



-- 
Thanks -
Manish

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
User-mode-linux-user mailing list
User-mode-linux-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user


Re: [uml-user] Compiling modules on UML

2009-08-05 Thread H M Thalib
Hi  Manish,

Manish Katiyar wrote:
> On Wed, Aug 5, 2009 at 4:46 PM, Flavio wrote:
>> 2009/8/5 Manish Katiyar :
>>> My question is how do people build modules which are specific to a
>>> particular architecture on UML ? Is it possible ?
>> Sure!
>> Are you compiling the kernel modules from the host system? If not,
>> try to do it.
>> The exact procedure is the following:
>> # mount -o loop rootfs loop_dir/
>> # cd /uml/src/linux
>> # make modules ARCH=um
>> # make modules_install INSTALL_MOD_PATH=/uml/loop_dir ARCH=um
>> # umount /uml/loop_dir
>>
>> Then, boot the UML again.
> 
> Hi Flavio,
> 
> I have done that step and my UML kernel boots fine. My question is in
> UML environment what will the ARCH resolve to ? will it be um or x86 ?
> 
> Thanks -
> Manish
> 
> 
>> Flavio
>>
> 
> 
> 

It will um. Actualy UML is a port of the Linux kernel as a normal Intel 
Linux process.

-- 
Thanks & Regards,
H M Thalib.

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
User-mode-linux-user mailing list
User-mode-linux-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user


Re: [uml-user] Compiling modules on UML

2009-08-05 Thread Flavio
2009/8/5 Manish Katiyar :
> Hi Flavio,
>
> I have done that step and my UML kernel boots fine. My question is in
> UML environment what will the ARCH resolve to ? will it be um or x86 ?
ARCH will be "um", but you can choose a subarch type in your kernel config.

Flavio

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
User-mode-linux-user mailing list
User-mode-linux-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user


Re: [uml-user] Compiling modules on UML

2009-08-05 Thread SandeepKsinha
Manish,


On Wed, Aug 5, 2009 at 3:54 PM, Manish Katiyar wrote:
> Hi,
>
> I am trying to compile a module on UML. The kernel with which I am
> booting UML is my custom kernel built on i386 machine with the command
> line as "make defconfig ARCH=um; make linux ARCH=um". After the kernel
> boots up my uname shows something like below :-
>
> bash-3.2# uname -a
> Linux localhost.localdomain 2.6.30.4 #6 Wed Aug 5 15:12:08 IST 2009
> i686 i686 i386 GNU/Linux
>
> Now when I compile a module, by default it resolves the ARCH to x86.
> And some of the compilation fails because somethings are expected to
> be always defined on x86 but not on UML (e.g.
> CONFIG_TRACE_IRQFLAGS_SUPPORT). because my asm directory resolves to
> asm-um rather than asm-x86. It throws error like below.
>
> In file included from include/linux/prefetch.h:14,
>                 from include/linux/list.h:6,
>                 from include/linux/wait.h:22,
>                 from include/linux/fs.h:359,
>                 from include/linux/buffer_head.h:11,
>                 from /home/mkatiyar/personal/ohsm/test/kernel/admin.c:23:
> /mnt/host/home/mkatiyar/personal/uml/linux-2.6.30.4/arch/x86/include/asm/processor.h:
> In function 'load_cr3':
> /mnt/host/home/mkatiyar/personal/uml/linux-2.6.30.4/arch/x86/include/asm/processor.h:191:
> error: 'CONFIG_PAGE_OFFSETUL' undeclared (first use in this function)
> /mnt/host/home/mkatiyar/personal/uml/linux-2.6.30.4/arch/x86/include/asm/processor.h:191:
> error: (Each undeclared identifier is reported only once
> /mnt/host/home/mkatiyar/personal/uml/linux-2.6.30.4/arch/x86/include/asm/processor.h:191:
> error: for each function it appears in.)
> /mnt/host/home/mkatiyar/personal/uml/linux-2.6.30.4/arch/x86/include/asm/processor.h:
> In function 'wbinvd_halt':
> /mnt/host/home/mkatiyar/personal/uml/linux-2.6.30.4/arch/x86/include/asm/processor.h:771:
> error: implicit declaration of function 'halt'
>
>
> My question is how do people build modules which are specific to a
> particular architecture on UML ? Is it possible ?
>
> Once I export ARCH=um before doing a make, I can do a successful build.
>

I think its documented somewhere on the UML website that you have to
provide ARCH=um for any compilation/build related things.


> --
> Thanks -
> Manish
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to ecar...@nl.linux.org
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
User-mode-linux-user mailing list
User-mode-linux-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user


Re: [uml-user] Compiling modules on UML

2009-08-05 Thread Manish Katiyar
On Wed, Aug 5, 2009 at 4:46 PM, Flavio wrote:
> 2009/8/5 Manish Katiyar :
>> My question is how do people build modules which are specific to a
>> particular architecture on UML ? Is it possible ?
> Sure!
> Are you compiling the kernel modules from the host system? If not,
> try to do it.
> The exact procedure is the following:
> # mount -o loop rootfs loop_dir/
> # cd /uml/src/linux
> # make modules ARCH=um
> # make modules_install INSTALL_MOD_PATH=/uml/loop_dir ARCH=um
> # umount /uml/loop_dir
>
> Then, boot the UML again.

Hi Flavio,

I have done that step and my UML kernel boots fine. My question is in
UML environment what will the ARCH resolve to ? will it be um or x86 ?

Thanks -
Manish


>
> Flavio
>



-- 
Thanks -
Manish

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
User-mode-linux-user mailing list
User-mode-linux-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user


Re: [uml-user] Compiling modules on UML

2009-08-05 Thread Flavio
2009/8/5 Manish Katiyar :
> My question is how do people build modules which are specific to a
> particular architecture on UML ? Is it possible ?
Sure!
Are you compiling the kernel modules from the host system? If not,
try to do it.
The exact procedure is the following:
# mount -o loop rootfs loop_dir/
# cd /uml/src/linux
# make modules ARCH=um
# make modules_install INSTALL_MOD_PATH=/uml/loop_dir ARCH=um
# umount /uml/loop_dir

Then, boot the UML again.

Flavio

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
User-mode-linux-user mailing list
User-mode-linux-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user