Showing posts with label Hercules. Show all posts
Showing posts with label Hercules. Show all posts

Friday, February 17, 2012

Kernel for S/390 and hercules

So now you have a cross-compiler, now to get a kernel for your mainframe!

Download kernel source, unpack and configure:
wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.2.6.tar.bz2
tar jxf linux-3.2.6.tar.bz2
cd linux-3.2.6
make ARCH=s390 CROSS_COMPILE=/opt/s390/bin/s390-ibm-linux- defconfig

Now you have your kernel source setup for building a S/390 kernel with the default kernel configuration. You can now customize the configuration by running:
make ARCH=s390 CROSS_COMPILE=/opt/s390/bin/s390-ibm-linux- menuconfig
For example, some drivers defaults to being built as modules, that you might like to have in your kernel image instead.

Now build the kernel (add -j2 or more if you have a SMP system to speed up the compilation):
make ARCH=s390 CROSS_COMPILE=/opt/s390/bin/s390-ibm-linux- 

The kernel should build successfully, and you should have a kernel image in
arch/s390/boot/image ready for IPL on your mainframe.

Thursday, February 16, 2012

Cross-compiling for S/390

Playing with hercules S/390 emulator I wanted an up-to-date Linux kernel. And to get that you need tools: binutils (assembler and linker) and gcc (C compiler). Cross-compiling binutils and gcc that is able to build a kernel is very easy, just follow these steps and you should end up with a gcc able to build a kernel for you.

Download and build binutils:
wget http://ftp.gnu.org/gnu/binutils/binutils-2.22.tar.bz2
tar jxvf binutils-2.22.tar.bz2
mkdir os390 && cd os390
../binutils-2.22/configure --prefix=/opt/s390 --target=s390-ibm-linux
make
make install

Ok, now you have binutils built and installed, next the compiler itself. So, download and build gcc:
(Note the make build and install targets!)
wget http://ftp.gnu.org/gnu/gcc/gcc-4.6.2/gcc-4.6.2.tar.bz2
tar jxvf gcc-4.6.2.tar.bz2
mkdir gs390 && cd gs390
../gcc-4.6.2/configure --prefix=/opt/s390 --target=s390-ibm-linux --enable-languages=c
make all-gcc
make install-gcc

Now you have gcc that you can use to build a kernel for your S/390 mainframe (or Hercules emulator if you are like me and can't afford one :)

Wednesday, March 17, 2010

Mainframe in your pocket

I just uploaded hercules, an S/390 emulator, to extras-devel. Now you can enjoy your favorite mainframe operating system on your N900, N810 and N800, be it an original mainframe OS or Linux.

Below an screen shot of Slack/390 install disk booting up.