Its on Technet
http://download.micr...ec_10_18_06.doc
Posted 30 March 2015 - 01:19 PM
Thanks, Wonko, but, unfortunately, most of what you're saying I already know for years .
Thanks my sock!
WHY then you asked for it?
Does anybody know where I can find info about vhds internal structure? I'm talking about both vhd types: dynamically allocated and fixed size.
You would have already known that the fixed has a footer (and not a header) and that it was a RAW image, and that there was no need whatsoever for knowing it's format, since there is none, and certainly no need to add support for it in grubinst as fixed vhd's are ALREADY supported in it, or, to be more exact, as supported as RAW images.
Anyway, no prob , I should know better than going around and try to help people.
Wonko
Posted 31 March 2015 - 01:14 PM
Steve, I have been thinking at your idea to store the removable bit status (on/off) in the Grub4Dos MBR/PBR.
Chenall and Yaya have said nothing when you asked them. So it seems they're not so happy about it.
But I found a way for you to make a custom grubinst.exe by just commenting/uncommenting a line of code in grubinst.c:
Not implemented:
#ifdef WIN32
//#define STORE_RMB_STATUS 1
#endif
Implemented:
#ifdef WIN32
#define STORE_RMB_STATUS 1
#endif
The rest of the code checks for this STORE_RMB_STATUS (defined or not).
For now I implemented in the "code byte" of the Grub4Dos MBR. But if we find a good location in PBR, I can implement for this too.
grubinst exe.7z 47.33KB 570 downloads
grubinst.c.7z 11.86KB
451 downloads
Here is a Grub4Dos script showing how you can check the value from the "code byte":
!BAT clear dd if=(hd0) of=(md)0x19000+1 > nul set G4DVER=0.4.5c > nul cat --hex --number=1 --locate="Missing MBR-help" (md)0x19000+1 | set TXTPOS= if "%TXTPOS%"=="" && set G4DVER=0.4.6a && cat --hex --number=1 --locate="Missing helper." (md)0x19000+1 | set TXTPOS= if "%TXTPOS%"=="" goto nogrub echo Grub4Dos %G4DVER% MBR found if "%G4DVER%"=="0.4.6a" goto 046a #0.4.5c cat --hex --length=5 (md)0x19000+1 | set HDR= if "%HDR:~10,8%"=="33 C0 EB" goto enhver #normal version cat --hex --skip=0x2 --length=1 (md)0x19000+1 | set CTRLB= set /a CTRLBN=0x%CTRLB:~10,2% > nul set /a ISON=%CTRLBN% & 16 > nul if not "%ISON%"=="0" && echo The disk is removable && goto end set /a ISOFF=%CTRLBN% & 32 > nul if not "%ISOFF%"=="0" && echo The disk is fixed && goto end echo Removable bit status not stored in Grub4Dos MBR! goto end :enhver #enhanced version cat --hex --skip=0x4 --length=1 (md)0x19000+1 | set CTRLB= set /a CTRLBN=0x%CTRLB:~10,2% > nul set /a ISON=%CTRLBN% & 16 > nul if not "%ISON%"=="0" && echo The disk is removable && goto end set /a ISOFF=%CTRLBN% & 32 > nul if not "%ISOFF%"=="0" && echo The disk is fixed && goto end echo Removable bit status not stored in Grub4Dos MBR! goto end :046a cat --hex --skip=0x5A --length=1 (md)0x19000+1 | set CTRLB= set /a CTRLBN=0x%CTRLB:~10,2% > nul set /a ISON=%CTRLBN% & 16 > nul if not "%ISON%"=="0" && echo The disk is removable && goto end set /a ISOFF=%CTRLBN% & 32 > nul if not "%ISOFF%"=="0" && echo The disk is fixed && goto end echo Removable bit status not stored in Grub4Dos MBR! goto end :nogrub echo Grub4Dos MBR not found! && pause --wait=10 :end
Posted 31 March 2015 - 04:08 PM
Thanks for that.
It would be better if you could just auto-detect whether the drive is Removable or not in grubinst (or GUI?) and update the bit accordingly.
Maybe you could also check for the Hitachi/cfadisk/microdriver installed too?
0 = unknown (cfadisk type driver installed)
16 = RMB=1
32 = RMB=0
There could be a listbox in the GUI so that if a driver was install = (unknown) the user could change it to either Removable or Fixed manually.
In VB6 I use this to get the RMB bit...
With SCSIPass.Spt .Length = Len(SCSIPass.Spt) + 3 .PathId = 0 .TargetId = 1 .Lun = 0 .CdbLength = SCSI_PASS_THROUGH_CDBLENGTH.CDB6GENERIC_LENGTH .SenseInfoLength = 24 .DataIn = SCSI_PASS_THROUGH_DATAIN.SCSI_IOCTL_DATA_IN .DataTransferLength = 192 .TimeOutValue = 2 .DataBufferOffset = Len(SCSIPass.Spt) + 35 .SenseInfoOffset = Len(SCSIPass.Spt) + 3 .Cdb(0) = SCSI_PASS_THROUGH_OPERATION.SCSIOP_INQUIRY .Cdb(1) = &H8 .Cdb(2) = &H0 .Cdb(4) = .DataTransferLength End With TmpLen = 0 retval = DeviceIoControl(GHandle, IOCTL_SCSI_PASS_THROUGH, SCSIPass, Len(SCSIPass), SCSIPass, Len(SCSIPass), TmpLen, ByVal 0&) If TmpLen > 0 Then With SCSIPass t = Trim(GetSTRbyBuff(.DataBuf, 8, 15, True) & " " & GetSTRbyBuff(.DataBuf, 16, 31, True)) DRV_MODEL = t DRV_FIRMWARE = GetSTRbyBuff(.DataBuf, 32, 35, True) If (.DataBuf(1) And &H80) = 128 Then t = "REMOVABLE MEDIA" Else t = "FIXED MEDIA" D_MEDIATYPE = t End With End If Call CloseHandle(GHandle)
Posted 31 March 2015 - 04:47 PM
Thanks for that.
It would be better if you could just auto-detect whether the drive is Removable or not in grubinst (or GUI?) and update the bit accordingly.
Have you checked "grubinst --help" to see the latest switch I added?
Posted 31 March 2015 - 05:35 PM
I just looked at the code - it already does it automagically
Does it work for linux and Windows?
I could use the new version in RMPrepUSB and Make_E2B script.
I will check it out and report back...
thanks!
Posted 31 March 2015 - 06:20 PM
Just in Windows for now.
Posted 31 March 2015 - 06:30 PM
I used the GUI and added --rmb-status=auto it seems to work for USB HDD and USB Removable drives :-)
A few points, if I may...
Posted 31 March 2015 - 07:03 PM
1. Ok, I'll try to implement.
2. If the GUI doesn't find the latest 0.4.5c/0.4.6a MBR/PBR versions, it calls them "obsolete".
But, if you're sure you have the latest version, please send me that MBR/PBR so I can check.
3. I don't know, the idea was to modify grubinst in such way so you could compile a RMB version. I will release the official version without the RMB (//#define STORE_RMB_STATUS 1); you will uncomment it (#define STORE_RMB_STATUS 1) and recompile the sources in Mingw (as you described in tutorial).
This way you and the RMPrepUSB/Easy2Boot users will be happy for using that version in RMPrepUSB and Make_E2B script but also Chenall and Yaya will be happy too for keeping the code byte entries free in the official version.
Btw, I removed the "silent boot" code byte entry for some time too. Without the Chenall/Yaya support was useless anyway...
I just kept the usual option.
4. See 3.
5. Why would they wanna hide it?
Posted 31 March 2015 - 07:10 PM
2. I mean just the disk filesystem
Didn't they say to go ahead and create a fork?
I don't see what harm two extra bits can have?
If they do continue to develop grubinst then they will use your sources and so the bits will already be reserved. Otherwise they would be creating a non-compatible fork.
Why not make --rmb-status=auto the default? They did actually not object did they?
having two binaries (one with the feature and one without) will create confusion.
Hopefully your new version will be the new 'standard' version soon
Posted 31 March 2015 - 07:27 PM
re. #5 for instance, under a VM a Removable-type USB flash will actually be working as a fixed-disk - maybe someone wants to configure the grub4dos table so that it reads as (unknown) or maybe they don't want either bit set or maybe the user knows he has a filter driver installed but doesn't know what type of disk they have and so they want to set it as unknown. It is just an option to cover all bases and be able to set any of the 3 states really.
P.S. 0.4.6a has a silent flag now
0x2073 BYTE 0=silent, 2=normal
why did you remove it?
Edited by steve6375, 31 March 2015 - 07:29 PM.
Posted 31 March 2015 - 07:46 PM
2. That's not suppose to be there. Do you have the latest version of the GUI and the language files?
Is it always displayed? Is the only choice? If you move "grubinst_gui.eng" in another folder and restart the GUI, is it still displayed?
3. For a while I will develop them as separate versions. But if the RMB version will be liked more then I'll switch to it.
5. That's a little weird, the user knows half, he doesn't investigate so he would know all but instead sets to undefined/unknown.
Even so, the on/off manual switches should be enough for most of these rare situations.
In a VM where the disk is always "fixed", they could set "off".
Yes, 0.4.6a has a silent patch, but there is no link between the silent boot switch from MBR and the patch from grldr. In other words, grldr doesn't know how to check the silent boot option from the MBR code byte.
Posted 31 March 2015 - 08:08 PM
Doesn't the code load grldr?
Can't it patch the memory location after loading it?
I will check about the filesystem issue (may be a win8.1 x64 issue?)
Posted 31 March 2015 - 08:25 PM
Doesn't the code load grldr?
Can't it patch the memory location after loading it?
In normal programming is easy to do this but not in assembler in a boot record.
Also you have to be careful to not brake the other functions + to still fit into 8/9 KB.
For this an asm expert is needed. I'm not
Posted 31 March 2015 - 08:32 PM
I'll take a look when I get time, patching should be easy, checking it is the correct version to patch might be a bit more tricky!
Posted 01 April 2015 - 04:43 AM
I tested in Windows 8.1, no problems with grubinst_gui.
I checked and, for Regional Options >> Standard and formats >> English (United Kingdom), grubinst_gui.eng is indeed automatically loaded.
Most likely its version is different from grubinst_gui.exe's version.
The latest versions: grubinst_gui exe and lngs.7z 67.57KB 613 downloads
Anyway I added grubinst_gui.eng only for testing, because obviously is not needed (the interface is already in english).
Also I have modified grubinst.exe to display the state of the removable bit when "verbose" and "--rmb-status=auto" are used.
grubinst.7z 47.4KB 515 downloads
In the current implementation, you can get the undefined/unknown state by simply not using the"--rmb-status=" switch.
Posted 01 April 2015 - 09:31 AM
No problem with filesystem now with those versions. Thanks.
Posted 01 April 2015 - 12:35 PM
What the github URL where I can pull latest grubinst sources from so I can test mods to grldrstart.S pls?
Posted 01 April 2015 - 01:03 PM
I haven't created a github project yet.
You can use this sources:
grubinst Windows latest sources.7z 168.09KB 506 downloads
Posted 01 April 2015 - 06:44 PM
hmmm - it seems the NTFS code is really tight on space!
Just adding in 4 or 5 instructions and it breaks it by making it too long!
I think I will have to pass on this!
Each code section will need modifying (for FAT, ext, exFAT, NTFS) and it's a real pain!
Sorry!
Posted 03 April 2015 - 08:24 AM
grubinst Windows binaries.7z 82.25KB 2374 downloads
Grubinst Linux binaries.7z 1.04MB 680 downloads
grubinst_gui languages.7z 2.24KB 779 downloads
grubinst sources.7z 228.44KB 692 downloads
Changed a bit the way the chosen filesystem is passed to grubinst. For example, if you choose "MBR" instead of "AutoDetect" and select a partition instead of "Whole disk (MBR)", the command line switch specifying the filesystem type won't be "--file-system-type=MBR" but "--file-system-type=partition's_filesystem".
Also, in the Linux version, a rare interface bug was solved.
Posted 03 April 2015 - 09:35 AM
And a notice: 5 years ago I was diagnosed with Parkinson disease.
The medication helped me to continue my work here. But, lately, even this is not enough.
This is half of the reason a few months ago I tried to disable my account here.
My (real) name is not DavidB and I'm not from Norway. It's just a random name/country I picked up so I can made an account, like I have on many other forums.
Why I (usually) hide my real name/nationality:
1. I don't trust the internet.
2. My country (Romania) is not so well "seen" by other countries (unfairly).
Now I will log out and never come back.
I have to do it so I can have some peace in my last few years.
Good bye, everybody. And thank you.
Hope to see you all in the other life.
Cosmin
Posted 13 April 2015 - 08:23 AM
I think of you every day.
Thank you for the contribution you have made to the world.
Best wishes
Steve
Posted 13 April 2015 - 09:06 AM
humm.. once more who be once of the best in the world where go passed ..
...no words...
i hope you time where you have now, it's once of the best..
and i say also thank you Cosmin !
thank in all honor !
best regards
Blacky
0 members, 0 guests, 0 anonymous users