Jump to content











Photo
* * * * * 1 votes

custom image boot


  • Please log in to reply
40 replies to this topic

#26 th0ghts

th0ghts

    Newbie

  • Members
  • 28 posts
  •  
    Israel

Posted 25 July 2007 - 09:41 AM

@windrv

from what you're saying, whenever i memdisk any kind of image, after successful emulation and booting from that specific image, i won't be able to see any other drive connected.

so in another words, when i memdisk an image - i'll get only the image itself; and the image won't function as a floppy drive. am i right?

You can try to use grldr

(a question)
if it so, as i understand above, i must get to know grub to be able to successfully achieve booting my xp floppy disks image?

(simple check, and a question that follows)
and another thing... i made another bootable image - the image holds a custom bootdisks of partition magic 8 which i made, and when booting using that image (i've been booting it using memdisk of curse), i was able to see my hd's.

so by your saying, when i'll boot xp bootdisks i won't be able to see far beyond the mounted image itself; and in fact using other mounted bootdisks there is the ability to access any other hd's on the system.

#27 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7,098 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 25 July 2007 - 05:10 PM

It seems to me that there are a few misunderstandings/misconceptions in this thread that maybe I can contribute to clarify.

In his original post, th0ghts asked three things in the same sentence:

how can i custom the size, make it bootable and be able to mount it using memdisk?


Let's see them one by one:

1)

how can i custom the size


No problem, done.
Now that one method (approximated to the megabyte) has been proved to be successful, one could use other methods to create a file (empty, but mountable in Qemu) of any given size.
There are several utilities that can do that, please find here:
http://www.911cd.net...showtopic=15843
http://www.911cd.net...showtopic=15481
http://www.911cd.net...w...=14189&st=8
links to some of them, to which you can add filedisk:
http://www.acc.umu.se/~bosse/
and IMDISK, already seen

2)

how can i make it bootable

A number of options have been given, done.

3)

how can i be able to mount it using memdisk

Now this is the remaining point.
Here we need to digress a little and talk a little about theory of RAM disks.
More technically prone members will surely pardon me :yahoo: if I use some improper or over-simplified terminology or similitudes to explain myself better (hopefully) :).

First thing is to understand that RAM disks do NOT actually exist. :)

I mean, unlike a floppy drive, a hard disk or a USB Mass Storage Devices, they cannot be connected :sos:, dropped on the floor :), lost :) :), touched, smashed :rofl: .

They are VIRTUAL devices that are created, temporarily and "on-the-spot" by RAMdisk drivers, using a portion of the RAM memory inside the computers.

There are basically two types of RAMdisk drivers:
1. OS INdependent RAMdisk drivers, generally BOOTABLE
and
2. OS dependent RAMdisk drivers, divided in in two subcategories:
2.a OS dependent BOOTABLE RAMdisk drivers
2.b OS dependent NOT bootable RAMdisk drivers



Some known examples of each category:

1. OS INdependent BOOTABLE RAMdisk drivers:
memdisk
grub/grub4dos

2.a OS dependent BOOTABLE RAMdisk drivers:
Microsoft Server 2003 SP1 or later RAMDISK.SYS (specific to NT based Systems)
Diskless Angel driver wdsys.sys (specific to NT based Systems)

2.b OS dependent NOT bootable RAMdisk drivers:
(specific to NT based Systems)
IMDISK
qSOFT
a number of other ones, a partial list is here among "FILEdisk" ones:
http://www.boot-land...?showtopic=1507
(specific to DOS):
Microsoft DOS RAMDRIVE.SYS
Franck Uberto's xmsdsk.exe:
http://www.geocities...rv/fu_rd19i.htm
SRDISK:
http://sourceforge.net/projects/srdisk

What is the difference between the 1.OS INdependent and the 2.OS dependent ones?
Basically the moment in which they come "into play".
OS INdependent ones create the RAMdisk BEFORE any Operating System is booted, and do this even if NO operating system is present.
OS dependent ones create the RAMdisk AFTER the Operating System, or at least a small part of it, has already being loaded.

In other words, OS INdependent Ramdisk drivers "hook" on the BIOS of the machine, whilst OS dependent ones "hook" on the Operating System.

From the above, it would appear that an OS INdependent RAMdisk can be used to boot ANY Operating System, but unfortunately this assumption is WRONG!

To remain in the restricted area of the most used Operating Systems, DOS and any dos based version of windows, like Win95, Win98 and Me, Linux in all his flavours and distributions and NT based windows, including NT, Win2K, WinXP, 2003 and Vista, one can draw a line (not necessarily between "good" and "bad", simply a line to separate them) with DOS/Linux on one side and NT based systems on the other one.

Without entering too much in the details and differences, DOS and Linux "trust" the information given by the BIOS (and thus any information "filtered" by the "hooked" upon the BIOS memdisk or grub/grub4dos) whilst NT based systems DO NOT, or to be more exact, do not trust the info in it's entirety/have peculiar ways to use it.

In the case of memdisk/grub/grub4dos, the RAMdisk driver creates the RAMdisk allright before the OS boots, but while DOS/Linux do use the information they give about the created RAMdisk while booting, NT based systems need a specific driver to take advantage/use this already created RAMdisk.

As per today, and as far as I know, this approach does NOT work with NT based systems.

In other words, whilst it is possible to boot NT based systems using syslinux/isolinux (from Peter Anvin, same author of memdisk) and grub/grub4dos to chainload "REAL" devices, like a disk partition, a floppy disk, a CD or disk images (also those of NT based systems, but limited to the "dos" initial part of booting) the same thing is not possible with "NOT REAL" or "VIRTUAL" devices such as a RAMdisk is.

On the contrary, and rather obviously, 2.a OS dependent BOOTABLE RAMdisk drivers, like the specific ones that were listed above can boot without any problem NT based systems, with two limitations:
1) Size of the image, 500 Mb max for MS RAMDISK.SYS and 4 Gb! :rofl: for wdsys.sys
2) Total amount of RAM physically present on the machine

Some further ideas/considerations can be found here:
http://www.boot-land...?showtopic=1441


Now, back to the original request, Recovery Console is something in between the "dos" part of NT based systems booting and a "full" (with GUI) NT based system booting, so it could maybe possible, though personally I would NOT be so sure about it, that Recovery Console can be booted through either memdisk or grub/grub4dos.

Out of the three mentioned projects, the one more "NT friendly" is grub4dos, so it is strongly suggested to follow windrv's suggestion and try with it, as there are more probabilities it might work.

Otherwise, I have to point you to the "Common Sense" advice given together with Board Rules:
http://www.boot-land...?act=boardrules
letter f., with particular regard to f.1 and f.2

and, if you wish, you can try a RAMdisk boot approach using Server 2003 SP1+ RAMDISK.SYS or the diskless angel one.

Maybe, just maybe, it would be possible to chainload through grub4dos an image containing RAMDISK.SYS ? :cheers:

jaclaz

#28 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12,309 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 25 July 2007 - 05:48 PM

It seems to me that there are a few misunderstandings/misconceptions in this thread that maybe I can contribute to clarify.


Thank you very much, Jaclaz :yahoo:

This post clarifies a lot of questions I'm currently concidering with my 'puzzleXP'

Peter

#29 Nuno Brito

Nuno Brito

    Platinum Member

  • Team Reboot
  • 10,121 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 25 July 2007 - 06:05 PM

Very clear to understand, this is a bookmarked page on my favourites.. :yahoo:

#30 windrv

windrv

    Member

  • Developer
  • 86 posts
  •  
    China

Posted 26 July 2007 - 01:39 AM

@th0ghts,

If you mount your bootxp.dsk using memdisk, your bootxp.dsk appears as (hd0) and no other hard disk(s) in your system will be seen under real mode without entering the protected mode operating system. If your operating system is Win9x, it may or may not be able to detect other hard disk(s) either.

Since your bootxp.dsk is larger than a floppy size, so I don't know if it can be mounted as a virtual memory floppy disk (fd0) or not since I have not tried this (my guess is probably "not"). If your bootxp.dsk can be mounted as a virtual memory floppy disk using memdisk, you may be able to see your other hard disk(s).

Using grldr, you can mount your bootxp.dsk as (hd0) and you are able to see your other hard disk(s) through using the right map command.

The title to be used in menu.lst in my answer to you earlier on assumes you have 1 hard disk and your bootxp.dsk is found within this hard disk.

If you really want to mount your bootxp.dsk as virtual memory floppy disk, then you may try to use the following steps to see if that can be done (of course no guarantee):

1. turn bootxp.dsk into a bootxp.img; i.e. a partition image file without mbr; this bootxp.img is better to be in FAT16 format (you of course may try other filesystem formats, such as FAT32 or NTFS);

2. put this bootxp.img into hd.dsk (if used with QEMU) mentioned above or onto your real hard disk;

3. copy grldr and menu.lst into the root of the first primary partition of hd.dsk or onto your real hard disk;

4. use grubinst to install grldr.mbr to your hd.dsk or your real hard disk;

5. boot your hd.dks under QEMU or your real hard disk.

The menu.lst mentioned above has the following title:

title boot bootxp.img as floppy
map --mem (hd0,0)/bootxp.img (fd0)
map --hook
rootnoverify (fd0)
chainloader (fd0)/???

Under the above title, substitute ??? with your bootfile name to be chainloaded for booting by grldr. And now your machine should appear to be booted from (fd0) under real mode. And your hd.dsk or your real hard disk appears as (hd0).

Also, the line -- rootnoverify (fd0) -- above if not successful, you can try using -- root (fd0)

You may go to http://www.znpc.net/forum/ for more advanced technical support for using grub4dos.

Or consult this link for other useful links for downloads and reference information, please also see the readme files within the downloaded packages:

http://www.znpc.net/.....;extra=page=1

About point 1 above for turning .dsk into .img, there is an easy way. You can use disklessangel to do that as follows:

a. start da;

b. click Build Disk Image under Tools menu;

c. in the output box, select or input your .dsk file with path;

d. select the partition listed in the larger box below;

e. press "o" (meaning outputting the partition selected;

f. in the dialogue box coming out after pressing "o", you input the filename you choose for outputting the selected partition as .img file.

da also helps you make partition image file, .img file in FAT16/32 format. You can do this by using Create Blank Image item under Tools menu.

You can build partition image file, .img file, into disk image file, i.e. .dsk file. You do this by using the Build Disk Image item under Tools menu above, inputting the name of your .img file in the input box and specify your .dsk file name in the output box. da will copy your .img file into a new file and patch an mbr in front of it to make a .dsk file.

For details of these, you can try to see the help documentation for the da Win9x version, though which has yet to be released.

#31 windrv

windrv

    Member

  • Developer
  • 86 posts
  •  
    China

Posted 26 July 2007 - 02:02 AM

@jaclaz,

I think Microsoft will do it on their own way for using their ramdisk.sys. They will not choose to depend on grldr for loading up their os. That is why they have their proprietary mbr and bootsector code. That has already prevented people from loading ntldr direct for many years until grldr comes along.

This behaviour makes it difficult for people to multi-boot its oses with other oses in order to make its oses the only oses to be used by users or at least windows users so that they cannot easily switch to other oses.

The switching from the use of io.sys to ntldr to bootmgr all represents the trend of this behaviour. Using io.sys, you can edit the config.sys, autoexec.bat and later also msdos.sys to do some configuration or load other real dos applications before loading win.com; when ntldr appears, you cannot load other applications, you can only do some configurations as allowed by what is permitted by ntldr in the form of boot.ini; now comes bootmgr which reads only bcd configurations hidded behind binary (possibly encrypted) files that only bootmgr can read, and you have to use its tools to make changes to such files, unlike before, when you can make changes to boot.ini using plain text editors. Before Vista was released, there had been rumours that Microsoft planned to make its future oses to be contained in a file (a kind of sql database file?) to be run. If it is successful, it further limits how you can make use of its operating system files. For example, you cannot extract its files out of the sql database file and run the operating system on a hard disk partition as now you do. In such way, the project of WinBuilder and the like will become useless or die. The use of wim file is just an attempt towards such a trend, though wim file can now only be run into ram just like .dsk file does. But the trend is to do more hiding, more encryption, more encapsulation so that if you want to use it, you use it in the way Microsoft likes.

Remember the disappearance of the kind of ini files and its replacement by registry files make it difficult for people to do things they want. Hacking the secrets of registry files becomes the key to success by nlite, bartpe & winbuilder as well. People nowadays therefore advocate doing applications as standalone applications without making use of registry for storing their application configuration data, without the need for installation and setup, just putting them into a folder and run, they call it "green application". For example, QEMU is green whilst VirtualBox not.

grldr can load up ramdisk.sys only by doing it through ntldr now.

Only if Microsoft is willing to release its secret technical information could what you mentioned be done.

#32 th0ghts

th0ghts

    Newbie

  • Members
  • 28 posts
  •  
    Israel

Posted 26 July 2007 - 05:58 AM

i'm gonna keep it bookmarked, also reread and retry..
if needed, be back to the thread farther help :yahoo:

thanks.

#33 windrv

windrv

    Member

  • Developer
  • 86 posts
  •  
    China

Posted 26 July 2007 - 07:07 AM

@th0ghts,

You are welcome! :yahoo:

#34 th0ghts

th0ghts

    Newbie

  • Members
  • 28 posts
  •  
    Israel

Posted 26 July 2007 - 08:39 AM

@windrv

i've posted yesterday the image files i made, i ask for someone to memdisk them or mount them anyway freestyle just to eliminate the images from being the problem.

anyway, i got grub4dos (installed it) and use qemu to check grub doing what you told it supposed to do.
i've installed grub mbr and manually enter:

title boot bootxp.img as floppy
map --mem (hd0,0)/xp.dsk (fd0)
map --hook
rootnoverify (fd0)
chainloader (fd0)+1


(in the quote, is the complete command line which you've posted)
through this command line, i wasn't able to mount the image (xp.dsk), though i was able to mount the image using the following commands:

title Boot from hard disk image
map (hd0,0)/xp.dsk (hd0)
map (hd0) (hd1)
map --hook
chainloader (hd0,0)+1
rootnoverify (hd0,0)


though it mount and boot the image, it stuck somewhere in the middle of running it, provide me the beautiful "blue screen of death" by microsoft; and that's the reason i've post my images - wanted to check if the image is good, cause i've got the same beautiful screen using simply cdshell and memdisk (when i finally memdisk the image under chshell, i got the same blue screen).

reading through grub4dos documentation, i've came across with:

memdisk

The indirect mapping of GRUB for DOS is similar to the function of external tool memdisk from syslinux. In fact, the following two menu entries do roughly the same thing:

—————————————————
title Boot from virtual disk using internal map command
map --mem (hd0,0)/aa.dsk (hd0)
map (hd0) (hd1)
map --hook
chainloader (hd0,0)+1
rootnoverify (hd0,0)
—————————————————
title Boot from virtual disk using external memdisk
kernel (hd0,0)/memdisk
initrd (hd0,0)/aa.dsk
—————————————————

However, memdisk does not support direct mapping or auto MBR creation.


windrv, so i guess using grub and\or memdisk to mount, gives the same exec result. am i mistaken?

i guess i need to get my hands on bootable cd using cdshell which mount many programs.
maybe there i'd find the answer. so which bootable cd using cdshell and mount big applications images?

#35 th0ghts

th0ghts

    Newbie

  • Members
  • 28 posts
  •  
    Israel

Posted 26 July 2007 - 08:51 AM

i wanted to mention this before..

to be able to run the *.dsk image files using memdisk, i've converted it to *.ima file with mbr using winimage (imdisk can write *.img file but it doesn't hold the mbr).

only by converting the image from *.dsk to *.ima with mbr; i was able to mount it using memdisk. and believe me, i've tried may other ways and options.

#36 windrv

windrv

    Member

  • Developer
  • 86 posts
  •  
    China

Posted 26 July 2007 - 08:53 AM

@th0ghts,

For you to load your image file as (fd0), have you converted your .dsk into .img as I described earlier?

.dsk file is disk image file with an mbr that cannot serve as a floppy. You probably need to make a FAT16 .img file for this purpose.

Also you have to chainloader:

chainloader (fd0)/???

where ??? is the boot file name on the virtual memory floppy.

instead of you using (fd0)+1, because you probably do not have the bootsector code in your .img file that can load your boot file. Let grldr to load your boot file for you.

But it seems that you have not told us clearly what you want to do by booting your image file up either as hard disk or floppy disk.

Is it intended to use it for setting up an xp system on hard disk?

However, please bear in mind that without appropriate driver, after entering your xp (presumably starting from your hard disk), your image file thus loaded up in memory cannot be seen nor accessed.

#37 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7,098 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 26 July 2007 - 09:27 AM

@windrv

Yes, you are right about MS RAMDISK, however Dietmar reported success with his "home made" RAMDISK driver.
There are bits and pieces of it all over the internet, and he promised he would release an enhanced version, but it's a lot of time I don't see any activity from him in the "usual places".
http://www.boot-land...?...c=1441&st=8

I have tried quite a bit of drivers around, most of them were not fully tested, and I seem to find not anyone willing to help/contribute in this search or at least people with the right kind of knowledge (which I miss almost completely) have better/more important things to do.

just to clarify further something:

.dsk file is disk image file with an mbr that cannot serve as a floppy. You probably need to make a FAT16 .img file for this purpose.

Though it is evident from the context there is NO set "standard" about disk image file extensions, .dsk or .img can be either with or without MBR, you have to look inside the actual image to know which is which.
There is NO functional (or formatting difference whatsoever) between FAT12 and FAT16 at the bootsector level, so, at least theoretically, the format conversion should NOT be necessary, unless grub4dos has a "bug" or "peculiarity" about it.
FAT12 and FAT16 are actually the "same" filesystem, by default DOS or Windows 9.x/Me will FDISK any partition or volume below 32 Mb as FAT12 and any volume bigger ( up to a few hundreds Mb, cannot recall the exact figure right now) as FAT16, everything bigger, in the case of Win95 OEM release 2 and later, becomes FAT32 which IS different.

jaclaz

#38 windrv

windrv

    Member

  • Developer
  • 86 posts
  •  
    China

Posted 27 July 2007 - 12:54 AM

@jaclaz,

Yes. There are no standardized ways of naming a disk image file, one with mbr, and naming a partition image file, one without mbr. But it however should be so distinguished and I myshelf would like to use .dsk as the file extension for disk image file and .img for partition image file.

FAT12 is originally the defacto format used in floppy disks.

However, as grldr seems to be able to load up very large partition image file, .img file, as a virtual floppy disk using designations such as (fd0) or (fd1), so I advised th0ghts to use FAT16 as it appears that th0ghts needs to accommodate a lot of files into it. Anyone can of course use FAT12 for that purpose if it suits their needs. Also one may try to use partition image file of FAT32 or (compressed) NTFS or even ext2 filesystem formats for that purpose and see if it works provided that their bootfile is able to handle those filesystem formats.

#39 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7,098 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 27 July 2007 - 12:00 PM

@th0ghts

I guess that there are still some misunderstanding.

to be able to run the *.dsk image files using memdisk, i've converted it to *.ima file with mbr using winimage (imdisk can write *.img file but it doesn't hold the mbr).

only by converting the image from *.dsk to *.ima with mbr; i was able to mount it using memdisk. and believe me, i've tried may other ways and options.


If I get it right you created the image file with the qemu tool and FDISKed/FORMATted it under Qemu as told.

Rather obviously this image has a MBR (you FDISKed it, remember?).

Then you mounted it with IMDISK with offset 63 blocks (i.e. skipping the MBR and first 62 hidden sectors).

Then you opened it with Winimage (that can ONLY connect to one partition at a time) and exported it to an image with MBR.

As told, there was no need whatsoever for the last operation, the image already had a MBR (and hidden sector), IMDISK and WINIMAGE simply can connect to just one partiion of the image, ignoring the MBR and hidden sectors.

To manage images with MBR and hidden sectors the VDK is much more convenient as it allows access to them also.

the beautiful "blue screen of death" by microsoft

there exist hundreds of BSOD's, they are all blue background, they all stop the system, they all have CODES explaining (sometimes, you know how the MS guys tend to be a little cryptic at times :yahoo:) WHAT has caused it.
Though I could swear that you got a STOP 0x000007b "unaccessible boot device", whenever you report a BSOD ALWAYS quote the exact error codes you had and the accompanying text, this is necessary to help on troubleshooting.


i guess i need to get my hands on bootable cd using cdshell which mount many programs.
maybe there i'd find the answer. so which bootable cd using cdshell and mount big applications images?

Just for the record, grldr, part of grub4dos, can be used as No-Emulation CD bootsector too, offering over CDShell many more NT/PE specific options and offering, expecially to the newbie the advantage of the need to learn just the grub4dos menu.lst syntax instead of BOTH grub4dos and cdshell one.
Notnetheless, CD's, WHATEVER bootmanager you use, have the same limitations of hard disk or whatever else mass storage devices when it comes to booting from images, since the limitation is WITHIN the way NT/PE based system boot.
Please do review my previous post:
http://www.boot-land...?...ost&p=18147

If anything is not clear, do ask.

jaclaz

#40 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3,841 posts
  •  
    Australia

Posted 04 January 2008 - 01:29 AM

Though I could swear that you got a STOP 0x000007b "unaccessible boot device", whenever you report a BSOD ALWAYS quote the exact error codes you had and the accompanying text, this is necessary to help on troubleshooting.


Hi jaclaz,

I've been testing Peter's latest project, and decided to see if a HD image of it could be booted via memdisk. I can confirm that the error is indeed a STOP 0x000007b, more specifically:
STOP: 0x0000007B (0xF7982524,0xC0000034,0x00000000,0x00000000)

The image was firstly of xp files, but 2k3 doesn't make any difference either.

Regards,
Galapo.

#41 alex7street47

alex7street47

    Newbie

  • Members
  • 24 posts
  • Interests:Programming
  •  
    United States

Posted 28 April 2009 - 08:26 PM

im offering u to debug boot process with
WinDbg and VMWare ....or softice

and see more on what XP really needs... :)

if only i have speed machine resource on it

Thx.




2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users