Month: November 2014

Historic memories: how to create a DOS executable in the EDIT.COM

This is an old trick I used to do in the EDIT.COM of DOS to impress my friends. I discovery that some binary instructions could be represented in the text editor.

This is the sequence to create an executable that prints the CLAUDIA name:

ALT 180 // 180 = B4h = mov AH
ALT 02  // 2
ALT 178 // 178 = B2h = mov DL
C       // C
ALT 205 // 205 = CDh = INT
!       // ! = 33 = 21h
ALT 178 ...
L
ALT 205
!
ALT 178
A
ALT 205
!
ALT 178
D
ALT 205
!
ALT 178
I
ALT 205
!
ALT 178
A
ALT 205
!
ALT 180 // mov AH
L       // L = 4Ch 
ALT 205 // INT 21 => exit to DOS
!

This will generate this binary file sequence:

B4 02 B2 43 CD 21 B2 4C CD 21 B2 41 CD 21 B2 55
CD 21 B2 44 CD 21 B2 49 CD 21 B2 41 CD 21 B4 4C
CD 21

This assembly instructions are equivalent to assembly instruction:

MOV AH,02 ; To select subfunction 2, move the appropriate number, 2, to AH.
MOV DL,”A” ; In the interrupt list, it says that the character to output should be
INT 21h ; in register DL. So we move the character to DL.
; Finally when all the registers are set as required, we call the interrupt.

MOV AH,4Ch ; Select the subfunction
INT 21h ; Select a return value (optional but recommended)
; Call the DOS interrupt.

Using Blender to develop for 3D Printer

I’m developing a new project with more complex shapes and I need tight control over all meshes as accurate as possible. Initially I was planing to use FreeCAD, but my FreeCAD’s skill is limited.

Then I decide to test Blender to 3D printing. Fortunately since version 2.67 Blender has a native 3D Printing Toolbox. The Blender toolbox is useful to analyze your object before sending it to printer, this way you will save time and money.

I started reading this tutorial:
http://vdorchester.hubpages.com/hub/How-To-Make-Models-For-3D-Printing

First thing you need to do is enable the 3D Print toolbox addon. It is not enabled by default, but it is just a preference checkbox. Easy, en?

A useful tutorial is this from Shapeways: http://www.shapeways.com/tutorials/prepping_blender_files_for_3d_printing

I still learning about using Blender for 3D Printing, but I decided to post these links here to help other people willing to use Blender.

Another good video tutorial: http://cgcookie.com/blender/2013/02/04/modeling-3d-printing-shapeways/

How to print to Makerbot Replicator 2X using open-source tools

I’m trying to print on Makerbot Replicator 2X using open-source software instead using Makerware software.

Initially I used Cura: http://software.ultimaker.com with Cura_Makerbot_standard_profile.ini. You just need to select File -> Open Profile and choose Cura_Makerbot_standard_profile.ini.

Unfortunately Cura 14.09 in my Debian Jessie/sid is not able to detect and communicate with Replicator2X over serial port (ttyACM0). Then I decided to “Save GCode …” and then convert this saved myfile.gcode to myfile.x3g that can be read by Replicator2X from SD Card.

$ gpx -g -m r2x myfile.gcode myfile.x3g

It “barely workes”. I noticed the object is printed more to right side of build bed. Then my suggestion is to put the object more to left side of Cura bed before saving the gcode file.

Conclusion: this approach is not mature enough, but could work if you really care about using only open-source software to control your Makerbot Replicator 2X.

Running NuttX in the simulator

If you don’t have a board supported by NuttX or if you want to debug an application without resource limitation of embedded boards, then running NuttX in the simulator is a nice idea.

All you need to do is:

$ git clone https://bitbucket.org/nuttx/nuttx
$ git clone https://bitbucket.org/nuttx/apps
$ cd nuttx/tools
$ ./configure.sh sim/nsh
$ cd ..
$ make
$ ddd nuttx &

(gdb) b main
Breakpoint 1 at 0x4015ab: file up_head.c, line 74.

(gdb) r
Starting program: /comum/workspace/Basic/nuttx-git/nuttx/nuttx 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Breakpoint 1, main (argc=1, argv=0x7fffffffe2f8, envp=0x7fffffffe308) at up_head.c:74

(gdb) c
Continuing.
[New Thread 0x7ffff75fa700 (LWP 26105)]

NuttShell (NSH)
nsh>