Halfwalker

How to boot/install from USB key ?

486 posts in this topic

@ilko_t

NTDETECT.COM and NTLDR are the same files as on root of your USB stick, you can copy them from your XP install source i.e. \I386 or \$WIN_NT$.~BT on your USB stick. BOOT.INI code is described right under 7., you need to CREATE it, you don't copy it from anywhere. As I already wrote- prepare the stick in advance and at once, from working XP/2k whatever system you have. Once it's prepared no further steps are needed.

As for the HAL missing error please post here your BOOT.INI file found on root of your USB stick.

Yes, i think i has made the mistake on this boot.ini file. I will try it again at tomorrow.

As for the slow speed- are you sure your motherboard supports USB2.0? Once drivers in TEXT mode setup are loaded and you are presented the screen to choose REPAIR/INSTALL if motherboard supports USB2.0 you should have it.

My motherboard is Gigabyte M55plus-S3G/AM2 and it supports USB2.0. On the other hand, my flash drive is kingston DTI 2G (Datatraveler) and it also supports usb 2.0. I really don't understand where is my mistake. I think it is a very serious problem for the slow copying speed. I really want to find out the reason.

P.S. please be careful when quoting, it's hard to understand which part was written by you and which is quoted.

Sorry for my pooring quoting. I have amended it and thks for your nice helping.

0

Share this post


Link to post
Share on other sites
P.S. please be careful when quoting, it's hard to understand which part was written by you and which is quoted.

Yep, also if you write (without the underscores):

[_quote_]

This is a quoted sentence.

[_/quote_]

you get:

This is a quoted sentence.

but if you write (again without the underscores)

[_quote=jaclaz_]

This is a quoted sentence, and the author is shown between parenthesis.

[_/quote_]

you get:

This is a quoted sentence, and the author is shown between parenthesis.

jaclaz

Thks for your teaching. :rolleyes:

0

Share this post


Link to post
Share on other sites

@jaclaz

Thanks for floppy image / recocery console link.

I tried direct mapping of the image and failed.

And integration some Dietmar's ideas, like load USB drivers earlier, failed too.

Sad, I like this idea more. This dosn't require 2003 files.

Second approach:

(ntldr above is really SETUPLDR.BIN renamed as ntldr, right?)
Yes, ntldr is a renamed 2003 SP1 setupldr.bin.

And I forgot to mention to copy 2003 ramdisk.sy_ to image.

By the way: did you opened KB310994 floppy image? Bootsector loads setupldr.bin.

"hiveOEM.inf goes to H:\I386\txtsetup.sif" in more words:

Edit file H:\I386\txtsetup.sif, add hiveOEM.inf entries.

Copy file hiveOEM.inf to <USB drive>\$WIN_NT$.~LS\I386\hiveOEM.inf. File location hasn't changed to previous messages.

The "RAMLOAD.IMG" contains:

a dirtectory \I386 containing all files from \$WIN_NT$.~BT\ + txtsetup.sif

And migrate.inf, if necessary for drive letter fixing.

Writeprotect at migrate.inf is not necessary. Break, maybe my memory fails: did I include writeprotect in migrate.inf?. I don't recall my latests tests anymore.

And grub4dos boots in such a manner that SETUP assigns C:\ to the boot.ima file?

Is the above correct?

Good question, let's say this is my impression.

SETUP dosn't list C: to a partition. C: is not assigned to a real partition.

Most likely 2003 SP1 RAM loaded partition get letter X: internally.

So I assume C: goes to grub4dos virtual partition.

No need to use XP embedded tools, using VDK.EXE instead of IMDISK it is possible to create and format a full hard disk image
XP Embedded virtual hard disk appear in Disk Management and registry. Windows thread them as a real hard disk.

For testing purposes I like to use this informations.

If this leeds to a solution, VDK may come in handy. But currently I avoid additional confusion.

0

Share this post


Link to post
Share on other sites

@ilko_t

NTDETECT.COM and NTLDR are the same files as on root of your USB stick, you can copy them from your XP install source i.e. \I386 or \$WIN_NT$.~BT on your USB stick. BOOT.INI code is described right under 7., you need to CREATE it, you don't copy it from anywhere. As I already wrote- prepare the stick in advance and at once, from working XP/2k whatever system you have. Once it's prepared no further steps are needed.

As for the HAL missing error please post here your BOOT.INI file found on root of your USB stick.

Yes, i think i has made the mistake on this boot.ini file. I will try it again at tomorrow.

I had amended the BOOT.INI and i was able to install WINDOW XP From the flash drive successfully. Your method is very good. However, the procedure of deleting temporary file at the last 1 mintue is extremely slow. I need to spend around one hour to finish this process.

Do i make any mistake again? Thks for your help.

0

Share this post


Link to post
Share on other sites

The long wait at T-1 is finally fixed, also no need to write-protect the stick during GUI mode, as we are going to rename temporary the 2 folders and txtsetip.sif and rename them back during first logon. Here is the revised guide, tested on XP Pro SP2, both clean and repair install.

With RED color are marked new or changed entries, strikethrouh font is for entries or files no longer needed compared to the old guide. If you are starting from a scratch just skip those entries or files:

1. Format stick using PEtoUSB or any other utility of your choice, which makes it bootable with 2k/XP boot sector

2. Copy NTDETECT.COM, NTLDR to root and create BOOT.INI

BOOT.INI

[Boot Loader]
Timeout=15
Default=multi(0)disk(0)rdisk(1)partition(1)\WINDOWS
[Operating Systems]
c:\grldr="Start GRUB"
multi(0)disk(0)rdisk(1)partition(1)\WINDOWS="GUI Setup" /FASTDETECT

If you are going to install on another partition/disk amend entries to reflect that.

Make sure you can boot from stick and reach the menu.

3. Get the latest GRUB4DOS and copy GRLDR to the USB root. If you have any issues use the last stable version. Create in USB stick root

MENU.LST

color black/cyan yellow/cyan
timeout 15

default 0

title Phase 1 WinXP Text Mode Setup
chainloader (hd0,0)/setupldr.bin

4. Backup your local BOOT.INI and in the XP setup folder \I386 run

winnt32 /makelocalsource /noreboot

after it's finished restore BOOT.INI you backed up.

5. Copy two new folders onto the USB stick root - $WIN_NT$.~BT and $WIN_NT$.~LS

6. In \$WIN_NT$.~BT modify

WINNT.SIF

[data]

msdosinitiated="1"

floppyless="1"

AutoPartition="0"

UseSignatures="no"

InstallDir="\WINDOWS"

winntupgrade="no"

win9xupgrade="no"

[GuiRunOnce]

"regedit /s %systemdrive%\windows\system32\undoUSBWP.reg"

"%systemdrive%\windows\system32\undoren.cmd"

[setupParams]

UserExecute = "%systemdrive%\windows\system32\boot_ren.cmd"

and

MIGRATE.INF

[Version]
Signature = "$Windows NT$"

[Addreg]
HKLM,"SYSTEM\MountedDevices",,0x00000010
HKLM,"SYSTEM\ControlSet001\Control\StorageDevicePolicies","WriteProtect",%REG_DWORD%,1

[Strings]
;Handy macro substitutions (non-localizable)
REG_SZ = 0x00000000
REG_BINARY = 0x00000001
REG_DWORD = 0x00010001
REG_MULTI_SZ = 0x00010000
REG_SZ_APPEND = 0x00010008
REG_EXPAND_SZ = 0x00020000

If you wish to preserve your USB storage drive letter use CDOB's script to create MIGRATE.INF, don't forget to add the above entries :

MkMigratgeInf.cmd

@echo off
REM MkMigratgeInf.cmd v0.01
REM created by cdob

setlocal EnableExtensions

set Drive=%~d1
if %Drive%.==. set Drive=%~d0

set FileName=%~2
if %FileName%.==. set FileName=MIGRATE.INF.TXT

set MigrateDrive=U:
if not %~d3.==. set MigrateDrive=%~d3

set Value=
FOR /F "skip=2 tokens=1-2*" %%a IN ('reg query HKLM\System\MountedDevices /v \DosDevices\%Drive%') DO set Value=%%c

if %Value%.==. (echo drive settings %Drive% not found & goto :EOF)

set MigrateStr=%Value:~0,2%
set count=2
:begin_parse
call :exec set MidStr=%%Value:~%count%,2%%
if %MidStr%.==. goto :exit_parse
set MigrateStr=%MigrateStr%,%MidStr%
set /a count+=2
goto begin_parse
:exit_parse

(echo [Version]
echo Signature = "$Windows NT$"
echo.
echo [Addreg]
echo HKLM,"SYSTEM\MountedDevices","\DosDevices\%MigrateDrive%",0x00030001,\
echo %MigrateStr%)>%FileName%

goto :EOF

:exec
%*
goto :EOF

7. Create a folder BOOTFILES in USB stick root, and copy NTDETECT.COM, NTLDR and create there your custom BOOT.INI, which will be copied on hard disk later, during the first logon. Set them system, hidden and read-only in advance.

BOOT.INI

[boot loader] 
timeout=15
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="XP Professional 0 1" /noexecute=optin /fastdetect
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="XP Professional 0 2" /noexecute=optin /fastdetect
multi(0)disk(0)rdisk(0)partition(3)\WINDOWS="XP Professional 0 3" /noexecute=optin /fastdetect
multi(0)disk(0)rdisk(1)partition(1)\WINDOWS="XP Professional 1 1" /noexecute=optin /fastdetect
multi(0)disk(0)rdisk(1)partition(2)\WINDOWS="XP Professional 1 2" /noexecute=optin /fastdetect
multi(0)disk(0)rdisk(1)partition(3)\WINDOWS="XP Professional 1 3" /noexecute=optin /fastdetect

8. Create:

undoUSBWP.reg

 no longer needed !

hiveOEM.inf

no longer needed !

BOOT_REN.CMD

@echo off

SET TAGFILE=\bootfiles
FOR %%h IN (C D E F G H I J K L M N O P Q R S T U V W X Y) DO IF EXIST "%%h:%TAGFILE%" SET USBDRIVE=%%h:

xcopy %USBDRIVE%\bootfiles\*.* %SYSTEMDRIVE%\ /y /h /r /k

ren %USBDRIVE%\txtsetup.sif txtsetup.bak
ren %USBDRIVE%\$WIN_NT$.~BT WIN_NT.BT
ren %USBDRIVE%\$WIN_NT$.~LS WIN_NT.LS

exit

UndoRen.CMD

@echo off

SET TAGFILE=\BOOTFILES
FOR %%h IN (C D E F G H I J K L M N O P Q R S T U V W X Y) DO IF EXIST "%%h:%TAGFILE%" SET USBDRIVE=%%h:

ren %USBDRIVE%\txtsetup.bak txtsetup.sif
ren %USBDRIVE%\WIN_NT.BT $WIN_NT$.~BT
ren %USBDRIVE%\WIN_NT.LS $WIN_NT$.~LS


exit

and place them in $WIN_NT$.~LS\i386

9. Copy TXTSETUP.SIF and SETUPLDR.BIN from \$WIN_NT$.~BT to root of USB stick and add the following lines to

TXTSETUP.SIF

[sourceDisksFiles].....

.....

hiveOEM.inf = 100,,,,,,_x,,3,3

undoUSBWP.reg = 100,,,,,,_x,2,0,0

BOOTFLS.CMD = 100,,,,,,_x,2,0,0

boot_ren.cmd = 100,,,,,,_x,2,0,0

undoren.cmd = 100,,,,,,_x,2,0,0

....

....

[HiveInfs.Fresh]

AddReg = hiveOEM.inf,AddReg

[HiveInfs.Upgrade]

AddReg = hiveOEM.inf,AddReg

--------

Install XP and leave stick plugged in until after the first logon screen.

Notes:

1. If you use an answer file when launching WINNT32.EXE make sure you delete the whole [unattend] section in WINNT.SIF, otherwise you won't be able to use System Restore and SETUP will not prompt on which partition to install.

2. If you use BTS mass storage DP method 2 and repair install then include the following line in \$WIN_NT$.~LS\I386\PRESETUP.CMD

DEL /F %systemroot%\system32\setupold.exe

or GUI Setup stops at start, complaining about fake setup being executed.

3. If during TEXT MODE your usb stick is listed first when SETUP searches for disks , above SATA/SCSI disks, disable in BIOS IDE channels including the ones with CDROM/DVD attached or disconnect them, this should fix the order. Do not continue install if stick is listed first, this will corrupt files and MBR on it.

------------------------------------

The problem described in post #156 turned out to be that the script launched by CMDLINES.TXT was being executed from within $WIN_NT$.~LS, giving "access denied" error, so I have tried to launch same script via WINNT.SIF [setupParams] section which worked flawlessly. Wait at T-1 is about 1-2 seconds now, this also saved a few files and entries to be written :)

edit1 (15.Jun.07): Undo_Ren.cmd corrected to UndoRen.cmd

Edited by ilko_t
0

Share this post


Link to post
Share on other sites

Another interesting for me thing- I had Bart PE minint folder on the root of the same stick, while testing I have noticed that if txtsetup.sif in root is missing or renamed, Bart PE is launched instead of TEXT mode setup. It might have been already discussed somewhere, but gives a good idea how both may coexist, without having to create second partition for it. I am going to test it further and report results.

@buseeliu- try some random shots to see why your USB stick is so slow:

1. Update your BIOS

2. Check setting in BIOS for USB, make sure USB2.0 is enabled, play a bit with the other settings for USB- legacy support etc.

3. Test the same stick on another motherboard/system, which is known to support faster speeds

4. Test on your motherboard another stick, which is known to be fast

5. Unplug all other USB devices while testing

6. Use one by one the rear USB ports, try do disconnect fron USB ports from motherboard

May be jaclaz can help you with some other ideas, hes knowledge about usb sticks is amazing :thumbup

@jaclaz- Have you had a chance to look what was going wrong with MBRs?

Edited by ilko_t
0

Share this post


Link to post
Share on other sites

@ilko_t

At first glance I dislike renaming $WIN_NT$ folder. Is this reliable?

Contrary no long wait at T-1: You confinced me.

I like renaming $WIN_NT$ folders. Nice solution, thanks.

BOOT_REN.CMD:

Can you backup a possible existand boot.ini?

Idea, not tested:

copy %SYSTEMDRIVE%\boot.ini %SYSTEMDRIVE%\boot.%date%.ini  /y
xcopy %USBDRIVE%\bootfiles\*.* %SYSTEMDRIVE%\ /y /h /r /k

And can you create boot.ini dynamically?

Not a fixed \WINDOWS, extract foldername from %SystemRoot% ?

About multi boot:

Setupldr.bin seek folder minint first, $WIN_NT$.~BT next.

Hexedit \$WIN_NT$.~BT\setupldr.bin. Change minint to miniOf.

menu.lst

chainloader /$WIN_NT$.~BT/setupldr.bin

chainloader /minint/setupldr.bin

0

Share this post


Link to post
Share on other sites

Thks for your effort again. I will try your method two days later since i am too busy currently.

Furthermore, Can i you use this method to install xp if i want to use usb notebook harddisk?

Thks for your good & professional advice.

0

Share this post


Link to post
Share on other sites
@jaclaz- Have you had a chance to look what was going wrong with MBRs?

@ilko_t

Here is what I have found:

No differences are found between BootSector_USB_Before.dat and BootSector_USB_After.dat.

Both are FAT 16 bootsectors with 63 sectors before and partition length of 3997633 sectors.

The stick appears to have a CHS Geometry of 248x255x63.

MBR_USB_Before.dat appears to be a MBR written with the "HP" utility, check this thread here for a very recent discover on how and why (maybe) the MBR written by the HP utility is different from the "standard" NT/2K/XP/2003 one:

http://www.boot-land.net/forums/index.php?...=2246&st=15

MBR_USB_After.dat is a "standard" NT/2K/XP/2003 (English).

MBR_USB_Before.dat has a 0E (FAT 16 LBA) partition ranging from CHS 0/1/1 to 247/254/63 with LBA StartSector of 63 and Numsectors 3997633.

MBR_USB_After.dat has a 0E (FAT 16 LBA) partition ranging from CHS 0/1/1 to 247/215/31 with LBA StartSector of 63 and Numsectors 3997633.

Now, in CHS->LBA translation, on a "normal" Nx255x63 Geometry, 0/1/1 is sector 63, so the StartSector in BOTH MBR's is correct.

On the contrary, both Numsectors appear to be incorrect, 247/254/63 in CHS->LBA translation is sector 3984119 thus Numsectors is 3984057, and 247/215/31 is sector 3981630 thus Numsectors is 3981568.

Going the other way round, Numsectors 3997633 correspond to CHS address 248/215/31.

(248 is a "wrong" value, as it is one Cylinder more than the total number of Cylinders that range from 0 to 247)

So, it appears that the "HP" utility defaults to the Max Cylinder, Max Head and Max Sector (247/254/63) and writes the LBA independently, whilst Windows Setup or whatever wrote the MBR_USB_After.dat gets the right End Head (215) and End Sector (31), and tops the End Cylinder to Max Cyl (247) getting 247/215/31 instead of the "theoretically coorect 248/215/31.

Some details of the "queer" way of CHS to LBA conversion and viceversa, and their effects can be found on my page:

http://home.graffiti.net/jaclaz:graffiti.n...B/USBstick.html

If you get Roadkil's Disk Image:

http://www.roadkil.net/DiskImg.html

and make an image of the stick, you will most probably find that the image has a size of 2,046,788,096 bytes, i.e. 3997633+63=3997696 sectors x 512 bytes/sector.

If you find another size, I would like to know it.

Good work with latest tutorial! :)

Just as a reminder, cdob's MkMigratgeInf.cmd (GOOD work) needs (of course) to be run from within a 2K/XP/2003 system. Even if I have NO idea why it could become useful, the data to build MIGRATE.INF.TXT can be found in the MBR of the stick, see here:

http://www.911cd.net/forums//index.php?showtopic=19663

If I get it right, with this latest one, since there is no drive "exchange" grub4dos is only needed to chainload setupldr.bin.

If you think it might be of use, I could follow cdob's idea and get from the FAT12 bootsector of the first of the install floppies the code for invoking setupldr.bin instead of NTLDR and prepare an easy way to patch any FAT16 or FAT32 bootsector (for NTFS it might prove to be tricky).

We could use a NTLDR and add to it an entry to direct chainload such a patched bootsector.

Of course the above would limit the amount of (possible) multi-booting capabilities of the stick, but will eliminate the need for GRLDR and menu.lst.

Also, I am not sure I have fully (or correctly) understood the need for multiple BOOT.INI entries, pointing to rdisk(0) and rdisk(1) and to partitions 1, 2 and three on them.

I am sure we can find a way to generate on-the-spot a correct BOOT.INI.

For the record, BOOT.INI has no need to be marked as System, Hidden, Read Only.

jaclaz

0

Share this post


Link to post
Share on other sites
Can you backup a possible existand boot.ini?

Idea, not tested:

copy %SYSTEMDRIVE%\boot.ini %SYSTEMDRIVE%\boot.%date%.ini  /y
xcopy %USBDRIVE%\bootfiles\*.* %SYSTEMDRIVE%\ /y /h /r /k

Should work just fine.

And can you create boot.ini dynamically?

Not a fixed \WINDOWS, extract foldername from %SystemRoot% ?

I spent a lot of time searching for a tool, which creates or amends properly BOOT.INI during GUI part with the correct entries, in order to avoid the brute-force way of copying generic one. Had no luck, BOOTFIX doesn't work during GUI part the way it does in Recovery Console, it works the way as in full XP environment. Couldn't find any other suitable tool for the purpose and ended up copying it from stick.

If you can get the windows directory and apply it to the generic boot.ini it would make the guide more universal. Actually ATM only boot.ini creation differs the last guide from normal setup.

Your ideas about mapping setup floppies via GRUB is nice, hopefully this can be done.

About multi boot:...
Thanks for tip :)

----------------

Here is what I have found:....
Perfect as usual :thumbup

Stick was formated by PEtoUSB - MBR_USB_Before.dat

Later rewritten by TEXT mode setup- MBR_USB_After.dat, leaving some files unreadable and stick no longer bootable. If I format the same stick from XP with FAT16 or 32 I cannot boot from it.

If you get Roadkil's Disk Image:

http://www.roadkil.net/DiskImg.html

and make an image of the stick, you will most probably find that the image has a size of 2,046,788,096 bytes, i.e. 3997633+63=3997696 sectors x 512 bytes/sector.

If you find another size, I would like to know it.

2,046,820,352 bytes, formated by PEtoUSB as before. The only difference is that ATM I am using Hitachi microfiter driver to keep it as fixed, thus allowing me quickly to image it with Acronis TI. May be that's why it differs form your calculations?

BTW Roadkil's Disk Image v1.1 always gives me "image creation failed" with all USB sticks I have, formated by various tools, most of the time I can see progress going beyond 100%, i.e. 102, 105 and I completely stopped using it as a backup solution.

Just as a reminder, cdob's MkMigratgeInf.cmd (GOOD work) needs (of course) to be run from within a 2K/XP/2003 system. Even if I have NO idea why it could become useful, the data to build MIGRATE.INF.TXT can be found in the MBR of the stick, see here:

http://www.911cd.net/forums//index.php?showtopic=19663

This would be nice, but is it necessary since all of the preparation is done in 2K/XP/2003 system anyway?
If I get it right, with this latest one, since there is no drive "exchange" grub4dos is only needed to chainload setupldr.bin.
Yep, if we find a way to invoke setupldr.bin directly from BOOT.INI GRUB will be no longer needed. At the moment if it is called, result was restart as far as I remember, because stick at that time is initialized as hd1, perhaps newer or HEX edited versions of these files will avoid it, but that's beyond my capabilities.

I don't think patching MBR will be of any use at this stage, it should be setupldr.bin or ntdetect.com which cause that reboot. I will redo the tests and will report what may be causing reboots later.

Also, I am not sure I have fully (or correctly) understood the need for multiple BOOT.INI entries, pointing to rdisk(0) and rdisk(1) and to partitions 1, 2 and three on them.

I am sure we can find a way to generate on-the-spot a correct BOOT.INI.

For the record, BOOT.INI has no need to be marked as System, Hidden, Read Only.

jaclaz

The idea for multiple entries was to have as much universal BOOT.INI as possible, for example if one installs on different than 1st HD 1st partition. If it can be properly created that would be nice :)

The files are meant to be hidden and system exactly as a normal install will make them. There is no need to make them such, but it's good idea to have them, if installing it for non- technical users, which like to delete anything what they don't like or find strange, lets stay on the safe side ;)

BTW on Dell Dimension E520 with Intel P965/G965 MB I had BSOD 7B when starting XP SP2 Setup from the same stick, right after loading drivers and showing "windows is starting". Plugging stick in diff. front/rear ports made no difference.

The fix was to use Dietmar's modified NTDETECT.COM, no more BSODs. Bart PE, based again on XP SP2 was giving the same 7B, and a full XP on another stick was freezing before loading shell. Modified file fixed them all.

0

Share this post


Link to post
Share on other sites

@ilko_t

About boot.ini, wouldn't a good old batch file be more than enough?

I normally run Win2K, coming with experience on NT4, never used bootfix.bin in my life, just the old way with batches, here are some examples, but of course we need to modify them according to our needs, it won't be difficult once I understand what they are.

http://www.msfn.org/board/index.php?showtopic=66101&hl=

One could easily search for a "tag file" like a file that is only in %windir% on all drives, and prompt the user to confirm the entry or entries.

Just let me know which "features" are required.

BTW Roadkil's Disk Image v1.1 always gives me "image creation failed" with all USB sticks I have, formated by various tools, most of the time I can see progress going beyond 100%, i.e. 102, 105 and I completely stopped using it as a backup solution.

Yep, that's perfectly normal, as, as seen in the case you posted, the real size of the stick differs from what is "declared" or at least from what Windows can "see".

To calculate the percentage of progress, rather obviously the programmer needs to calculate in "real time" the amount of data transferred divided by the total amount of data, the algorithm Roadkil's Disk Image uses is something like (in VERY "pseudo"code):

set source=source
set dest=dest
set SOURCESIZE=getsourcesizeinsectors(source)
Set N=1
:loop
If exist source\sector(N) do Copy source\sector(N) dest\sector(N) else goto :end
display progressbar(N/SOURCESIZE)
goto :loop
:end

So, when N becomes bigger than SOURCESIZE, the number displayed becomes bigger than 100%, and it is probable that there is some check control that throws an error because the program thinks it has copied more data than available.

I would be curious about a comparison between image size results coming from the use of Roadkil's, Acronis and with dsfi/dsfo, part of the DSFOK toolkit:

http://members.ozemail.com.au/~nulifetv/freezip/freeware/

(command line, but VERY accurate, that, not having the check hypothized above, does not throw any error)

2,046,820,352 should then be the "real" size of the stick, this corresponds to the CHS end address of 248/216/31, this means that maybe, instead of "topping" to MaxCyl, the (wrong) partitioning simply takes 1 off BOTH NumCyl and NumHds.

On a different geometry, like Nx128x32, End address of 2,046,820,352 would be exactly CHS 976/0/32, i.e. a "correct" Head boundary one.

The maximum "correct" CHS address in a 248x255x63 geometry remains however 247/254/63, which leaves you with 2,046,820,352-2,039,837,184=6,983,168 bytes or 13,639 sectors not accessible/unused.

Yep, if we find a way to invoke setupldr.bin directly from BOOT.INI GRUB will be no longer needed. At the moment if it is called, result was restart as far as I remember, because stick at that time is initialized as hd1, perhaps newer or HEX edited versions of these files will avoid it, but that's beyond my capabilities.

I don't think patching MBR will be of any use at this stage, it should be setupldr.bin or ntdetect.com which cause that reboot. I will redo the tests and will report what may be causing reboots later.

No need to patch the MBR, all the "fun" happens in the bootsector, as cdob pointed out.

If I am "allowed" to use dsfi/dsfo above, I can put together a small batch file that:

1) gets the bootsector from the stick and makes a copy of it

2) patches the copy so that it is invoking SETUPLDR.BIN

3) adds an entry in boot.ini directly chainloading the modified bootsector

I have used similar batches in the past, they work for both FAT16 and FAT32, using it for NTFS might need some more work, but the USB device is normally FAT16 (or 32) anyway, isn't it?

jaclaz

0

Share this post


Link to post
Share on other sites

@jaclaz - what we need is a way to get the proper ARC path is it would be seen if no USB stick's BOOT.INI is used to call the GUI mode, find in what directory windows was placed in and amend or create a new BOOT.INI.

The issues I can see:

- bootcfg.exe doesn't change entries when working in this mode, it works as if run in normal XP environment. So no options to add boot entries.

- If GUI setup is called by ntldr/ boot.ini on the stick, hard disk is seen by GUI SETUP and supposedly by any suitable tool for getting ARC path as HD1, instead of HD0.

- If Grub mapping is used (hd0->hd1 and hd1->hd0) boot.ini will be created by Setup with the proper ARC path, but with a signature, which we liked to avoid. May be a script can replace the signature part with "multi", resulting in proper boot.ini? Can you do it by script?

signature(de33eaf8)disk(0)rdisk(0)partition(1)\WINDOWS ---> multi(0)disk(0)rdisk(0)partition(1)\WINDOWS

Menu.lst in this case would be like:

map --read-only (hd0) (hd1)
map --hook
root (hd1,0)
chainloader (hd1,0)/ntldrstp

restricting us to one hard disk only, if one plans to install it on another, mapping should be modified, which is a bit restricting. Thats why I preferred not to use mapping at all.

In summary: with mapping- signature part must be removed and Menu.lst amended if use more than 1 HD.

With no mapping- "universal" boot.ini must be used on both USB stick and the one we copy to hard disk.

Next few days I will be working on cdob's ideas.

BTW you mean bootcfg.exe, not bootfix.bin, right?

0

Share this post


Link to post
Share on other sites
BTW you mean bootcfg.exe, not bootfix.bin, right?

Cannot say, I never used it, WHATEVER it is called ;):lol:

Try this:


@ECHO OFF
::fix_bini.cmd
::Small batch to make a BOOT.INI
::by jaclaz

::The following might need to be changed:
Set drive=C:
Set windowsdir=WINDOWS
Set rdisk=0
Set partition=1

:Check
IF NOT EXIST %drive%\%windowsdir%\explorer.exe GOTO :Error

::WARNING!
::DO NOT EDIT BELOW LINES - CHANGE VARIABLES ABOVE INSTEAD
ATTRIB -H -S -R %drive%\BOOT.INI
IF NOT EXIST %drive%\BOOT.$$$ COPY %drive1%\BOOT.INI %drive%\BOOT.$$$ >NUL
ECHO [Boot Loader]> %drive%\BOOT.INI
ECHO Timeout=0 >> %drive%\BOOT.INI
ECHO [Operating Systems]>> %drive%\BOOT.INI
ECHO Default=multi(0)disk(0)rdisk(%rdisk%)partition(%partition%)\%windowsdir%>> %drive%\BOOT.INI
ECHO multi(0)disk(0)rdisk(%rdisk%)partition(%partition%)\%windowsdir%="Windows XP Professional" /noexecute=optin /fastdetect>> %drive%\BOOT.INI
::DO NOT EDIT ABOVE LINES

REM ATTRIB +H +S +R %drive%\BOOT.INI

GOTO :EOF

:Error
SET Choice=
CLS
ECHO An installation of Windows was not found on given path %drive%\%windowsdir%
ECHO the batch has not performed any action, this could lead to an unbootable system
ECHO Do you want to search for an install on another drive letter?
SET /P Choice=(Y/N)
IF /I NOT %Choice%.==Y. GOTO :Exit
:Loopdrive
CLS
ECHO Please input another drive letter and press Enter:
SET /P Drive=
IF %Drive%.==. GOTO :Loopdrive
Set Drive=%Drive%:
GOTO :Check

:Exit
CLS
ECHO An installation of Windows was not found on given path %drive%\%windowsdir%
ECHO Exiting...
PAUSE

The above should have a very minimal error checking, what I would like to know is if it can work in the environment it is supposed to run, which I am not sure has all the features of a normal command prompt.

Of course, once we are sure (as we should) that the drive letter is C: and that arcpath is

multi(0)disk(0)rdisk(0)partition(1)\WINDOWS

this would even be easier ;):


ATTRIB -H -S -R C:\BOOT.INI
ECHO [Boot Loader]> C:\BOOT.INI
ECHO Timeout=0 >> C:\BOOT.INI
ECHO [Operating Systems]>> C:\BOOT.INI
ECHO Default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS>> C:\BOOT.INI
ECHO multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows XP Professional" /noexecute=optin /fastdetect>> C:\BOOT.INI
ATTRIB +H +S +R C:\BOOT.INI

(as said elsewhere, though "substituting" a string is the CORRECT way to go on, the QUICKER one is to rewrite from scratch the entire file, if it's a 5 liner...)

jaclaz

0

Share this post


Link to post
Share on other sites

Looks quiet promising :)

I have to urgently go abroad for a week or so, as soon as I get back I will join the party.

Regards,

ILKO

0

Share this post


Link to post
Share on other sites
Looks quiet promising :)

I have to urgently go abroad for a week or so, as soon as I get back I will join the party.

Regards,

ILKO

Wish you have a nice trip. Waiting for your back.

0

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.