Jump to content











Photo
- - - - -

Busting the Myth about ramdisk.sys - XP/2003


  • Please log in to reply
60 replies to this topic

#51 Holmes.Sherlock

Holmes.Sherlock

    Gold Member

  • Team Reboot
  • 1444 posts
  • Location:Santa Barbara, California
  •  
    United States

Posted 22 August 2010 - 04:14 AM

Rambooting is not limited to binaries from server 2003 or XP Embedded. It works on XP sp2 and sp3 too (don't know about sp1). When I mean works, I refer to booting a real non-pe system from ramdisk with the osloader(Boot Loader)/ntldr (pretty much like diskless XP Embedded systems) and boot.ini. Booting WinPE from ramdisk must be done with setupldr.bin (Setup Loader) and winnt.sif, and maybe only with the 2003 version of it. Note that ntdetect.com can be from XP. Trying to load ramdisk images with the xp version of setupldr.bin gives I/O errors, and cannot read winnt.sif properly. The xp version of ramdisk.sys requires a registry patch (because otherwise it will not start at boot). Therefore ramloading works with XP sources too, and the only time you need 1 2003 binary, setupldr.bin, is when ramloading in PE-mode.
Joakim


I'm quite new in this rambooting kind of things.
My knowledge spreads this much:-
1) can make a raw disk image with Imdisk
2) know a little bit about W2k3SP1 ramdisk.sys & setupldr.bin & how to use them a BartPE
3) have dealt with some freeware ramdisk drive from within an existing Windows installation
4) know the syntax & ramdisk support by Grub4DOS
5) know little bit about Firadisk

Still there are lots of topics which are quite hazy to me. Can anybody explain me how to boot XP in non-PE mode as joakim instruced at the very outset of this thread assuming the above knowledge? Let me ask u one more question, does BartPE use W2k3SP1 ramdisk driver for accessing its ramdisk? How does that type of ramdisk driver differ from one that we use from within a full-blown installation of Windows, e.g. an Audio/Graphics driver? As u can see. I'm quite ignorant about these topics. So please, no hard feelings. I want to learn.

#52 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 22 August 2010 - 09:17 AM

Still there are lots of topics which are quite hazy to me. Can anybody explain me how to boot XP in non-PE mode as joakim instruced at the very outset of this thread assuming the above knowledge? Let me ask u one more question, does BartPE use W2k3SP1 ramdisk driver for accessing its ramdisk? How does that type of ramdisk driver differ from one that we use from within a full-blown installation of Windows, e.g. an Audio/Graphics driver? As u can see. I'm quite ignorant about these topics. So please, no hard feelings. I want to learn.


Most of the problems with Mass Storage Device drivers (including RAMDISK drivers) is (if you want to actually boot from them) to provide a mechanism to have the driver (or media) available BOTH in the early part of the booting (real mode) AND in the second part (protected mode).

The driver has to be a kernel driver.
In most cases it also has to be a miniport driver. :)

Server 2003 SP1 provided (for the first time - setting aside for the moment XP Embedded) such a mechanism, i.e. it's SETUPLDR.BIN could "hook" in real mode the image loading it to the RAMDISK.SYS.

Firadisk (and WinVblock) use a different approach, the "real mode" part is carried by grub4dos or memdisk, and then the driver hooks the already mapped ramdisk image.

Recent evolutions of Firadisk allow for DIRECT mapping (without RAMDISK) of the image.

What joakim and JFX, and others mentioned in the thread found out is that with a few simple patches to the Registry, the same mechanism used in Server 2003 SP1 for SETUPLDR.BIN can work with a "normal" NTLDR.


:)
Wonko

#53 Holmes.Sherlock

Holmes.Sherlock

    Gold Member

  • Team Reboot
  • 1444 posts
  • Location:Santa Barbara, California
  •  
    United States

Posted 22 August 2010 - 09:37 AM

Server 2003 SP1 provided (for the first time - setting aside for the moment XP Embedded) such a mechanism, i.e. it's SETUPLDR.BIN could "hook" in real mode the image loading it to the RAMDISK.SYS.
:)
Wonko


1) I know what real mode & p-mode is. But what do u mean by "HOOKING in r-mode"? Does it mean altering IDT & trapping all INT-13 disk access calls?

What joakim and JFX, and others mentioned in the thread found out is that with a few simple patches to the Registry, the same mechanism used in Server 2003 SP1 for SETUPLDR.BIN can work with a "normal" NTLDR.


2) Will u please throw some more light on the above remark? Does it mean that NTLDR, which is used for bootloading XP systems, can use ramdisk.sys driver in the same way as SETUPLDR.BIN, which is used during WinXP setup, uses it in W2K3SP1?

Please bear with me. I need far more clarification than anybody else here. I know little compared to you.

#54 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 22 August 2010 - 10:07 AM

1) I know what real mode & p-mode is. But what do u mean by "HOOKING in r-mode"? Does it mean altering IDT & trapping all INT-13 disk access calls?

SETUPLDR.BIN accesses the file representing the RAMDISK image (reading the settings in WINNT.SIF), and loads it to the RAM (or RAMDISK) in real mode. (or TEXT mode setup)
Then, the protected mode (GUI setup) loads the RAMDISK driver and takes control of the RAMDISK and loads files from it.
About IDT, trapping INT-13 :), etc, see below. :)

2) Will u please throw some more light on the above remark? Does it mean that NTLDR, which is used for bootloading XP systems, can use ramdisk.sys driver in the same way as SETUPLDR.BIN, which is used during WinXP setup, uses it in W2K3SP1?

Sure :), just read ATTENTIVELY this thread AND try doing some experiments. Hadn't you noticed this is EXACTLY what the present thread is about.

Please bear with me. I need far more clarification than anybody else here. I know little compared to you.

That's what you think. (I probably know far less than what you think :)). BUT instead of using big words like "altering IDT & trapping all INT-13 disk access calls" :), I simply try booting following the instructions (and quite often it works :)) :

Just Do it!

and:

Life is "trying things to see if they work"



:)
Wonko

#55 Holmes.Sherlock

Holmes.Sherlock

    Gold Member

  • Team Reboot
  • 1444 posts
  • Location:Santa Barbara, California
  •  
    United States

Posted 22 August 2010 - 11:46 AM

That's what you think. (I probably know far less than what you think :)). BUT instead of using big words like "altering IDT & trapping all INT-13 disk access calls" :), I simply try booting following the instructions (and quite often it works :)) :
Wonko


I don't want to showcase myself. Only "booting" can mean a lot & make things hazier. I wanted to understand exactly under the hood. BTW, thanks a million Wonko. U r great.

1) Does BartPE use ramdisk.sys as its ramdisk driver?
2) Why do people keep on referring W2k3SP1 ramdisk driver while the same is present on WinXP SP2 CD also? Does it not work?

#56 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 22 August 2010 - 12:05 PM

1) Does BartPE use ramdisk.sys as its ramdisk driver?

NO, not as "normal" ramdisk, YES, if RAMDISK booting. (with the Server 2003 SP1 files)

Besides you can use IMDISK as "BartPE" ramdisk:
http://www.911cd.net...showtopic=19711

2) Why do people keep on referring W2k3SP1 ramdisk driver while the same is present on WinXP SP2 CD also? Does it not work?

Because to make lemonade, you need to squeeze lemons. :)

Read this seemingly unrelated thread AND given links in it:
http://www.boot-land...?showtopic=4952

:)
Wonko

#57 Holmes.Sherlock

Holmes.Sherlock

    Gold Member

  • Team Reboot
  • 1444 posts
  • Location:Santa Barbara, California
  •  
    United States

Posted 22 August 2010 - 12:09 PM

NO, not as "normal" ramdisk, YES, if RAMDISK booting. (with the Server 2003 SP1 files)


Can't understand. Then how does it go completely "diskless"? Original BartPE doesn't make use of IMDISK, so far I know. I mean it's not a mandatory requirement.

#58 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 22 August 2010 - 12:41 PM

Can't understand. Then how does it go completely "diskless"? Original BartPE doesn't make use of IMDISK, so far I know. I mean it's not a mandatory requirement.


I'll try again. :)

Though you cannot possibly have read the given material :), and until you don't do so you will simply miss part of the needed info to understand. :)

There is ONLY one "historical" way to boot BartPE from CD, it does NOT make use of ANY RAMDISK at booting BUT uses a ramdisk in normal operation (the B:\ drive), a lmited to 32 Mb RAMDISK from Christiaan Ghijselinck:
http://www.nu2.nu/pe...elp/ramdisk.htm
the CD needed to remain in the CD-drive all the time!

Later (when Server 2003 SP1 came out :)), RAMDISK booting became possible.
http://www.911cd.net...showtopic=10806

I've been playing around with the new setup loader that comes with server 2003 sp1 (release candidate) and this opens the door to load BartPE on USB sticks through a ramdisk loader (not to be confused as the ramdrive "b:" you have in BartPE). So I've created a simple script that helps you to install it.

BOTH at CD and USB (or hard disk) (you could finally remove the CD once booted)


If you want it in an extremely simplified form:
  • a "normal" BartPE has 1 (one) RAMDISK (needed for operation - B:\ )
  • a RAMDISK booted BartPE has 2 (TWO) RAMDISKs (one needed for booting and one needed for operation)

IMDISK is a valid replacement for the "B:\ drive" ramdisk.

Further

:)
Wonko

#59 Holmes.Sherlock

Holmes.Sherlock

    Gold Member

  • Team Reboot
  • 1444 posts
  • Location:Santa Barbara, California
  •  
    United States

Posted 22 August 2010 - 01:06 PM

this opens the door to load BartPE on USB sticks through a ramdisk loader


1) Why a ramdisk is a mandatory required for USB booting but not for CD booting?

IMDISK is a valid replacement for the "B:\ drive" ramdisk.


2) Why IMDISK can't be used for the second ramdrive?

Thanks in advance, Wonko.

#60 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 22 August 2010 - 01:49 PM

1) Why a ramdisk is a mandatory required for USB booting but not for CD booting?

There must be some communication problem. :)
Noone said that for booting from USB anything is "mandatory".
BTW, I NEVER said:

this opens the door to load BartPE on USB sticks through a ramdisk loader

Bart Lagerwej himself wrote that:

this opens the door to load BartPE on USB sticks through a ramdisk loader

Let's try rewriting the above sentence, OK?

this opens the door to load BartPE on USB sticks through a ramdisk loader

translated:

this opens the door to load BartPE on USB sticks in another possible way, i.e. through a ramdisk loader

or if you prefer:

this allows for another, additional to the existing one, method of booting a BartPE build from USB, INSTEAD of a flat directory structure using /minint, we can now use RAMDISK loading an image, by using a bunch of files from Server 2003 SP1.



2) Why IMDISK can't be used for the second ramdrive?

Still same communication problem. :)
IMDISK CAN be used for the "second" ramdrive, if by "second" ramdrive you mean the one needed for operation, it CANNOT be used for BOOTING.
And don't ask me why, it is simply NOT coded for that and CANNOT do it.
Think of your question as:
Q:Why can't be water be used instead of gasoline in a car?
A:Because water does not burn.

Would you prefer an aswer talking about chemical composition, Hydrogen, Oxigen, Hydrocarbons, dead dinosaurs, geological ages, or the above would be enough? :)

:)
Wonko

#61 bilou_gateux

bilou_gateux

    Frequent Member

  • Expert
  • 230 posts
  •  
    France

Posted 09 November 2013 - 01:13 PM

Rambooting is not limited to binaries from server 2003 or XP Embedded. It works on XP sp2 and sp3 too (don't know about sp1). When I mean works, I refer to booting a real non-pe system from ramdisk with the osloader(Boot Loader)/ntldr (pretty much like diskless XP Embedded systems) and boot.ini. Booting WinPE from ramdisk must be done with setupldr.bin (Setup Loader) and winnt.sif, and maybe only with the 2003 version of it. Note that ntdetect.com can be from XP. Trying to load ramdisk images with the xp version of setupldr.bin gives I/O errors, and cannot read winnt.sif properly. The xp version of ramdisk.sys requires a registry patch (because otherwise it will not start at boot). Therefore ramloading works with XP sources too, and the only time you need 1 2003 binary, setupldr.bin, is when ramloading in PE-mode.

Sample registry patch (inf taken from 2003 but also works with xp one;
 


Joakim

 

 

code boxes messed up

 

 

Regdmp.exe utility (also on the Resource Kit) to dump out the part of the registry you will be working on to a text file. The output from Regdmp is in the correct form to be used as input for Regini.

 

Windows XP Embedded SP3 (or XP Professional SP3) registry dump:

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{9D6D66A6-0B0C-4563-9077-A0E9A7955AE4} [30 31 1 17 5]
    Class = Ramdisk
    = Ramdisk
    Icon = -5
    0000 [30 31 1 17 5]
        InfPath = ramdisk.inf
        InfSection = BusInstall
        InfSectionExt = .NT
        ProviderName = Microsoft
        DriverDateData = REG_BINARY 0x00000008 0xc5628000 0x01c101c0
        DriverDate = 7-1-2001
        DriverVersion = 5.1.2600.5512
        MatchingDeviceId = ramdisk
        DriverDesc = Windows RAM Disk Controller
    0001 [30 31 1 17]
        InfPath = ramdisk.inf
        InfSection = VolumeInstall
        InfSectionExt = .NT
        ProviderName = Microsoft
        DriverDateData = REG_BINARY 0x00000008 0xc5628000 0x01c101c0
        DriverDate = 7-1-2001
        DriverVersion = 5.1.2600.5512
        MatchingDeviceId = ramdisk\ramvolume
        DriverDesc = Windows RAM Disk Device (volume)
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\RAMDISK [8 17]
    0000 [8 17]
        Mfg = Microsoft
        DeviceDesc = Windows RAM Disk Controller
        Service = Ramdisk
        Class = Ramdisk
        HardwareID = REG_MULTI_SZ "ramdisk" 
        ClassGUID = {9D6D66A6-0B0C-4563-9077-A0E9A7955AE4}
        Capabilities = REG_DWORD 0x00000000
        ConfigFlags = REG_DWORD 0x00000000
        Driver = {9D6D66A6-0B0C-4563-9077-A0E9A7955AE4}\0000
        Control [8 17]
            ActiveService = Ramdisk
        LogConf [8 17]
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Ramdisk [30 31 1 17 5]
    Type = REG_DWORD 0x00000001
    Start = REG_DWORD 0x00000003
    ErrorControl = REG_DWORD 0x00000001
    Description = Windows RAM Disk Driver
    DisplayName = Windows RAM Disk Driver
    ImagePath = REG_EXPAND_SZ system32\DRIVERS\ramdisk.sys
    Tag = REG_DWORD 0x00000001
    Group = Primary disk
    Debug [30 31 1 17 5]
        DebugComponents = REG_DWORD 0x7fffffff
        DebugLevel = REG_DWORD 0x00000005
    Parameters [30 31 1 17 5]
        ReportDetectedDevice = REG_DWORD 0x00000000
    Enum [30 31 1 17]
        0 = Root\RAMDISK\0000
        Count = REG_DWORD 0x00000001
        NextInstance = REG_DWORD 0x00000001





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users