Archive for January, 2010

HP PA-RISC J6750 — Installing Gentoo Linux

Posted in HowTo, Projects on 19/01/2010 by Undersys

The HP J6750 is a dual PA-RISC CPU @875mhz box you can find the full specs located hear.

I will be dual booting this machine with HP-UX 11.11 and Linux (just for fun).

I need this machine  to run HP-UX as its main cause for work reasons.
As a side project I will install Linux on to the second disk.

I will be using Gentoo Linux, as that’s what I like, feel free to use any HPPA supported Linux.

Linux is still very immature on the PA-RISC platform, there’s a lot to be worked on and a lot of bugs, Not saying that it can not be stable you just need to understand certain things.

One big key thing is what width will your kernel be, since PA-RISC 2.0  is 64bit HP have been kind enough to allow some models to still run 32bit PA-RISC code.
Currently the Linux kernel is MUCH more stable in 32bit. User land is more stable in 32bit.
I will soon have a minimum of 8gb of ram in this system (hoping for 16gb) there for I will have no choice but to run with a 64bit Linux kernel. Userland can always be a mix of 64bit and 32bit applications.

The one thing I like  about Gentoo is there “Handbooks” very useful for any base system install.
For installing Gentoo HPPA on to the j6750, just follow the hand book.
Unfortunately there’s a few issues around 64bit kernels.
When you go to build the kernel it will quite happily build a 32bit version, not what I need.So follow the following to build a 64bit kernel
Commands to type are in italics

So you need to emerge kgcc64.
# emerge emerge kgcc64
This will get you a 64bit build environment for your kernel. Next you need to set up the environment.
Firstly select the correct GCC version, lets check to make sure we have the necessary versions installed.
# gcc-config -l
This should report the following :-
[1] hppa2.0-unknown-linux-gnu-4.2.4 *
[2] hppa64-unknown-linux-gnu-4.2.4 *
Enter the following command to select the 64bit environment.
# gcc-config 2 ( this will select option two from the above list)
This will give the output:-
* Switching cross-compiler to hppa64-unknown-linux-gnu-4.2.4 …
you now need to edit one extra file to ensure that make knows what cross compile environment to use. (note this is only important when building the kernel the first from from the install CD  since the CD is 32bit and we need to cross compile to 64bit)

With out the following you will get an error like this :-
“make: hppa64-linux-gnu-gcc: Command not found”

Edit the following file :-
# nano /usr/src/linux/arch/parisc/Makefile
edit the following section:-
Under the section called “ifdef CONFIG_64BIT”
Change the following line from :-
CROSS_COMPILE   := hppa64-linux-gnu-
to :-
CROSS_COMPILE   := hppa64-unknown-linux-gnu-

If you do not do this make will not be able to find a cross compile environment for the 64bit PA-RIRSC.
You can continue to configure the kernel. ( see my .config later in this post) Keep following the Gentoo Handbook from this point onwards.

After install there’s a few things that bugged me (I dislike seeing “warnings” during the boot processes)

1) During boot your console spews forth this:-

setfont: putfont xxx,xxxx: failed -1
putfont: PIO_FONT: Function not implemented
putfont: PIO_FONT trying…

This is ugly, slows the boot and just really pisses me off..
Consolefont  has known issues under HPPA on “some” hardware platforms so this may not effect you depends on the machine. Also my HP FX-10 pro (A1299B) is unsupported as a framebuffer, text mode rocks anyway..
You need to disable consolefont in Gentoo to get rid of the messages:-
# rc-update del consolefont

2) The console will spew the following constantly:-
“INIT: Id “b0″ respawing too  fast: disabled for 5 minutes”
“b0” referfs to the early stage of boot where the PDC still holds control of the console, later on in the boot the kernel swaps over from boot console “ttyB0” to ttyS0. So I can not see any need/ reasion to keep this open.
lets comment out the ttyB0 from inittab
edit :-
# nano /etc/inittab
comment out the following line :-
“b0:12345:respawn:/sbin/agetty 9600 ttyB0 vt100”

Ensure that “s0” or “s1” are enabled otherwise you will have no console!

It should now boot happily with no warnings…

# uname -a
Linux valve 2.6.32-gentoo-r1 #13 SMP Mon Jan 18 20:36:11 EST 2010 parisc64 PA8700 (PCX-W2) 9000/785/J6750 GNU/Linux

# cat /proc/cpuinfo
processor    : 0
cpu family    : PA-RISC 2.0
cpu        : PA8700 (PCX-W2)
cpu MHz        : 875.000000
capabilities    : os32 os64
model        : 9000/785/J6750
model name    : Duet W2
hversion    : 0x00005dd0
sversion    : 0x00000491
I-cache        : 768 KB
D-cache        : 1536 KB (WB, direct mapped)
ITLB entries    : 240
DTLB entries    : 240 – shared with ITLB
bogomips    : 1744.89
software id    : 2002919556

Theres one thing to keep in mind.
If your running a 64bit kernel with more then 4gb of ram you really should be using discontiguous memory mapping.
This web site explains why discontiguous memory mapping its a good idea, flat memory mapping is still supported in 64bit kernel, just not a good idea. The web site talks about the ZX1 but the concept of memory holes still applies to astro and runway bus used in the J class.

Overall, Linux is VERY immature on this platform and slow compared to HP-UX (and its FAR from light) but the more I use it the more I can fix things and tune things make it work better.

I am still miffed to this day WHY HP though IA64 should replace  PA-RISC.
Don’t get me wrong I like IA64 too….
I even own an Itanium2 (more on that later) I personalty think PA-RISC could of gone much further its a very nice architecture.  Also a lot easier to optimize then IA64…

In the next few days I will upload images of the j6750 to my flicker so keep  an eye on that.

You can find my initial kernel .config file  here. ( SMP, 64bit, very fat)
If you want 64bit and under 4gb of memory I would recoment using flat memory mapping over discontiguousmemory mapping, flat memory mapping for under 4gb will be faster and more stable.
HPPA SMP 64bit .config
Rename the above file to .config  or just .txt to read.
This is NOT a word .doc file , just silly wordpress won’t accept .txt  Like i would use word for anything!

I will work on making this more optimized and smaller later on. For now  it boots.


PIC Based Web Server

Posted in Projects on 10/01/2010 by Undersys

A long time a go I brought an electronics kit that when completed allowed me to turn on a AC mains device. Worked via a parallel port and a few opto couplers. So when you made one of the pins on the parallel port go high the circuit would switch on the mains power.

This was used for my HP-UX system since you can not turn it on via serial console. The web console I have can not remote power on the system I own. Normally with the larger HP-UX machines they can turned on and off via the web console.
So by setting a pin high on the parallel port I could turn it on and then connect to the web console.

So how is the PIC web server fitting in to this? Well simple the machine that had the parallel port is no longer in my rack, so I have no parallel ports on machines that are on 24/7, this is where the PIC web server comes in.

A few months back my favorite local electrons magazine ran an article on a PIC ( Microchip ds33FFJ12GP201) based web server with the following ability, 4x digital outputs, 4x analog inputs and a RS232 interface to the PIC.

This meets my needs. Its low power, low heat and cheep and supports digital inputs.
So I can modify the existing kit to input into the PIC web server. This would then allow me to turn on the power via a web page

This also gives me a good excuse to buy a PIC starter kit from Microchip, since I want to find a way to make use of that RS232 port.

Hear is a shot before I put the lid on. You can find all the images on my flicker.