Hi, Gabe,
Your hint helps me a lot on how to load a module to kernel. Right now my
working flow is compile the source code of module in my X86 host machine to
generate .ko file, copy it to disk image, boot linux in GEM5 and use
sbin/insmod to install my module.

Right now the problem is kernel image for GEM5 is too old for the kernel. Do
you have any kernel image file newer than 2.6.34? I have checked this link
http://gem5.org/Linux_kernel. However, there is very limited kernel version
options for x86 due to the constraint of configuration file.

Thanks,
Guangyi Cao

On 07/24/11,  Gabe Black wrote:
You definitely don't want to try to compile things in the simulated
system since it would take a long, long time. You want to cross compile
the module, or since you're using an x86 system compile it normally and
copy it over. This sort of thing isn't unique to gem5 and is common on
embedded systems.

Gabe

On 07/24/11 08:15, Guangyi Cao wrote:
>
> Hi, Gabe,
> I see the mistake I made. Yes, kernel modules don't go in /bin. I
> think I shall
> modify my question as how to how modify kernel to incorporate a
> loadable kernel
>  module. In a real machine, to do this just need to compile the source
> code
> of module and use command insmod load module. However, since gcc is not
> in disk image. I guess it is more tricky to do this in GEM5 simulator
> environment.
> Do you think it is possible to do this with GEM5?
> Thanks!
> Guangyi Cao
>
>
>
> Kernel modules don't go in /bin, although I couldn't say for sure where
> they *are* supposed to go. That will be the same as it would be on a
> real system, so you can look for that in Linux kernel documentation. You
> should read this to get started working with disk images.
>
> http://gem5.org/Disk_images
>
> Gabe
>
> On 07/21/11 20:02, Guangyi Cao wrote:
> > Dear M5,
> > I intend to incorporate a loadable kernel module in my linux file
> > system using X86_FS mode. I guess to do this I have to compile a file
> > system with this module so that this module can be installed in /bin
> > and ready to use.
> >  I saw a link  http://www.m5sim.org/dist/current/linux-dist.tgz under
> > ALPHA category saying it contains everything you need to create your
> > own disk image and compile everything in it from scratch. But I am not
> > sure if it is OK for X86 as well and I really have no clue how to use
> > it since I am a newbie in kernel development. My current situation is
> > I can build x86_fs mode for M5 and I can compile and run simple code
> > like helloworld under x86_FS. Can anybody give me a hint on this?
> > Thanks!
> > Guangyi Cao
>
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to