Saturday 8 March 2014

Notes on text 'screengrabbing' and data collection in the grub4dos console

Sometimes you may be asked for debug information using the grub4dos shell/console.


The problem is how do you get all this information to the grub4dos developer if this needs to run on a real system and not a Virtual Machine? Normally, you would take a photograph with your digital camera or cell-phone, download the pictures onto your computer and then upload them or email them to the developer.

However, you can use my grab.g4b batch file to capture the screen instead:

1. Download and extract the contents of the Grab.zip file to the root of your grub4dos drive
2. Boot to grub4dos and get to the grub4dos command console
3. Type graphicsmode 3 to get into text mode
4. Execute any debug commands so that the results are displayed on the screen (80chars x 24 lines)
5. Type /grab.g4b to capture the text into the file grab.txt.
6. If you want to capture another screen to a different file, use /grab.g4b 1  to capture the screen text to the file grab1.txt.
      grab.txt, grab1.txt, grab2.txt...grab8.txt are provided in the download. They must exist before the command is executed.
7. You files can now be sent to the developer.


Capturing memory data


If you are asked to send the results of a cat command - e.g.

cat --hex (md)0x4e+3

This will display quite a lot of data - far more than one screen full. You can redirect the output to an existing file using:

cat --hex (md)0xe4+3 > /myfile.txt

as long as myfile.txt exists and is big enough. Note: If using an NTFS filesystem, the file must be at least 1K or more or the writes won't work.

Unfortunately you cannot use more than 3 sectors as the grub4dos redirection buffer appears to be limited to just 8192 bytes - e.g. cat /file1.txt > file2.txt will only work for the first 8192 bytes.

If you need to collect more than 3 sectors of hex data ouput, you can use the mdcat.g4b batch file included in the download.

/mdcat.gb4 0x4e

The results will be in /mdcat.txt - use NotePad++ to open it (not Windows NotePad).








No comments:

Post a Comment