Jump to content











Photo

Creating RAM Disk Recovery Console


  • Please log in to reply
6 replies to this topic

#1 Sha0

Sha0

    WinVBlock Dev

  • Developer
  • 1,672 posts
  • Location:reboot.pro Forums
  • Interests:Booting
  •  
    Canada

Posted 25 December 2009 - 12:37 AM

This tutorial is intended for use with Windows XP Professional SP2.

  • Install the Recovery Console or, alternatively, use the batch file found here to create the RC directory structure
    D:\i386>winnt32 /cmdcons
  • Get DD for Windows by Chrysocome and John Newbigin
  • Get QEmu
  • Get ImDisk or VDK
  • Get GRUB4DOS
  • Get WinVBlock
  • Get TinyHexer
  • Create a large enough HDD image (I found 24,675,840 bytes adequate; that's 48195 512-byte sectors)
    C:\Program Files\QEmu>dd if=/dev/zero of=CMDCONS.HDD count=48195 --progress
  • Use QEmu to partition and format the image
    C:\Program Files\QEmu>qemu -fda w98_cmd.vfd -hda CMDCONS.HDD -boot a
    where w98_cmd.vfd is a Windows 98 DOS floppy with fdisk and format on it.
  • FDISK the HDD
  • Control-Alt-2 to switch to QEmu's monitor
  • system_reset to reboot the VM
  • Control-Alt-1 to switch to the VM's console
  • FORMAT C: to format with FAT
  • SYS C: to allow the HDD to boot DOS
  • Control-Alt-2 to switch to QEmu's monitor
  • quit to quit QEmu
  • Use ImDisk to attach the FAT filesystem in the HDD image (63 * 512 = 32256)
    C:\Program Files\QEmu>imdisk -a -t file -f CMDCONS.HDD -b 32256 -m m:
  • OR you could use VDK to attach the HDD image
    C:\Program Files\QEmu>vdk open 0 CMDCONS.HDD /rw
  • Copy CMLDR into the filesystem as NTLDR
    C:\Program Files\QEmu>attrib -s -h -r c:\cmldr
    
    C:\Program Files\QEmu>copy c:\cmldr f:\NTLDR
  • Copy NTDETECT.COM into the filesystem
    C:\Program Files\QEmu>attrib -s -h -r c:\ntdetect.com
    
    C:\Program Files\QEmu>copy c:\ntdetect.com f:\
  • Copy GRUB4DOS into the filesystem
    C:\Program Files\QEmu>copy grub.exe f:\
  • Copy the rest of the Recovery Console into the filesystem
    C:\Program Files\QEmu>xcopy /e /h c:\cmdcons f:\cmdcons\
  • Copy the WinVBlock driver into the Recovery Console
    C:\Program Files\QEmu>copy c:\windows\system32\drivers\ndis.sys f:\cmdcons
    
    C:\Program Files\QEmu>copy wvblk32.sys f:\cmdcons
  • Hack its startup into TXTSETUP.SIF
    [SetupData]
    
    ...
    
    OsLoadOptions = "/fastdetect /noguiboot /nodebug /WINVBLOCK=BUS=1"
    
    ...
    
    [SCSI.Load]
    
    ...
    
    wvblk32 = wvblk32.sys,4
    
    ...
    
    [SCSI]
    
    ...
    
    wvblk32 = "WinVBlock"
    
    ...
    
    [BootBusExtenders.Load]
    
    ndis = ndis.sys
    
    ...
    
    [BootBusExtenders]
    
    ndis = "NDIS"
    
    ...
  • Detach the disk image with ImDisk
    C:\Program Files\QEmu>imdisk -d -m m:
  • OR you could detach with VDK
    C:\Program Files\QEmu>vdk close 0
  • Open the HDD image with TinyHexer. File -> Disk -> Open disk image or large file as drive... -> CMDCONS.HDD
  • Goto the filesystem's boot sector. File -> Disk -> Goto sector/position... -> 63
  • Hack cmdcons\0 ('\0' means an ASCII NUL byte) into the boot-sector; 8 bytes starting at 0x3 (4th byte)
  • Write the changes and quit TinyHexer
  • Invoke QEmu
    C:\Program Files\QEmu>qemu -hda CMDCONS.HDD -boot c
  • Windows 98 DOS should boot in the VM. Run GRUB4DOS
    C:\>grub
  • Choose or wait for the CLI, then chain NTLDR
    grub> chainloader (hd0,0)/ntldr
    
    grub> boot
  • The Recovery Console should start. Using its CLI, you can now fix the FAT boot-sector to be NT-style and reboot the VM
    C:\>fixboot
    
    blah blah really? y
    
    blah blah done
    
    C:\>exit
  • The image is now complete. Enjoy.

How to enjoy instantly with QEmu:
C:\Program Files\QEmu>qemu -kernel memdisk -initrd CMDCONS.HDD -hda garbage.hdd

How to enjoy with PXELINUX 3.71 (or newer) and MEMDISK 3.84 (or newer; best to use the one included in WinVBlock):

Directory layout:
/tftpboot/

/tftpboot/pxelinux.cfg/

/tftpboot/pxelinux.cfg/default

/tftpboot/memdisk

/tftpboot/CMDCONS.HDD

/tftpboot/pxelinux.cfg/default goes:
DEFAULT cmdcons

LABEL cmdcons

  KERNEL memdisk

  INITRD CMDCONS.HDD

- Shao Miller

#2 wimb

wimb

    Gold Member

  • Developer
  • 2,165 posts
  •  
    Netherlands

Posted 25 December 2009 - 08:20 AM

Make_IMG.exe of U_XP_SET package can be used to create and install Recovery Console RAMBOOT Image.

See Section 7 in http://www.911cd.net...showtopic=21883

•Make and Install 15 MB XP Recovery Console FAT12 IMG file Booting from RAMDISK and made from Windows XP Setup Source



#3 Sha0

Sha0

    WinVBlock Dev

  • Developer
  • 1,672 posts
  • Location:reboot.pro Forums
  • Interests:Booting
  •  
    Canada

Posted 26 December 2009 - 08:38 AM

Make_IMG.exe of U_XP_SET package can be used to create and install Recovery Console RAMBOOT Image.

See Section 7 in http://www.911cd.net...showtopic=21883

Thanks, wimb. The next step for me was to actually add the steps required in order to spoof the Recovery Console into allowing its SET command to work. The reference you provided linked to the fact that jaclaz had already worked that out. :) I will incorporate it at some point soon.

Yes, your Make_IMG.exe creates a RAM disk Recovery Console, but requires elements from Windows Server 2003. This tutorial's first line does not mention Windows Server 2003. Not everyone has a license for Windows Server 2003. Everyone has a license for WinVBlock: the GPL version 3.

- Sha0

#4 target_practice

target_practice

    Newbie

  • Members
  • 27 posts
  • Location:Portland, Oregon
  •  
    United States

Posted 26 April 2010 - 01:19 AM

I can boot the cmdcons.hdd image in qemu as a drive image, but attempting to boot it with memdisk and initrd fails
with the error 'File \CMDCONS\ntkrnlmp.exe could not be loaded. The error code is 16'

And step 34 should be chainloader (hd0,0)/NTLDR correct?

EDIT:
Your txtsetup.sif edits in this tutorial should include lines for NDIS.sys, correct? Also, to make my problem weirder,
CMDCONS.HDD works as a disk image but not with memdisk. gzipped (CMDCONS.HDD.gz) however, -does- work with memdisk.

#5 Sha0

Sha0

    WinVBlock Dev

  • Developer
  • 1,672 posts
  • Location:reboot.pro Forums
  • Interests:Booting
  •  
    Canada

Posted 28 April 2010 - 04:13 AM

I can boot the cmdcons.hdd image in qemu as a drive image, but attempting to boot it with memdisk and initrd fails
with the error 'File \CMDCONS\ntkrnlmp.exe could not be loaded. The error code is 16'

Perhaps QEmu is using a different geometry than MEMDISK. Try to determine the geometry that QEmu is using (GRUB4DOS's 'geometry' command is useful for this) and then tell MEMDISK that geometry with the c=XX h=YY s=ZZ parameters.

And step 34 should be chainloader (hd0,0)/NTLDR correct?

Yes, it should. It's now been corrected.

EDIT:
Your txtsetup.sif edits in this tutorial should include lines for NDIS.sys, correct?

You could be correct. If SETUPLDR doesn't intelligently load NDIS.SYS into memory as a dependency for WinVBlock, then you might need to load it with the TXTSETUP.SIF entry. I don't think I had to do this when I wrote the tutorial.

#6 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 10,472 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 19 October 2011 - 06:56 PM

This tutorial is intended for use with Windows XP Professional SP2.

  • Install the Recovery Console or, alternatively, use the batch file found here to create the RC directory structure

    D:i386>winnt32 /cmdcons
  • Get DD for Windows by Chrysocome and John Newbigin
  • Get QEmu
  • Get ImDisk or VDK
  • Get GRUB4DOS
  • Get WinVBlock
  • Get TinyHexer
  • Create a large enough HDD image (I found 24,675,840 bytes adequate; that's 48195 512-byte sectors)
    C:Program FilesQEmu>dd if=/dev/zero of=CMDCONS.HDD count=48195 --progress
  • Use QEmu to partition and format the image
    C:Program FilesQEmu>qemu -fda w98_cmd.vfd -hda CMDCONS.HDD -boot a
    where w98_cmd.vfd is a Windows 98 DOS floppy with fdisk and format on it.
  • FDISK the HDD
  • Control-Alt-2 to switch to QEmu's monitor
  • system_reset to reboot the VM
  • Control-Alt-1 to switch to the VM's console
  • FORMAT C: to format with FAT
  • SYS C: to allow the HDD to boot DOS
  • Control-Alt-2 to switch to QEmu's monitor
  • quit to quit QEmu
  • Use ImDisk to attach the FAT filesystem in the HDD image (63 * 512 = 32256)
    C:Program FilesQEmu>imdisk -a -t file -f CMDCONS.HDD -b 32256 -m m:
  • OR you could use VDK to attach the HDD image
    C:Program FilesQEmu>vdk open 0 CMDCONS.HDD /rw
  • Copy CMLDR into the filesystem as NTLDR
    C:Program FilesQEmu>attrib -s -h -r c:cmldr
    
    C:Program FilesQEmu>copy c:cmldr f:NTLDR
  • Copy NTDETECT.COM into the filesystem
    C:Program FilesQEmu>attrib -s -h -r c:ntdetect.com
    
    [*]C:Program FilesQEmu>copy c:ntdetect.com f:
  • Copy GRUB4DOS into the filesystem
    C:Program FilesQEmu>copy grub.exe f:
  • Copy the rest of the Recovery Console into the filesystem
    C:Program FilesQEmu>xcopy /e /h c:cmdcons f:cmdcons
  • Copy the WinVBlock driver into the Recovery Console
    C:Program FilesQEmu>copy c:windowssystem32driversndis.sys f:cmdcons
    
    C:Program FilesQEmu>copy wvblk32.sys f:cmdcons
  • Hack its startup into TXTSETUP.SIF
    [SetupData]
    
    ...
    
    OsLoadOptions = "/fastdetect /noguiboot /nodebug /WINVBLOCK=BUS=1"
    
    ...
    
    [SCSI.Load]
    
    ...
    
    wvblk32 = wvblk32.sys,4
    
    ...
    
    [SCSI]
    
    ...
    
    wvblk32 = "WinVBlock"
    
    ...
    
    [BootBusExtenders.Load]
    
    ndis = ndis.sys
    
    ...
    
    [BootBusExtenders]
    
    ndis = "NDIS"
    
    ...
  • Detach the disk image with ImDisk
    C:Program FilesQEmu>imdisk -d -m m:
  • OR you could detach with VDK
    C:Program FilesQEmu>vdk close 0
  • Open the HDD image with TinyHexer. File -> Disk -> Open disk image or large file as drive... -> CMDCONS.HDD
  • Goto the filesystem's boot sector. File -> Disk -> Goto sector/position... -> 63
  • Hack cmdcons0 ('0' means an ASCII NUL byte) into the boot-sector; 8 bytes starting at 0x3 (4th byte)
  • Write the changes and quit TinyHexer
  • Invoke QEmu
    C:Program FilesQEmu>qemu -hda CMDCONS.HDD -boot c
  • Windows 98 DOS should boot in the VM. Run GRUB4DOS
    C:>grub
  • Choose or wait for the CLI, then chain NTLDR
    grub> chainloader (hd0,0)/ntldr
    
    grub> boot
  • The Recovery Console should start. Using its CLI, you can now fix the FAT boot-sector to be NT-style and reboot the VM
    C:>fixboot
    
    blah blah really? y
    
    blah blah done
    
    C:>exit
  • The image is now complete. Enjoy.
How to enjoy instantly with QEmu:
C:Program FilesQEmu>qemu -kernel memdisk -initrd CMDCONS.HDD -hda garbage.hdd

How to enjoy with PXELINUX 3.71 (or newer) and MEMDISK 3.84 (or newer; best to use the one included in WinVBlock):

Directory layout:
/tftpboot/

/tftpboot/pxelinux.cfg/

/tftpboot/pxelinux.cfg/default

/tftpboot/memdisk

/tftpboot/CMDCONS.HDD

/tftpboot/pxelinux.cfg/default goes:
DEFAULT cmdcons

LABEL cmdcons

  KERNEL memdisk

  INITRD CMDCONS.HDD

- Shao Miller


I quoted verbatim the OP after having "passed it" into the converter for "botched html code":
http://reboot.pro/15275/
http://pastehtml.com.../b4t99xk89.html

:cheers:
Wonko

#7 sambul61

sambul61

    Gold Member

  • Advanced user
  • 1,568 posts
  •  
    American Samoa

Posted 20 October 2011 - 12:48 AM

Sha0

What's the advantages of RAM Disk Recovery Console compare to the regular one? Is it to be used in Virtual environments only, or in real as well?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users