Blackdog Startup Sequence Documentation


The startup sequence for the Blackdog is a bit complicated. This article is a work in progress. I will update it as I try to recreate the Realm-manager.exe functionality....
Outstanding Questions/Issues:

If you have any knowledge about these issues please email me.

  • How is authentication between the Blackdog and XMing X Window server accomplished?

  • What does the realm_cfg.exe program do?

Plans and ideas

  • Build a better RealmManager (currently called DogBoss) which:

    • Allows user setting of various XMing Switches (for example -clipboard)

    • Allows user defined programs to be run on the host when the device starts up.

    • Does a better job of cleaning up after itself.

    • Open source license.


Startup Sequence

  1. Realm-autorun.exe starts.

    • A temporary directory is created on the host Please see the note at the bottom about temporary directory naming.

    • Realm-manager.exe is copied from the CD image to the temporary directory.

    • Realm-manager.exe is called from Realm-autorun.exe, with the following command line:
      
      Realm-manager.exe --cdrom=K --parent-pid=3808
      
      Where:
      	--cdrom=Drive Letter without colon
      	--parent-pid= Process ID of the parent (the PID of the autorun program)
      	
      

  2. Realm-manager.exe starts

    • It copies files from the device's cdimage into an appropriate temp directory on the host.

    • The following files are copied:
      
      RealmX.run
      
      	mingwm10.dll
      	Realm-networking.exe
      	Realm_cfg.exe
      	Realm_net.exe
      
      RealmX.run/Xming
      	
      	pthreadGC2.dll
      	Realm-windowing.exe
      	rgb.txt
      
      RealmX.run/Xming/fonts/misc
      
      	6x13-ISO8859-1.pcf.gz
      	cursor.pcf.gz
      	fonts.alias
      	fonts.dir
      
      RealmX.run/Xming/locale
      
      	locale.alias
      	locale.dir
      
      RealmX.run/Xming/locale/C
      
      	XLC_LOCALE
      		

    • RealmManager then calls the following programs

      • Realm-net.exe -d X:

        • where

          X: is the drive letter of the cd image presented to the host by the device.

        • Finds a free subnet

        • Communicates this to the dog by attempting to read various directories and files in the X:NET_ADDR

        • Returns the subnet via stdout

      • Realm-cfg.exe -d 169.254.0.1

        • Where:

          -d 169.254.0.1 specifies the IP address of the device.

          Note: This address corresponds to the IP Address assigned to the USB0: network interface on the device.

        • What does this program actually do? No output appears on stdout.

      • Realm-networking.exe -a 169.254.1.0 169.254.0.1

        • Where:

          -a [IP of the proxy] [(USB) network interface IP on the dog]

        • This program runs until the RealmManager program terminates it.

      • Xming/Realm-windowing -notrayicon -internalwm -fp tcp/169.254.0.1:7100

        • Starts the Xming X Server on the Windows Host

        • -notrayicon (Don't display a tray icon)

        • -internalwm (Use the internal window manager)

        • -fp tcp/169.254.0.1:7100 (Sets the font path to the address of the blackdog device, port 7100)
        • This program runs until the RealmManager program terminates it.

    • At this point RealmManager appears to go into a loop monitoring the registry entries under:
      
      	HKLM/SYSTEM/CurrentControlSet/Services/Tcpip/Parameters/Interfaces
      
      Looking for changes (the Etherfast USB adapter going away specifically).

    • Once the ethernet interface is gone, RealmManager then attempts to stop:
      • Realm-networking.exe

      • Realm-windowing.exe

    • Finally it appears that the RealmManager program creates a batch file in the parent of the RealmX directory.

      This file is called "RDel2.bat" and, on my system, contains:

      
      	:begin1
      	rmdir /s /q C:DOCUME~1/tbayne/LOCALS~1/Temp/Realm4.run
      	if exist C:DOCUME~1/tbayne/LOCALS~1/Temp/Realm4.run goto begin1
      	:begin2
      	erase /f /q C:DOCUME~1/tbayne/LOCALS~1/Temp/RDel2.bat
      	if exist C:DOCUME~1/tbayne/LOCALS~1/Temp/RDel2.bat goto begin2
      
      Which goes into an infinite loop trying to delete the RealmX directory and all it's contents.


Notes:

  • The temp directory is located in the directory pointed to by the "TEMP" environment variable, and is named "RealmX", where X is a number, 1 to ?, if the directory already exists then the number is incremented, this is repeated until an unused directory is found.

  • There appears to be some situations where the dog can't clean up after itself, and leaves behind RealmX directories, usually empty.

  • Operations used to communicate the first part of 169.x.x.x
    
    CreateFile K:net_Addr3169
    CreateFile K:net_Addr3
    QueryDirectory K:Net_Addr3169
    CloseFile K:net_addr3
    ReadFile K:Net_Addr3169
    CloseFile K:Net_Addr3169
    
    - For each portion of the IP, in this order:
    
    K:Net_Addr3
    K:Net_Addr2
    K:Net_Addr1
    K:Net_Addr
    
  • Currently 0.00/5
Rating: 0.00/5 (0 votes cast)

Share It!

Trackback

Trackback URL for this entry: http://www.tbayne.net/trackback.php?id=20070118092441659

Here's what others have to say about 'Blackdog Startup Sequence Documentation':