Emilio,

Thank you for sharing this. I think this will be very helpful for me. I am
going to look it over and see if I can get 3.2.24 up and running, and I'll
plan to let you know what happens. (It might take me awhile, as I have
other things going on.)

Thanks again and Regards,
Patrick

On Fri, Mar 6, 2015 at 1:44 PM, Castillo Villar, Emilio <
emilio.casti...@unican.es> wrote:

>  Hello all,
>
>  I have been able to boot newer and unmodified x86 kernels after doing a
> bit of research and debugging, I managed to get a 3.2.24 kernel to work.
>
>  One of the main issues was the SMP initialization with the "trampoline"
> code.
>
>  This is the very first routine that any slave processor executes when it
> boots.
>
>  Before 2.6.38 series, the trampoline code was always fixed in a very low
> memory position, as the cpu boots in real mode it has to be within the
> first MB.
>
>  Newer kernels changed this allocation to be dynamic. They read the e820
> bios memory tables at the beginning and try to allocate memory starting
> from the high positions. As a result, the trampoline code will be in the
> higher part of this first MB. As Gem5 lacks support for doing large jumps
> while in real mode. When the slave processor booted, the simulator will
> fail due to an unimplemented "long jump" instruction.
>
>  In order to work around this, I modified the e820 memory maps to make
> some of the lower positions allocatable.
>
>  In file configs/common/FSConfig.py
>
>  change the e820 map for the following, this will force the trampoline
> code to load on the first 64kB segment.
>
>  entries = \
>        [
>         X86E820Entry(addr = 0x0, size = '64kB', range_type = 1),
>         X86E820Entry(addr = 0x10000, size = '960kB', range_type = 2),
>         # Mark the rest of physical memory as available
>         X86E820Entry(addr = 0x100000,
>                 size = '%dB' % (self.mem_ranges[0].size() - 0x100000),
>                 range_type = 1),
>         ]
>
>  Now you need one of the .config files provided in the wiki:
> wget http://www.m5sim.org/dist/current/x86/config-x86.tar.bz2
> http://www.m5sim.org/dist/current/x86/config-x86.tar.bz2
>
>  THIS IS MANDATORY as this config file sets some options needed for the
> kernel to work correctly,
> copy the linux-2.6.28.4 file to the kernel 3.2 root and rename it to
> ".config", then execute make oldconfig. Just press enter till is over.
>
>  There is an option that must be changed in the kernel
> CONFIG_X86_RESERVE_LOW, this is set to 64 (KB) by default but for the
> kernel to boot in smp change it to 4,
>  if using "make menuconfig":
> Processor types and features -> Amount of low memory, in kilobytes, to
> reserve for the bios
>
>  This should be enough, I have managed to boot up to 16 cores with this
> kernel.
>
>  Thanks for your time and hope this info may be of any use.
>
>  ------------------------------
> *De:* gem5-users [gem5-users-boun...@gem5.org] en nombre de Joel Hestness
> via gem5-users [gem5-users@gem5.org]
> *Enviado:* viernes, 06 de marzo de 2015 20:50
> *Para:* Patrick; gem5 users mailing list
> *Asunto:* Re: [gem5-users] Linux kernel
>
>
>     To get a working x86 Linux kernel, you shouldn't need to patch the
>> source. The patches were developed to speed up the kernel timer
>> configuration for ALPHA, but x86 uses a different mechanism, so those are
>> unnecessary.
>>
>
>  Apologies... to be clearer: The major thing for getting a working kernel
> is configuring the build correctly to keep gem5 from trying to use devices
> and CPU features that are not implemented. The build config files
> <http://www.m5sim.org/dist/current/x86/config-x86.tar.bz2> available on
> the gem5 site should be a good starting point.
>
>    Joel
>
>
>
>    On Fri, Mar 6, 2015 at 12:01 PM, Patrick via gem5-users <
>> gem5-users@gem5.org> wrote:
>>
>>>  Andreas,
>>>
>>>  Thanks. ARM would be useful for me, but I would like at least to try
>>> to get x86 working, since that would be more useful for my purposes. I came
>>> across this page (link <http://www.m5sim.org/Compiling_a_Linux_Kernel>)
>>> explaining the patching that has to be done to the kernel to make it work.
>>> I will try to work through that.
>>>
>>>  Thanks,
>>> Patrick
>>>
>>> On Fri, Mar 6, 2015 at 1:13 AM, Andreas Hansson <andreas.hans...@arm.com
>>> > wrote:
>>>
>>>>  Hi Patrick,
>>>>
>>>>  It might not be what you are looking for, but just in case… if you
>>>> want the latest linux kernel you should be just fine with ARM (aarch64).
>>>> There are lots of people using ARM full system so there should also be
>>>> plenty help available if needed.
>>>>
>>>>  Andreas
>>>>
>>>>   From: Patrick via gem5-users <gem5-users@gem5.org>
>>>> Reply-To: Patrick <plafr...@gmail.com>, gem5 users mailing list <
>>>> gem5-users@gem5.org>
>>>> Date: Thursday, 5 March 2015 22:28
>>>> To: gem5 users mailing list <gem5-users@gem5.org>
>>>> Subject: Re: [gem5-users] Linux kernel
>>>>
>>>>  Just to offer an update, I was able to build kernel version 2.6.28.4
>>>> by rolling back to gcc 3.4. When I try to run gem5 in FS mode with this
>>>> kernel, though, I get this error:
>>>>
>>>>  Kernel panic - not syncing: Attempted to kill the idle task!
>>>>
>>>>
>>>>  It looks like this error has come up in past discussions on the gem5
>>>> boards, so I will look over those. (Sorry for sidetracking the
>>>> conversation. I will eventually like to look into newer versions of the
>>>> kernel, but I figured starting with an older, known working version of the
>>>> kernel was a good starting point.)
>>>>
>>>>  -Patrick
>>>>
>>>> On Thu, Mar 5, 2015 at 10:53 AM, Patrick <plafr...@gmail.com> wrote:
>>>>
>>>>>  Konstantinos,
>>>>>
>>>>>  I tried running the latest stable version (3.19). It built
>>>>> succesfully from source, but when I tried to run it, I got the following
>>>>> error:
>>>>>
>>>>>   panic: Resetting mouse wrap mode unimplemented.
>>>>>   @ tick 928089856500
>>>>>  [processData:build/X86/dev/x86/i8042.cc, line 258]
>>>>>  Memory Usage: 1084128 KBytes
>>>>>  Program aborted at cycle 928089856500
>>>>>  Aborted (core dumped)
>>>>>
>>>>>   ​I t​ried building two of the versions of the kernel for which
>>>>> there are configuration files provided for x86 on the gem5 wiki (here
>>>>> <http://www.m5sim.org/Linux_kernel>). This included versions 2.6.22.9
>>>>> and 2.6.28.4. When I tried building 2.6.22.9, I got this error:
>>>>>
>>>>>
>>>>>    In file included from arch/x86_64/kernel/asm-offsets.c:7:0:
>>>>>   include/linux/crypto.h:20:24: fatal error: asm/atomic.h: No such
>>>>> file or directory
>>>>>
>>>>>
>>>>>  When I tried to build 2.6.28.4, I got this error:
>>>>>
>>>>>     gcc: error: unrecognized command line option ‘-m’
>>>>>    gcc: error: elf_x86_64: No such file or directory
>>>>>
>>>>>
>>>>>  From reading discussion boards about building the kernel, I think
>>>>> these errors might mean I need to roll back my toolchain to build these
>>>>> previous versions of the kernel. However, I have little experience with
>>>>> building kernels, so I need to do more reading about this.
>>>>>
>>>>>  Just thought I'd share my experience, as it sounds like we are
>>>>> working on similar problems.
>>>>>
>>>>>  I had had a brief discussion with another individual on this message
>>>>> board a long time ago on the related topic of creating a disk image for
>>>>> gem5 (link
>>>>> <http://www.mail-archive.com/gem5-users%40gem5.org/msg10731.html>).
>>>>> This discussion had lead me to the script gem5/gem5img.py, but I haven't
>>>>> yet gotten around to revisiting that to learn more about it.
>>>>>
>>>>>  I'd be interested in any updates you might have on this.
>>>>>
>>>>>  Thanks,
>>>>> Patrick
>>>>>
>>>>> On Sat, Feb 14, 2015 at 2:40 AM, Konstadinos PARASYRIS via gem5-users
>>>>> <gem5-users@gem5.org> wrote:
>>>>>
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Has anyone successfully executed a kernel 3.2 or newer under X86 full
>>>>>> system simulation?
>>>>>>
>>>>>>
>>>>>> Konstantinos Parasyris
>>>>>>
>>>>>> _______________________________________________
>>>>>> gem5-users mailing list
>>>>>> gem5-users@gem5.org
>>>>>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>>>>>>
>>>>>
>>>>>
>>>>
>>>> -- IMPORTANT NOTICE: The contents of this email and any attachments are
>>>> confidential and may also be privileged. If you are not the intended
>>>> recipient, please notify the sender immediately and do not disclose the
>>>> contents to any other person, use it for any purpose, or store or copy the
>>>> information in any medium. Thank you.
>>>>
>>>> ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ,
>>>> Registered in England & Wales, Company No: 2557590
>>>> ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1
>>>> 9NJ, Registered in England & Wales, Company No: 2548782
>>>>
>>>
>>>
>>> _______________________________________________
>>> gem5-users mailing list
>>> gem5-users@gem5.org
>>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>>>
>>
>>
>>
>>  --
>>      Joel Hestness
>>   PhD Candidate, Computer Architecture
>>   Dept. of Computer Science, University of Wisconsin - Madison
>>   http://pages.cs.wisc.edu/~hestness/
>>
>
>
>
>  --
>    Joel Hestness
>   PhD Candidate, Computer Architecture
>   Dept. of Computer Science, University of Wisconsin - Madison
>   http://pages.cs.wisc.edu/~hestness/
>
_______________________________________________
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to