Showing posts with label hardware. Show all posts
Showing posts with label hardware. Show all posts

2013/05/22

I need more power!

I upgraded Corey again. This time with a brand-new used CPU. I require Corey to be fanless. This means I can't use the most advanced CPU out there. High end CPUs get far to hot, even for my massive heat sink. The advantage of this, though, is that I got the CPU off eBay for a fraction of the cost of something new. The previous CPU was an LE-1100 and had a thermal design of 45W. I could have gotten a 2 core CPU with a thermal design of 65W but I was afraid of overheating. I got an LE-1660, still 45W but 47% faster then the previous CPU.

Anyway, it arrived today. And instead of working, I installed it. This was a bit of an adventure. This CPU didn't exist when my motherboard was built, so while it booted, Linux was showing the CPU ID as "unidentified" which was disconcerting. I decided to upgrade the BIOS. Which is where our adventure begins.

ASUS provides a BIOS flashing utility for DOS. When was the last time you booted DOS? I have some DOS floppies... but that way lies pain. How about booting DOS from a USB key? With a little farting around, here is what I discovered.

First off, my USB key is already formatted with one partition, FAT32. It is /dev/sdb on my system.

yum upgrade syslinux # just in case
sudo syslinux -f /dev/sdb1
# This next command is so non-obvious the developers should be shot!
# Why isn't this integrated into syslinux?
sudo dd conv=notrunc bs=440 count=1 if=/usr/share/syslinux/mbr.bin of=/dev/sdb
sudo mount /dev/sdb1 /mnt
wget http://goebelmeier.de/bootstick/bootstick.zip
unzip bootstick.zip 
cd BootStick/
sudo rsync -av usb-root/ /mnt/ # ignore the permission warnings
cd ..
unzip AFUDOS236.zip
sudo cp AFU236U.exe /mnt/flash/afu.exe
unzip M2NSE501.zip
sudo cp M2NSE501.ROM /mnt/flash/

Now reboot from the USB key. For me, this involves hitting F8 inside a 5 second window. Type ENTER twice when DOS asks for time and date. Then

CD FLASH
AFU /O0308.ROM 
AFU /IM2NSE501.ROM
The first AFU command saves the current ROM. The second one flashes with the new ROM. It takes a tense 2 minutes for it to complete. Tense because I realized to late the computer wasn't plugged into a UPS. A black out during ROM flashing means a bricked motherboard.

Of course, flashing a new ROM means all BIOS config is reset to annoying factory defaults.

What's more, this new BIOS will not boot Linux without noapic. But with only one core, I don't really care. I turned the APIC off in the BIOS.

So, was it worth it? Subjectively Corey feels a lot faster. And hotter; when Corey was lying flat on the test bench, the heat sink was almost to hot to touch. CPU temp was 59C! Now with Corey upright, CPU temp is 51C. Given that the max operating temp is 65C, I wonder if it can survive the next heatwave. What's more, the new CPU has virtualization instructions, so I can run KVM on my desktop!

2012/12/19

Z8NA and lm_sensors, again

So I was setting up another Z8NA and wanted to get sensors working. After running around in circles, I simply installed from source and now it Just Works. Which is so much better, compared to last times results. BTW, I also install lm-sensors 3.3.4 by hand from source and got a z8na.conf from here.

cd ~/work/sys
wget http://khali.linux-fr.org/devel/lm-sensors/config/sensors3-Asus-Z8NA-D6.conf 
sudo cp sensors3-Asus-Z8NA-D6.conf /etc/sensors.d/z8na.conf
wget http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-3.3.4.tar.bz2
tar jxvf lm_sensors-3.3.4.tar.bz2
cd lm_sensors-3.3.4
make
sudo make install
sudo sensors-detect
sudo sensors -s
sudo sensors

For what its worth, kmod-w83795 RPMs are available in my repo.

2011/09/14

Pretty lights

In a fit of weakness, I bought 2 silly USB mail lights. This are basically a PIC that talks USB on one side, and turns coloured leds on and off. They come with software that is supposed to check if you have mail and change colour depending on what's going on. Of course, the supplied software is Windows only and doesn't even work it seems.

Not that I care about a light that tells me if I have e-mail pending. But controling pretty lights from the computer? I'm all over that. Someone had already written a script in Python to control these things. I ported it to Perl because, well because I like Perl.

To use it, you must have Device::USB installed. And perl, of course.

http://pied.nu/Perl/setcolour

Doing setcolour will show you all devices installed

Doing setcolour 1294:1320 1 will set all mail devices to colour 1, which is blue on one of my devices, green on the other.

Doing setcolour 2-7 2 will set one mail device to colour 2, which is red on both my devices.

2011/08/19

Arduino on CentOS 5

So I bit the bullet and bought an Arduino UNO. The packaging should have a label on it "WARNING: BY OPENING THIS PACKAGE YOU RECOGNISE YOU WILL GET NO USEFUL WORK DONE TODAY."



All I wanted was to get one LED to flash. But that requires a avr-cpp-g++, which isn't available for CentOS 5. GRRRR!



So I wasted to much time getting the CentOS 6 SRPMs and getting them to compile. But you may fetch them from my psuedo-repo.

While time was a wasting, a kind soul on IRC sent me a hex file for bitlash which I managed to upload to the board. This allowed me to flash a few LEDs and get on with my work.

Writing code for the Arduino Uno in CentOS 5


RPMs will need from the psuedo-repo
avr-libc-1.7.0-1.noarch.rpm

avr-libc-docs-1.7.0-1.noarch.rpm
avr-binutils-2.20-2.x86_64.rpm
avrdude-5.10-1.x86_64.rpm
avr-gcc-4.5.0-2.x86_64.rpm
avr-gcc-c++-4.5.0-2.x86_64.rpm
gmp-4.3.1-7.x86_64.rpm
gmp-devel-4.3.1-7.x86_64.rpm
gmp-static-4.3.1-7.x86_64.rpm
libmpc-0.8-3.x86_64.rpm
libmpc-devel-0.8-3.x86_64.rpm
mpfr-2.4.1-6.x86_64.rpm
mpfr-devel-2.4.1-6.x86_64.rpm

You will also need arduino-0022.tar.gz, which I installed in /opt/arduino.

Now the IDE works, but it's in Java. Which hates me, hates Linux and I hate Java just as much, just for good measure I also hate IDEs. Working from two tutorials and with some slamming my head into the table, I got it working. The trick was massaging Johan's Makefile into something that worked. I also had to patch /opt/arduino/hardware/arduino/cores/arduino/wiring_private.h.

To start a new project, lets say "blink2"
mkdir blink2

cd blink2
wget http://awale.qc.ca/CentOS/rhel5/Makefile.arduino -O Makefile
wget http://awale.qc.ca/CentOS/rhel5/resetArduino.pl
touch blink2.pde

Now add your code to blink2.pde.

And here is my first Arduino program. It's a 6 LED chaser. It would be more, but I can only find 6 LEDs right now. Pins 13-9 are red, pin 8 is green. The green light stays on twice as long as the others.
#define DELAY 100


int state;
void setup(void) {
int pin;
state = 1;
for(pin=13; pin >=8; pin-- )
pinMode(pin, OUTPUT);
}

void set_state(void) {
int pin;
int mask = 1;
for(pin=13; pin >=8; pin-- ) {
digitalWrite( pin, (state & mask) );
mask <<= 1;
}

}

void loop(void) {

if( state == 1 ) {
state = 3;
}
else {
state = state << 1;
}
/* 0001 1000 = 18 */
/* 0011 0000 = 30 */
if( state == 0x60 ) { /* 0110 0000 = 60 */
state = 0x20;
set_state();
delay( DELAY*4 );
state = 1;
}
/* 0100 0010 = 42 */
else if( state == 0x42 ) {
state = 3;
}
set_state();

delay(DELAY);
}


Now compile and upload it:
make && sudo make upload

2011/07/15

Pain

Something you don't see everyday:

# cat /proc/mdstat 
Personalities : [raid6] [raid5] [raid4]
md0 : active raid5 sdb2[3](S) sdc2[2] sda2[4](F)
312367616 blocks level 5, 256k chunk, algorithm 2 [3/1] [__U]

unused devices:
Of course, this happens the day before I leave on a 2 week vacation.

2011/05/17

Z8NA-D6 and lm-sensors

The ASUS Z9NA-D6 motherboard uses a w83795 chip for lm-sensors. Asus provides binary drivers, and then only for CentOS 5.4. On 5.6, you'll need these drivers. I've tested and they work on CentOS 5.6, 2.6.18-238.9.1.el5 x86_64. However, while sensors sees the chip, it doesn't manage to read the values. Must poke at it further.

Update: I finally got it working.

2011/01/14

I need more RAM, Scotty!

Lookit this:
~ (root@corey:)# free
total used free shared buffers cached
Mem: 3913752 821824 3091928 0 38376 439640
-/+ buffers/cache: 343808 3569944
Swap: 0 0 0
4GB of RAM on Corey, boyee!

RAM is really cheap. I've been saying this for years. USD is also cheap these days. And I was finding Firefox really annoying at times. So I poked around Asus's site, discovered that Kingston claims that a M2N-MX SE can take 4GB of RAM. Out came the credit card. Thank you Newegg, thank you Purolator.

And yes, Firefox is subjectively much faster. Even though, as you can see above, I'm still using less then the 1 GB I had previously.

Or maybe it just stutters less. Or maybe it's the fresh reboot.