OpenCores
no use no use 1/1 no use no use
Running Linux 2.6.34 in or1ksim
by julius on Jun 9, 2010
julius
Posts: 323
Joined: Jul 1, 2008
Last seen: Feb 8, 2012
Hi all,

We'll update the documentation on the page in the OpenRISC project soon, but for now here's a list of instructions on how to get the latest OpenRISC Linux kernel port up and running in OR1ksim.

1. Download the kernel patch

2. Download the 2.6.34 kernel

3. Extract the kernel sources

# tar xjf linux-2.6.34.tar.bz2


4. Apply the patch from within the kernel sources directory


# cd linux-2.6.34/

linux-2.6.34 # bzcat -dc ../linux-2.6.34-or32.patch.bz2 | patch -p1


5. Extract the initramfs

linux-2.6.34 # cd arch/or32/support && tar xjf initramfs.tar.bz2; cd -


6. Configure and build the kernel. You will require the or32-elf toolchain.

linux-2.6.34 # make defconfig

linux-2.6.34 # make


7. Run the kernel in or1ksim. Or1ksim must be installed, here we presume it is in the shell's PATH and is called or32-elf-sim. The simulator configuration file is in the kernel patch, and is passed with the -f option.

linux-2.6.34 # or32-elf-sim -f or1ksim_linux.cfg vmlinux



That should be it.
RE: Running Linux 2.6.34 in or1ksim
by jeremybennett on Jun 9, 2010
jeremybennett
Posts: 689
Joined: May 29, 2008
Last seen: Feb 9, 2012

Hi Julius,

Nice progress. The instructions work fine. Just a few comments

  • I think the directory structure is wrong. There is a top level linux directory, which should have a sub-dir under it for each Linux version. That's what we did with GDB, GCC etc.

  • You show a # prompt in your example. Just to avoid doubt, you do not need to be superuser to run these instructions.

  • When I got to the busybox prompt, I found that output is to the Or1ksim console, not the xterm. I'll file this as a bug.

Jeremy

--
Tel: +44 (1590) 610184
Cell: +44 (7970) 676050
SkypeID: jeremybennett
Email: jeremy.bennett@embecosm.com
Web: www.embecosm.com

RE: Running Linux 2.6.34 in or1ksim
by jeremybennett on Jun 9, 2010
jeremybennett
Posts: 689
Joined: May 29, 2008
Last seen: Feb 9, 2012
  • When I got to the busybox prompt, I found that output is to the Or1ksim console, not the xterm. I'll file this as a bug.

Ignore that last comment - incompetence on my part. It works just fine!

Jeremy

RE: Running Linux 2.6.34 in or1ksim
by julius on Jun 9, 2010
julius
Posts: 323
Joined: Jul 1, 2008
Last seen: Feb 8, 2012
I think the directory structure is wrong. There is a top level linux directory, which should have a sub-dir under it for each Linux version. That's what we did with GDB, GCC etc.

We'll hopefully set up a git repository to host the Linux kernel port, and these patches won't be in the repository, rather they'll be downloadable from the website/FTP.

You show a # prompt in your example. Just to avoid doubt, you do not need to be superuser to run these instructions.

That's right, no need to be superuser. I wasn't aware of this convention, I'll steer clear of it in future.

Thanks for the feedback!
RE: Running Linux 2.6.34 in or1ksim
by jeremybennett on Jun 9, 2010
jeremybennett
Posts: 689
Joined: May 29, 2008
Last seen: Feb 9, 2012

Hi Julius,

Have you just slipped something out there? We've only just settled down to Subversion. Is there a plan now to move to git?

I hoped we keep all the tools and operating systems together. The last thing we want is a fragmented project!

ATB

Jeremy

--
Tel: +44 (1590) 610184
Cell: +44 (7970) 676050
SkypeID: jeremybennett
Email: jeremy.bennett@embecosm.com
Web: www.embecosm.com

RE: Running Linux 2.6.34 in or1ksim
by julius on Jun 9, 2010
julius
Posts: 323
Joined: Jul 1, 2008
Last seen: Feb 8, 2012
Have you just slipped something out there? We've only just settled down to Subversion. Is there a plan now to move to git?

Rest assured, I mean we expect to set up a git repository for the OpenRISC Linux kernel port. git was designed to manage a project like the Linux kernel, so it makes sense to keep it in revision system like that. It will also keep the chore of maintaining the port easier too, as far as I understand.

So don't worry, we're sticking with SVN for everything else.

RE: Running Linux 2.6.34 in or1ksim
by jeremybennett on Jun 9, 2010
jeremybennett
Posts: 689
Joined: May 29, 2008
Last seen: Feb 9, 2012

Hi Julius,

What most projects do is mirror git and SVN, so people can access via either. That would seem to be the right approach here. I believe the tools for that are now pretty standard.

ATB

Jeremy

RE: Running Linux 2.6.34 in or1ksim
by xianfeng on Sep 7, 2010
xianfeng
Posts: 4
Joined: Aug 25, 2008
Last seen: Feb 6, 2012
Hi Julius,

Built busybox 1.17.0 with defconfig, but I ran into an issue, like this:


...
NET: Registered protocol family 17
NET: Registered protocol family 15
Freeing unused kernel memory: 752k freed
init started: BusyBox v1.17.0 (2010-09-07 17:52:06 HKT)
can't fork

can't open /dev/tty2: Unknown error 2onsole.
can't open /dev/tty3: Unknown error 2
can't open /dev/tty4: Unknown error 2
can't open /dev/tty2: Unknown error 2
uname -a
Linux (none) 2.6.36-rc3-or32-00001-ga147cf3 #128 Tue Sep 7 18:03:22 HKT 2010 or32 GNU/Linux
#
ls
USERSPACE: SIGSEGV (current c165d670, pid 825)
CPU #: 0
PC: 00000000 SR: 00008076 SP: 7fdb7c04
GPR00: 00000000 GPR01: 7fdb7c04 GPR02: 7fdb7ebc GPR03: 01136018
GPR04: 7fdb7c04 GPR05: 00000000 GPR06: 00000060 GPR07: fffffffc
GPR08: 7fdb7be4 GPR09: 00000000 GPR10: 00000000 GPR11: 01136008
GPR12: 00000000 GPR13: 00000000 GPR14: 00000000 GPR15: 00000000
GPR16: 01133ed0 GPR17: 00000000 GPR18: 00000000 GPR19: 01136078
GPR20: 00000000 GPR21: 00000000 GPR22: 00000001 GPR23: 00000000
GPR24: 00000001 GPR25: 00000000 GPR26: 7fdb7ed4 GPR27: 00000000
GPR28: 00000000 GPR29: 00000000 GPR30: 00000000 GPR31: 00000000
RES: 00000000 oGPR3: 01136018 syscallno: 00000000
Process ls (pid: 825, stackpage=c165d670)

exit(34423)
@reset : cycles 0, insn #0
@exit : cycles 12885349218, insn #513221445
diff : cycles 12885349218, insn #513221445

-------------------------------

"uname -a" works, but "ls" will cause a panic to happen. So, looks like this a busybox issue.

You also use the same version of busybox as the initramfs, but it works well, so could you please let me know how to fix this problem?

Thanks,

--Xianfeng


RE: Running Linux 2.6.34 in or1ksim
by julius on Sep 7, 2010
julius
Posts: 323
Joined: Jul 1, 2008
Last seen: Feb 8, 2012
Hi Xianfeng,

Make sure you're using the latest uClibc library to compile. The uClibc installed with the toolchain install script is now out of date. You'll need to follow the instructions on the toolchain page to update the uClibc port found here: http://opencores.org/openrisc,gnu_toolchain#uclibc_build_by_hand

If you are using this latest uClibc version and find any issues, please report back.

We aim to sort out problems like this by providing the latest of the OpenRISC ported tools and libraries with the release of the toolchain that's coming up at the end of the month.

Julius
RE: Running Linux 2.6.34 in or1ksim
by xianfeng on Sep 8, 2010
xianfeng
Posts: 4
Joined: Aug 25, 2008
Last seen: Feb 6, 2012
Hi Julius,

Thank you for your responses. According to your suggestion, change to use uClibc-0.9.31, but I still got the panic, like this


NET: Registered protocol family 15
Freeing unused kernel memory: 752k freed
USERSPACE: SIGSEGV (current c1027bd0, pid 1)
CPU #: 0
PC: 010ca738 SR: 00008276 SP: 7f9d9bbc
GPR00: 00000000 GPR01: 7f9d9bbc GPR02: 7f9d9f0c GPR03: 00000000
GPR04: ffffffff GPR05: 00000000 GPR06: 00000008 GPR07: ffffffff
GPR08: ffffffff GPR09: 010ca734 GPR10: 00000000 GPR11: 00000000
GPR12: 01136628 GPR13: 000000ff GPR14: 7f9d9c6c GPR15: 00000000
GPR16: 00000001 GPR17: 00000000 GPR18: 00000001 GPR19: 7f9d9bd0
GPR20: 00000000 GPR21: 00000000 GPR22: 00000077 GPR23: 00000000
GPR24: 00000001 GPR25: 00000000 GPR26: 7f9d9f24 GPR27: 00000000
GPR28: 00000000 GPR29: 00000000 GPR30: 00000000 GPR31: 00000000
RES: 00000000 oGPR3: 00000000 syscallno: 00000000
Process init (pid: 1, stackpage=c1027bd0)

exit(34423)
@reset : cycles 0, insn #0
@exit : cycles 8307392199, insn #335562988
diff : cycles 8307392199, insn #335562988

------------

Besides uClibc, are you also using other version of gcc, binutils, etc to build the busybox?



Thanks,
--Xianfeng

RE: Running Linux 2.6.34 in or1ksim
by xianfeng on Sep 8, 2010
xianfeng
Posts: 4
Joined: Aug 25, 2008
Last seen: Feb 6, 2012
Hi Julius,

Thank you for your responses. According to your suggestion, change to use uClibc-0.9.31, but I still got the panic, like this


NET: Registered protocol family 15
Freeing unused kernel memory: 752k freed
USERSPACE: SIGSEGV (current c1027bd0, pid 1)
CPU #: 0
PC: 010ca738 SR: 00008276 SP: 7f9d9bbc
GPR00: 00000000 GPR01: 7f9d9bbc GPR02: 7f9d9f0c GPR03: 00000000
GPR04: ffffffff GPR05: 00000000 GPR06: 00000008 GPR07: ffffffff
GPR08: ffffffff GPR09: 010ca734 GPR10: 00000000 GPR11: 00000000
GPR12: 01136628 GPR13: 000000ff GPR14: 7f9d9c6c GPR15: 00000000
GPR16: 00000001 GPR17: 00000000 GPR18: 00000001 GPR19: 7f9d9bd0
GPR20: 00000000 GPR21: 00000000 GPR22: 00000077 GPR23: 00000000
GPR24: 00000001 GPR25: 00000000 GPR26: 7f9d9f24 GPR27: 00000000
GPR28: 00000000 GPR29: 00000000 GPR30: 00000000 GPR31: 00000000
RES: 00000000 oGPR3: 00000000 syscallno: 00000000
Process init (pid: 1, stackpage=c1027bd0)

exit(34423)
@reset : cycles 0, insn #0
@exit : cycles 8307392199, insn #335562988
diff : cycles 8307392199, insn #335562988

------------

Besides changing to use new version of uClibc, are you also using other version of gcc, binutils, etc to build the busybox?



Thanks,
--Xianfeng

no use no use 1/1 no use no use
© copyright 1999-2012 OpenCores.org, equivalent to ORSoC AB, all rights reserved. OpenCores®, registered trademark.