Articles on behalf of FCC Prumyslove systemy s.r.o.
By: Frank Rysanek [rysanek AT fccps DOT cz]
I have written a couple of articles on behalf of my
current employer. The following items are in English.
-
Advantech ADAM-4570 series networking notes
This note relates to the ADAM-4570 and ADAM-4571 RS-232/422/485 <==> Ethernet converters. These require a virtual COM port driver (only available for Windows). Please note that there are other models, the ADAM-4577 and ADAM-4579, that act as a classic "terminal server", serving raw RS-232 traffic over a TCP session (and hence can be used from Linux etc).
-
General notes on RAID
-
Linux 2.4 driver for the Advantech PCI-1240 4-axis stepper motor control board
-
Linux 2.6 driver for the Advantech PCI-1243 4-axis stepper motor control board
-
Linux 2.6 driver for the Advantech PCI-1784 4-axis counter card (with up/down, pulse+dir, rotary input)
-
Linux driver for the Advantech PCL-839 and PCL-839+ 3-axis stepper motor control boards (for Linux 2.4 and Linux 2.6)
-
Watchdog cleanups/patches for Linux 2.4 (around 2.4.26)
-
Advantech PCM-3643 multiport serial PC/104 board in Linux 2.4
-
Driver for the Advantech PCI-16xx series of dumb multiport serial boards (PCI bus), for Linux 2.6. Simple and seamless support for the hardware-based RS485 RX/TX switching, courtesy of the Oxford OX16C950 UART.
-
A blurb on Hard disks, Linux, RAID, server performance tuning
-
A somewhat disappointing note on how to run the Windows XP OnScreen Keyboard pseudo-persistently before and after Windows logon
-
CompactFlash cards in True IDE mode with (U)DMA capability are not always a piece of cake :-)
-
A cheat sheet (table) of ATOM CPU's vs. compatible chipsets.
-
A table of Intel single-socket CPU's vs. compatible chipsets (Excel/XLS - sorry). Have you noticed how the Pentium and Celeron names are once again refactored by Intel? If you assemble PC's for a living, often you may be wondering what kind of a CPU you're being offered: is it desktop or mobile flavour? (different sockets) If it's a Celeron or even a "Pentium", what generation is that? Can be anything from Pentium / Pentium II to a Nehalem...
The table is not exhaustive, but I hope the difficult cases are covered, focusing on CPU's on the market at the time of this writing (October 2010). It goes by model names, I didn't delve into "steppings" (though there may be marginal differences).
-
A brief Linux 2.6 Kernel (re-)Compile Howto.
-
A Howto on CUPS + Samba + DOS client for MS networks.
-
An eloquent note on RS485 termination, grounding and related issues..
-
Westermo ODW-600/ODW-700 series in sync mode, turning time etc..
-
A simple time-domain reflectometric probe for metallic cabling, to be used with an oscilloscope.
-
A note on Win32 driver development using bare MinGW + sample skeletal driver (source code)..
-
PCI104: a Case Study.
A report on how I had to find my way through a particular PCI104 setup, with quite a few jumpers
and sparse/scattered documentation.
-
WipeMBR: a very basic MBR maintenance tool for DOS (wipe/save/restore),
including selective operations on just the executable bootloader code (leaving the partition table intact).
-
A note on Debian's apt-get dist-upgrade
- a report of some non-trivial stuff that I encountered when upgrading from Etch to Lenny and beyond.
-
A note on Xorg.conf touchscreen calibration including a Perl script of my own, allowing you to calibrate the new "matrix" with an outdated xinput_calibrator.
-
A Linux SocketCAN nano-howto (a somewhat commented shell history)
-
A resilient GPRS dialer for Windows (XP)
-
VLAN's illustrated
-
Intel Ethernet Teaming
-
My Modbus stuff
-
A coupler-based VSWR probe for the 5 GHz WiFi band
-
Playing with S-parameters and the Smith chart in Qucs
-
I've recently updated my knowledge on how to make an offline backup (disk clone)
of Windows 8 to an external disk drive and how to restore it.
(hint: you need to help Ghost using bcdedit and diskpart from a Windows PE thumb drive.)
While at it, I've also documented my experience with a thorough cleanup and update
of the Windows 8 preinstalled by Acer.
-
Being backward, I have converted from Windows XP to Windows 7 in March 2016,
forced to take that step by a notebook replacement. The new notebook came preloaded
with Win7 (and a licence for Win10), yet my "moving in" was far from smooth.
Especially Windows Update was seriously stuck in the Lenovo preload.
-
I've made an Excel spreadsheet on MLCC ageing depending on temperature and voltage.
-
I've cobbled together a primitive SNMP scanner-logger-grapher in Perl in Linux, with the help of GNUplot.
-
I'm a single parent of the FCCPS support website.
-
I've created a small howto on PXE-booting Debian. Currently at Debian 9.
-
A debate in a Meinberg meeting prompted me to compile an Antenna lightning protection HOWTO. In the context of IEC/EN 62305.
-
x86 PC power management: P-states, C-states, T-states, S-states including some cmdline tools and a service to play with BD-PROCHOT.
And there are also a couple of patches, drivers and code snippets that don't deserve a webpage of their own:
-
A patch to the SJA-1000 CAN driver by Peak, allowing it to work with the Advantech PCM-3680. Written for Linux 2.4. Use something like type=adv,adv io=0xCF000,0xCF200 irq=A,B at insmod. The Advantech board seems to show better hardware interoperability with Advantech mainboards (3.5" and 5.25" biscuits) than the Peak board.
-
A "patchified" Marvell driver for the 5xxx/60x1 SATA/SATA-II controllers. The original Marvel driver package is version 3.4.0, available via Abit FTP site. The patch is for Linux 2.4, though the Marvell driver can compile against 2.6 too. Further references: Original driver package from Abit, How to make it work in Fedora Core 3.
Note that the vanilla Linux kernel contains a reworked driver for the Marvell 88SX50x1/60x1, called sata_mv, since around 2.6.16 (that apparently lacks some marginal functionality of the semi-closed-source driver).
Also note that newer SATA-II/AHCI chips from Marvell, namely the 88SX6121/6141 are missing a dedicated open-source driver as of Linux 2.6.21 - though as of 2.6.21, the generic driver for SATA AHCI chips (called "ahci.ko") does contain a very generic last-resort PCI-table entry that takes any Vendor/Device/SubVendor/Subdevice and only locks onto PCI_CLASS_STORAGE_SATA_AHCI. This might help, before the relevant maintainer adds an explicit entry for the new AHCI Marvells.
-
A "patchified" and slightly fixed Areca driver for the ARC-1120 and family (supposedly ARC-11xx/12xx). The original Areca driver package is version 1.20.00.04, available via the Areca web/FTP site. The patch is for Linux 2.4, though the Areca driver .c/.h files alone should compile against 2.6 too. A fixed revision of the original driver should be available from Areca by now.
Note that the driver "arcmsr" made it into vanilla Linux kernels sometime around 2.6.16. Good job on part of Erich Chen.
-
A simple driver for the Advantech PCL-833 counter + quadrature encoder board (ISA) The driver does hardware-clocked buffering in kernel space with flexible buffering / wakeup ratio (so that the user-space calls only wake up every N samples, to decrease ioctl() overhead). Besides the counter/encoder/buffering code, the driver contains some code around the board's "private" i8259 PIC. Plus a snippet of sample user-space code for SVGAlib, doing a bit of graphing.
-
While struggling with the BIOS setting of "Auto-power-on after power loss" on one motherboard, I've written a simple util to dump some related registers of the Winbond SuperIO chip that happens to keep an eye on the power-loss functionality. Later on, I added utils to read and write individual configuration registers (useful for generic fiddling). Compiles in BC 3.1 under DOS or in GCC under Linux.
[README]
[BINARY]
[SOURCE]
-
While debugging some LCD backlight issue, I've tried generating short pulses on the inverter's "ENABLE" input, to check its stability / tolerance to short glitches. In the process, I've tried fiddling with the Geode's DISPEN output via VESA VBE 3.0 BIOS, APM BIOS, then also via direct HW access to Geode and finally I had to resort to basic LPT bit banging (as the Geode HW seems to contain a single-shot that guarantees some minimum pulse length).
Here's the code.
The VESA and APM examples were written in BC3.1, the rest was written in a combination of DJGPP and NASM. The Geode code contains examples of PCI access from DOS, specifically PCI MMIO reads/writes, which requires DPMI (protected mode) - courtesy of DJGPP and CWSDPMI :-) Flat 32b unreal mode was considered and ditched in favour of proper DPMI. NASM was used to implement a tight timing loop involving the TSC (rdtsc instruction).
-
Someone has complained about a "skipping" tight loop (realtime control task) written for pure DOS, and voiced his suspicion about SMI being the culprit. In response to that, I've written a util that can enable/disable individual SMI sources on many Intel chipsets and enable/disable SMI generation on some Winbond SuperIO chips. It can be used in non-interactive mode from a BAT file, if it's told to load its configuration from a file.
Further, I wrote a subroutine that tries to discover such anomalies of time flow in a tight loop, when the CPU seems to "go out for lunch" for hundreds of microseconds - and to infer the SMI source(s) responsible. Consequently I've discovered that e.g. the default BIOS-provided ISR for the timer interrupt (IRQ0) does cause such "lunch breaks", or just any other interrupt can be to blame, such as polling IO access (within ISR) to some high-bandwidth peripherials. The detection routine can detect such IRQ sources too, but it leaves them enabled after the detection is over, for obvious reasons. It's up to the DOS application programmer to modify the IRQ handlers if necessary, in some suitable way.
Here's the code - it shows PCI access from DOS, runs under DPMI because it's written in DJGPP (somewhat unnecessarily), shows some basic i8259 AT PIC programming, and some basic way to combine DJGPP with NASM (used for tight loops with 'rdtsc').
CREDITS: The PCI config space decoding stuff is taken from Linux, the SMI manipulation stuff for Intel chipsets is taken from the respective RTAI module.
-
Here's a tiny example on how to access the UNO-3074 built-in GPIO/DIO, addon buzzer and diagnostic LED. The example hinges on user-space calls to ioperm() and inb()/outb() - if you want to use the IRQ generation feature, you need to take a dive into kernel space (write a trivial driver module).
-
Here's a simple load generator for block devices, called "HddTest" (Linux source code). It's a curses-based console application that prints some very basic data about the block device, a progress bar, and instantaneous MBps and IOps figures. It can do a sequential and a random test, both with read (default) and write (upon request) transactions. It can test multiple disks in parallel, or load a single disk by multiple threads of execution. The sequential test reads (or writes) the whole surface. The random test takes seek positions from /dev/urandom and keeps seeking like that for 10 minutes. If multiple tests are specified, they are performed one by one (sequential reading, random reading, sequential writing, random writing) and the whole batch is looped (wrapped around) when finished. Passes are counted and reported. Tip #1: try booting Linux into a hi-res framebuffer console, to be able to use more threads per screen. Tip #2: for striped RAID volumes (RAID 0/5/6 etc.), try replacing the default CFQ IO-scheduler with something else, perhaps a noop (echo "noop" >/sys/block/sda/queue/scheduler). It might make a difference in multi-threaded random reads.
-
Serial probes: 1.) a single-port loopback probe, 2.) a two-channel probe to display full-dulpex traffic, captured by an external passive eavesdropping probe (RS232 straight-through box with two dangling drop ports, payload RX and TX each wiretapped to the respective "drop port's" RX). The duplex probe uses a split-screen layout showing the data in hex and ascii, making a line-break upon a timeout (duration configurable). Both the two probes use a text-mode Curses interface = work from console as well as Xwindows terminal.
A note for fellow coders: the probes originally used setitimer() for thread-aware timing (in Linux 2.4 / LinuxThreads). Later on, I had to find a different way of thread-aware timing, as in NPTL setitimer() isn't thread-aware anymore. Some polite people in the LKML have pointed me to timer_create(SIGEV_THREAD_ID,gettid()) and timer_settime(). See the source code for details.
-
ITE IT8888 dummy INF for Windows XP Embedded - for hardware platforms where this is needed. There is a $Chicago$ dummy INF circulating the web, which doesn't seem to work for XPe. My dummy INF is modified for $Windows NT$. The mod was co-inspired by some Intel INF files for the LPC bridge, along with the generic Microsoft machine.inf.
-
Just in case someone is plagued by the same problem... on a particular piece of hardware, in XPe SP3, the UART's have a habit of occasionally, rarely, garbling data in an interesting way: if you send a string of all the same characters, after the second character, the UART starts flipping the 8th bit (MSb) between log.0 and log.1, for no apparent reason. A power cycle doesn't help, not even a CMOS reset. The only thing that helps is to open the Hyperterminal, configure it initially for say 9600, hang up, reconfigure to 115200, go offhook, hang up again, reconfigure back to 9600, offhook, hangup.
Here is a snippet of code, that's supposed to do something very similar (I straced the HyperTerminal before I cobbled this piece together). Written in Mingw C++ against WinAPI (The resulting EXE is included for people who just want to try.) Contains a simple library (source code) for working with the COM ports in Windows.
-
IOpeek.EXE / IOpoke.EXE for Windows = two utils to prod IO ports from Windows command line. Written in MinGW/GCC, source code included. Unfortunately, the utils don't support MMIO. Also, some ranges of IO ports are protected by later versions of XP and above - such as the configuration ports of some SuperIO chips at 0x2E/0x4E. These drawbacks are an inherent property of the access method used: DriverLinx PortIO (DLportIO.dll). This driver+library needs to be installed in the system. I've written this to tweak some RS485 RX/TX steering config in the SCH3114 by SMSC (at IO address 0x812, i.e. offset 0x12 from the default base of 0x800). The peek/poke utilities should also work for some common legacy devices such as LPT, COM and game ports.
-
DM&P Vortex86SX/DX GPIO library for Linux. The Vortex86 SoC has up to 40 GPIO pins. Most Vortex-based industrial motherboards by ICOP have 16 external GPIO pins, corresponding to GPIO ports 0 and 1 (8bit each). The corresponding GPIO registers are fairly easy to reach at some low ISA I/O ports - even from Linux user space using ioperm() and inb()/outb(). Which is exactly what the library does. The library doesn't support GPIO-based IRQ triggering nor the PWM and "Servo" functions of the Vortex86DX.
-
DM&P Vortex86SX/DX WDT0 source code example for DOS, written in pure NASM (assembler), using GNU MAKE as a "build automation" helper. The watchdog is used to reset the machine. For more examples, including some advanced use for IRQ triggering, check the official Vortex86 Software Programming Reference.
-
Video timings calculator - excel sheet implementing the ancient Generalized Timing Formula. Should be easy to modify for any other kind of video mode hacking (start with some known mode, try to shave off some pixels here or there...)
-
A primitive EPSNET protocol analyzer (parser/dumper)
= a piece of Windows-based cmdline software.
Developed as an internal debugging aid while trying to make EPSNET-F work over Westermo ODW series converters (yes it does work just fine).
EPSNET is a fieldbus protocol developed and used by Teco a.s. / CZ.
-
A primitive Time string output daemon for Linux.
This is for serial devices: RS232/485/UART ttyS0/1/2/3 ttyUSBxyz ttyACM you know the story.
If you need to generate some misc vendor's time string once a second or so,
and the Linux process scheduler's precision is good enough for the application,
this daemon might fit the bill, after some modification (= write your own
string formatting func).
-
A primitive system timebase continuity test for Windows. The point was to check if there's something that sends the system "out to lunch" for too long, without appearing as a CPU hog in the task manager. The program does not analyze what the culprit is, it can merely hint that something like that is going on. Relevant further tools and reading by other people: the LatencyMon by Resplendence Software (helps debug ISR and DPC latencies) and there's also this write-up at sysnative.com.
Last update: 6th September 2023