ChaOS Diary April 2012

ChaOS Home    ChaOS Source Notes    ChaOS Source Index    ChaOS Downloads    CTPP Home

Diary to Mar 2012    Diary to Dec 2011    Diary to Sep 2011    Diary to Mar 2011    Diary to Dec 2010    Diary to Sep 2010    Diary to Jun 2010    Diary to Mar 2010    Diary to Dec 2009    Diary to Aug 2009    Diary to Apr 2009    Diary to Nov 2008

ChaOS Diary - monoblog and links to reference documents

Many golden nuggets lie herein.        Trademarks are acknowledged as copyright of their respective owners

20/5/2012 D10 C02 Laser CNC upgrade Oxford PCI parallel card does work OK on 440BX main board, modified D10 software to drive PCI card through MOSFET stepper driver for 4th axis, to avoid swapping leads and Z axis parameters between laser lens control and grinding wheel depth. Ground 6 rollers from 1625mm to 950mm using the new system.

Also added serial port module to D10, to control laser coolant pump via Omron C40H PLC. With some rewiring, all the laser ancilliary equipment will eventually be controlled through the RS232 port of the PLC, to free up 8-bits of parallel IO currently on the old ISA DIO-48 card.

As mentioned before, the problem with the standard Atom 300/D525 motherboards is a lack of PCI slots to add parallel port adapters. Came across a MaxSun motherboard with Intel Atom D525 and two PCI slots, as well as on-board parallel port which more than resolves the shortage of parallel IO, and well worth a punt on eBay at 20 quid. With some DDR2 memory and a hard disk, the laser CNC will soon be upgraded from 32-bit PentiumII 350MHz, to 64-bit Dual core HT Atom D525 1.8MHz.

Ordered some 667MHz ECC DDR2 memory, cheap and plentiful from high-end servers and workstations being upgraded, to give the new system industrial reliability. Hope this all works as planned, little financial risk in finding out.

The MaxSun board also has RS232 (to control the Omron PLC, and USB ports which can be used as 5v power sources for breakout boards. Using single-port PCI parallel cards this will provide up to 36 high-current 5V outputs, and 15 inputs - more than enough to complete this upgrade. The two PCI slots could each drive a dual parallel port, taking the system capacity to 60 outputs and 25 inputs, should the need arise. It is not improbable to imagine this little computer controlling two multi-axis CNCs simultaneously, using programs running on separate threads of the Atom, with another thread running the operating system and network services.

Stripped down laser coolant pump and chiller to fix a leak which appeared over winter, suspecting busted copper tubes in the heat exchanger (previously fixed after record frosts in winter 2009/2010). Chiller appeared fine on compressed air test at 60 psi, no leaks. Water leak can only have come from a slack compression fitting on the tank above the coolant system, misdiagnosed as a repeat of the previous problem. Reassembled, tested coolant circuit with control now via C40H PLC. Laser now ready for some cutting tests tomorrow.

* direct diary upload via FTP1 (encrypted!) from 4Gb CFS SATA partition sab2: over ChaOS version 1.02.27980

13/5/2012 CO2 Laser Dusting down laser, little used since Coherent Diamond64 packed up finally last year. I have a 40W system running, to be upgraded to a more powerful tube when demand picks up. Meanwhile looking to replace the ISA DIO (yes ISA!) with PCI parallel cards, in readiness for retiring the 350MHz PII 440BX system which has served to run the laser for 14 years.

Latest cheap-and-cheerful PCI parallel cards from China (WinChipHead) do not work out of the box in this ancient machine, I do not know why. While the card is recognised, I/O writes make no difference to the output port voltages, they all seem to be stuck high.

Oxford 1284 PCI card is not much better, this one responds to I/O writes, but output level changes are insufficient to drive my (vintage 1986) VN10KM stepper drive box. Maybe these more modern PCI parallel cards outputs are current-limited. Hoping the Oxford card will drive my new MOSFET stepper, in which case I can run the old I/O on the inbuilt parallel port, and the new I/O on Oxford cards. Will check tomorrow.

I have also dusted down my Omron Sysmac C20H PLC and programmer, which can be configured to control all the laser ancilliaries (extractor, chiller, water pump, compressor, etc) through an RS232 interface. This would just about bring the laser I/O requirement within the capability of a basic Atom 330 or D525 mini-ITX system. Ultimately this has to be the way to go, with all the advantages of 64-bit multi-core processing; if short of I/O, one Atom box can handle all the synchronous I/O, and another Atom box can be controlled by the first via ethernet for asynchronous tasks (lens/grinder steppers).

* direct diary upload via FTP1 (encrypted!) from 4Gb CFS SATA partition sab2: over ChaOS version 1.02.27980

29/4/2012 Intel 3rd generation Core Finding myself strangely attracted to the new 22nm Intel range, officially released today. The lower power consumption per clock offered by these chips offers an economy which may outweigh the inevitable price premium. I look forward to seeing the prices on offer.

* direct diary upload via FTP1 (encrypted!) from 4Gb CFS SATA partition sab2: over ChaOS version 1.02.27979

26/4/2012 Intel GMA After sending emails to Intel last year requesting a developer account, but receiving no reply, I had largely given up a search for register-level information on Intel GMA. But I have now found all the information on intellinuxgraphics.org, and within a few minutes had the GMA hardware cursor switching on and off.

Most interesting is that Intel GMA is already quite prevalent, present on my Toshiba Satellite, and all three Intel Atom platforms currently running, and is included on-chip in the latest Intel Core i3/i5/i7 processors, so it is definitely worth supporting. I tried developing some hardware-accelerated graphics functions using ATI graphics cards some years ago, but was stymied by commercial protection of developer information - the manuals which I did receive from ATI were of poor quality and did not cover the latest products. (This was over ten years ago; to be fair, with the integration of ATI into AMD the quality of reference information is now on a par with Intel) Though I spent two or three years dabbling with ATI cards (managing to run a triple-screen system at one point), but the whole setup was very hardware-specific. As I moved into programming other devices, particularly Fujitsu Stylistic tablet PCs, I drifted towards the more universal VESA standards.

Graphics hardware since then has become much more sophisticated, with features such as MPEG decode which would save a bundle of CPU time. GMA also has panel registers which allow instant resizing of the display much like the wide-screen, 16:9,4:3 modes on a TV set. Also dual-display is back on the menu, always welcome (as blank screens go with the territory when messing with video hardware!). So the release of proper programming manuals by Intel, albeit for the Linux community, allows me to dabble once again. I look forward to including a few GMA features in ChaOS, according to my usual rule that they should work on all my machines, without too much drama.

* direct diary upload via FTP1 (encrypted!) from 4Gb CFS SATA partition sab2: over ChaOS version 1.02.27979

24/4/2012 Intel i7-920, Power Supplies and Password Cracking A minor annoyance, having forgotten one of my ChaOS passwords, wrote a quick program to try to find the password by the brute force method - i.e. try every possible combination of the characters I might have used. This is clearly going to take forever, so I added a few tweaks, to exclude improbable combinations of consonants and vowels. This brings the time for cracking a 9-character password (lower-case only!) to about one month.

So as an exercise, I tried to launch 8 copies of the program, each running a different character range, on the 8 cores of my Intel i7-920. On launching the fifth or sixth core, the computer switched itself off. Tried again, same thing. On the third attempt, the computer power supply failed with a mighty flash and bang.

As many have done before me, spent a day wondering whether I had trashed not only the power supply, but also the motherboard and the Quad-Core i7 processor. On inspection it is clear that some components in the power supply had been overheating, and the incoming 240V 5A line fuse had been obliterated. Thankfully, after installing a new power supply (Corsair CX600), everything is operating normally again. Awesome how much power these big Intel chips can draw when firing on all cylinders!

* direct diary upload via FTP1 (encrypted!) from 4Gb CFS SATA partition sab2: over ChaOS version 1.02.27979

19/4/2012 Network Servers and the growing pains of a Home-Grown Operating System Server hung up again last night, this time due to a breakpoint left in a routine I use to browse the server logs remotely. Breakpoint removed, system running fine no reboot required.

Remote encrypted access to servers now working as expected. Getting there.

* direct diary upload via FTP1 (encrypted!) from 4Gb CFS SATA partition sab2: over ChaOS version 1.02.27979

17/4/2012 Network Servers and the growing pains of a Home-Grown Operating System Still experiencing server downtime due to system crash when HTPSRV database backup kicks in. Fiddling with the OS database code causes filesystem problems, as the database code is embedded in the operating system.

After trashing the filesystem on the main server drive pda2:, switched to pda1: and wrote a routine to scan pda2: for the website files I had lost. It is easy to locate lost files on a ChaOS drive as file data is unfragmented, and stored just after a signature sector which contains the file name, date, time and length.

Linked a separate copy of the database engine into HTPSRV, to try various changes without destabilising the OS, and made quick progress then in locating the underlying cause, which is a miscalculation in the database record count after reloading. This meant the first database flush was fine, but the second would never be reached. ChaOS is unforgiving of memory allocation errors, and a system crash is a certain trigger for corrective action.

As ever with these cryptic memory errors, although a segment protection mechanism might prevent an OS crash, it would remove the need to locate the source of the problem - which is usually a miscalculation of memory required for a particular task, or inadvertent deallocation of a memory block still in use. The problem with HTPSRV goes back a couple of years, to code written as I ported my DOS4GW databases to ChaOS. Over that time, none of the CTPP accounts and order-processing databases have generated 400 new records in a session.

Now the HTPSRV database problem is fully understood, it is good to see the data base backing up correctly during busy internet traffic, i.e. several HTTP clients issuing multiple HTTP requests simultaneously, even with database free space limited to a ridiculously low value of just 10 hits. Backup threshold now set to 200 hits, see how things go.

* direct diary update on ChaOS server partition pda1: over ChaOS version 1.02.27981

12/4/2012 Network Servers and the growing pains of a Home-Grown Operating System Have been running HTPSRV database with free space of 1000 entries, knowing of a problem when flushing the database to disk when all free space is used up. Had tried to breakpoint the full database condition without success, memory allocation errors setting in and crashing the system. Tackled this problem head-on by reducing free space to just 20 database records, which quickly proved that the database full condition was at fault, though clearly other things were going wrong once this condition was reached. Difficult to debug this error as packets were flying in from HTTP client browsers.

Reduced the debug overhead by inhibiting network polling whilst stopped within the debugger. After locating and fixing the two coding errors which caused the memory allocation fault, managed to breakpoint an attempt to re-enter the database code during flush and re-index, due to network polling which is allowed during disk read or write. This chance of this happening rises exponentially as the database gets bigger, and as HTTP traffic increases.

Added poll inhibit to hard disk read and write routines, to be used when a network TSR needs to read or write to disk.

* direct diary update on ChaOS server partition pda2: over ChaOS version 1.02.27997

10/4/2012 ChaOS Servers A few more outages whilst deploying the encryption package. Fixed a rogue memory allocation in EHC.DRV (when using a USB stick to transfer files on to the server), which may have caused a crash or two.

* direct diary upload via FTP1 (encrypted!) from 4Gb CFS SATA partition sab2: over ChaOS version 1.02.27982

8/4/2012 DES encryption with ECB and CBC for ChaOS TCP Four modes of encryption now built in to ChaOS TCP, to protect transfers to and from ChaOS server. Uses bits within the TCP header to trigger the various modes, and random padding of random length to disguise control messages on FTP control or TELNET channels.

Encryption is on a per-packet basis, which allows any packet to be sent in unencrypted form, essential for the FTP 227 Entering passive mode message to be modified by packet filters in standard router firewalls.

Modified FTPSRV and TELSRV command processors to detect and discard the random padding arriving on encrypted packets, and to handle AUTH command which switches encryption on. Encryption on the FTP command port automatically causes data transfers to be encrypted, each time with a different key.

* direct diary upload via FTP1 (encrypted!) from 4Gb CFS SATA partition sab2: over ChaOS version 1.02.27981

6/4/2012 ChaOS v1.02/v1.03 harmonisation of TCP/IP With 64-bit and multi-processor development confined now to ChaOS v1.03, differences have arisen in TCP/IP source code for the two versions. This has become a chore to maintain.

Modified v1.02 compiler to silently pass v1.03 function modifiers hook and mutex. hook() function in v1.02 renamed as hook1() to avoid reserved word error when compiled with v1.03 compiler.

* direct diary upload via FTP1 (encrypted!) from 4Gb CFS SATA partition sab2: over ChaOS version 1.02.27981