Classic hexdump of files with the GNU Coreutils

Sometimes I’m in need of having a classic hexdump from a given binary file.
As there is no obvious command under Linux, all seem to require more or less long command line options to work, I have to note down the standard solution using the od tool provided by the GNU Coreutils.

od -w16 -A x -t x1z -v <filename>

This gives an output like this:
000000 00 00 00 05 00 00 aa 00 00 bb 00 00 cc 00 00 00  >................<
000010 00 00 ee ee dd ff 00 00 44 00 00 44 84 cd ab fe  >........D..D....<
000020

I did not find out how to remove the final address without having to use grep or sed.

The tool has a manual page and I recommend having a simple alias in your .bashrc like this:

alias dump='od -w16 -A x -t x1z -v'

Helper scripts for Buffalo LinkStation

Buffalo LinkStation Mini (illustration only)
Buffalo LinkStation Mini (illustration only)

Some years ago I purchased a Buffalo LinkStation Mini, a small NAS device for backup purposes. This device works quite well but until today, I didn’t have access to the builtin Wake-on-LAN feature from Linux.

Under Windows, the NAS boots as soon as the PC side software issues a special start request. After a little internet search, I found the necessary information and a small bash script to achieve this under Linux. I have adapted the wakeup script a bit and added a feature to disable the wakeup request via a second script. A third script queries the status of the NAS, both on the network and the state of the local wakeup script.

The wakeup script is intended to be run from the user’s Autostart sequence. The helpers can be called when needed.

Some icons are included.

The script needs bash,. zenity, notify-send and wakeonlan. The latter is a Ubuntu package and should be available in your distro as well.

The MIT License applies to this software. It works for my Buffalo LinkStation Mini, maybe for others too  but I cannot guarantee this. You are on your own but, hey, the software is free for modification :)

Download scripts and icons (86K)

Original script and information:  http://www.stqu.de/joomla/index.php/tutorials/16-linux/60-buffalo-linkstation-einschalten-via-wol

KDE1 Iconset for the Atari Falcon 030

package and RSC work (c) 2012 by
Matthias Arndt <marndt@asmsoftware.de>
The original KDE1 artwork is assumed to
be available under a free license.
Please keep me informed if this is not
the case.
Imported set of icons from KDE1, scaled
down to 16 colors and converted to GEM
icons for use with the Atari FALCON 030.
The files for Teradesk are usable right
away. Backup your old files and replace
the files CICONS.RSC and ICONS.RSC

package and RSC work (c) 2012 by Matthias Arndt <marndt@asmsoftware.de>

The original KDE1 artwork is assumed to be available under a free license.

Please keep me informed if this is not the case.

Preview of the KDE 1 iconset ported to the Atari Falcon 030
Preview of the KDE 1 iconset ported to the Atari Falcon 030

This is an imported set of icons from KDE1, scaled down to 16 colors and converted to GEM icons for use with the Atari FALCON 030. The final resource files have not been tested on the Atari TT and not with graphic cards or any other resolution than 640x480x4bpp

The files for Teradesk are usable right away. Backup your old files and simply replace the files CICONS.RSC and ICONS.RSC

Update 22.7.2012:

I reworked the monochrome icons a bit and added the lines for NEWDESK.INF to add icon associations in one go. A DESKICON.RSC with only monochrome icons for use with TOS 2.x (Atari ST and Atari STE) is now also included.

Download: KDE1ICONS.ZIP (70K)

stdint.h and stdbool.h for Keil C51

Interestingly, Keil C51 does not ship with C99 compliant stdint.h and stdbool.h header files.

But there is no need to dispair. The stdint.h from SDCC seems to work ok however I personally would not trust the pointer types and widths. However in a context of a 8051 MCU, I’d rather introduce my own data type for pointers anyway due to the different possible memory spaces. A generic pointer will have to carry section information that has to be evaluated at runtime. A special typed pointer won’t waste as many resources.

The stdbool.h from SDCC can be used as well. Just make sure to be Keil compatible and use the following definitions:

#define _Bool bit
#define BOOL bit
#define bool _Bool
#define __bool_true_false_are_defined 1

DOs and DO NOTs for developing Embedded Systems software

Zum Thema “Was sollte man tun und was nicht, wenn man Software für Embedded Systems entwirft und usitzt?”habe ich mal einen Artikel zusammegestellt. Dieser Artikel ist natürlich subjektiv, ich bin gerne bereit zu diskutieren. Die meisten Aspekte habe ich aber derweil schon aus verschiedenen Onlinequellen bestätigt bekommen.

http://www.final-memory.org/?page_id=2113

Im Prinzip habe ich dort mal zusammengefasst, was ich alles seit der Universität gelernt habe. Teile davon praktisch im Job, viele andere aber auch fortbildungsmäßig aus dem Netz. Im Vordergrund steht vorallem, fiese Fallen von faul programmierten C zu umgehen. Viele der Regeln und Vorschläge sind auch sprachunabhängig und können natürlich auch auf andere Programmiersprachen angewendet werden.

Ich selber habe viele dieser Regeln früher zum Beispiel nicht beherzigt. Wenn ich die Sourcen zu meiner Diplomarbeit ansehe, dann habe ich viele davon eklatant verletzt. Aber irgendwo will man ja auch einen Lerneffekt erkennen.

Als weitergehende Lektüre kann ich auch das “Embedded C Coding Standard” von Michael Barr empfehlen.

Irgendwann schreibe ich vielleicht auch noch einengrößeren zusammenhängenden Artikel oder auch ein kleines Buch. Die Liste kann sicherlich noch erweitert werden.

Low-Cost kooperatives Multitasking mit State Machines

Im Internet findet man durchaus höchst interessante Artikel im Bereich Embedded.

Der folgende Artikel beschreibt ein simples, aber effizientes Konzept, um einfaches kooperatives Multitasking zu realisieren.

Die Grundidee besteht darin, jeden Teil der Applikation gezielt und by Design in State Machines mit vielen Unterzuständen abzubilden und somit ohne einen komplizierten Scheduler einfach im schnellen Wechsel kleine Automatenzustände im Wechsel abzuarbeiten.

In Summe erinnert dieser Entwurf für Software schon stark an Hardwaredesign, wie es im VHDL-Bereich zwingend nötig ist. Hard- und Software-Co-Design, da kommen wir hiermit hin.

Link: http://www.eetimes.com/design/embedded/4207786/Low-Cost-Cooperative-Multitasking-Part-1-Building-a-simple-FM-player-

Sehr lesenswert, wenn man sich für kleinere Embedded Systeme und den Entwurf von Mikrocontrollerfirmware interessiert!

Wie man effizienten C Code für Mikrocontroller und 8 Bit Systeme schreibt

Im Netz fand ich den folgenden Artikel, der recht schön zusammenfasst, wie man seinen ANSI C Code für 8 Bit Systeme und im besonderen Mikrocontroller, etwa AVR oder 8051, optimiert.

http://www.netrino.com/Embedded-Systems/How-To/Efficient-C-Code

Der Artikel ist zwar in Englisch, aber das sollte den Hobbyisten oder gar den professionellen Embedded Entwickler ja nicht schocken!

Eventuell schreibe ich nochmal eine deutschsprachige Zusammenfassung. Mal schauen…

Rocks

Rocks war 1997 war mein 2. komplettiertes Spiel für MSDOS und das erste Spiel, welches ich auf meinem damals neuen P166 PC programmiert habe.

Rocks v1.0 (MSDOS)
Rocks v1.0 (MSDOS)

Das Spiel ist ein einfacher Asteroids Clone und ziemlich schlecht. Programmiert wurde der Spaß mit QuickBasic 4.5 und der netten Toolbox von Lars Struß / StarLogic. Das Spiel läuft wie immer im MCGA Modus 13h und hat optionale Soundeffekte über Soundblaster. Wer mag kann einen analogen Joystick benutzen, aber Tastatursteuerung ist genauso gut möglich.

Trotzdem ist die ganze Sache insgesamt ziemlich dröge und ich stelle das Spiel hier nur aus rein nostalgischen Gründen vor.

Die Sharewarehinweise sind wie immer bitte geflissentlich zu ignorieren, es gab nie eine Vollversion!

Ferner konnte ich dieses Mal den Quellcode nicht wiederfinden, aber in Summe denke ich, da wird nix verpasst.

Download Rocks (120k selbstentpackendes Archiv)