Jump to content











Photo
- - - - -

grub4dos info


  • Please log in to reply
23 replies to this topic

#1 Mike69

Mike69

    Member

  • Members
  • 59 posts
  • Location:Hell

Posted 22 May 2007 - 08:46 AM

i believe the problem is with some mobos that "see" the pen as a usb fdd has some problems with grub mbr, and the mobos that "see" it as usb hdd boots fine.

but then i tried something diferent, ive formated the pen in ntfs with hp format tool, copy the grldr and grldr.mbr to the pen, and renamed those files to ntldr and ntldr.mbr...and it BOOTS!!!

and then...another problem...the pen boots but cant find menu.lst, because the built in menu of grub haves the --ignore-floppies option, and to solve that problem ive opend the ntldr file that i renamed with a hex editor and located the --ignore-floppie options and remove that...saved the fille and voillá.

all things work fine now.. :confused1: :confused1: :confused1: :confused1: :confused1: :confused1: :confused1:

btw theres some problem with the las version of grub4dos (21-04-2007)...i have a tool called goldmemory wich in use with that version starts the tests automaticaly (dont know the reason why, but with older versions it doesnt happens)

#2 was_jaclaz

was_jaclaz

    Finder

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

Posted 23 May 2007 - 03:40 PM

Mike69,
sorry to ruin (part) of your enthusiasm, but what you describe appears to be simply not possible.

First sector on drive/stick can be either:
1) a MBR

OR

2) a bootsector

the HP utility ALWAYS puts a MBR on first sector of USB device (unlike Windows built-in tools that, seeing the YSB stick as "Removable" will write NO MBR to it).

So the device will always be "HD like" if formatted through the HP utility, no matter what filesystem you used.

It is probable that you either used some other method to format the key (not overwritten by HP utility) or you have one of the "strange" motherboards like sangin reported here:
http://www.911cd.net...o...181&st=1880
that can boot NTFS and not FAT32.

It would be interesting if you could run Dimio's HDhacker:
http://dimio.altervista.org/eng/
and post a screenshot with First Sector of the Physical drive, so that one can be sure of the actual content of first sector (MBR or Bootsector), as the other your report about the --ignore-floppies could be due to the fact that the BIOS "somehow" thinks the stick is a floppy EVEN if it has a MBR.

Also, if you use grldr you DO NOT need grldr.mbr (whilst grldr is NEEDED if grld.mbr is installed on first sector as MBR).

jaclaz

#3 Mike69

Mike69

    Member

  • Members
  • 59 posts
  • Location:Hell

Posted 23 May 2007 - 04:31 PM

i could be wrong...but there are many motherboards that boot a pen drive and go to a:\ prompt (i assume this ones boot the pen as usb-fdd??!!) and others boot to c:\ prompt (usb-hdd maybe??) and with my method i can boot from all of them...

in fact i can tell you this...i handle a lot of mobos every day, and all of them boot with my pen!!! (except the ones that cant boot at all on a pen drive)


you may think im lying...but im not...really


and the pendoesnt boot without both grldr.mbr and grldr files renamed

#4 was_jaclaz

was_jaclaz

    Finder

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

Posted 23 May 2007 - 06:25 PM

you may think im lying...but im not...really


I am not at all saying that you are lying, I'm sure you mean well :confused1:, what I think is that you are unwantingly mis-representing the actual situation of your stick.

Since grldr.mbr (if INSTALLED as MBR) calls grldr (hardcoded) and grldr DOES NOT under ANY circumstance call grldr.mbr, what you report must miss something:
possibility #1:
grldr.mbr is installed (as it should) the file grldr.mbr IS NOT NEEDED, as it's contents are ALREADY written to the first sectors of the disk.
Since the call to grldr is hardcoded into it, it WON'T be able to call grldr renamed as NTLDR, and it will revert to previous MBR (unless some of the "control bytes" have been changed to alter this behaviour - check the section "grldr.mbr - Details about the control bytes" in README_GRUB4DOS.txt)

possibility #2
grldr.mbr is NOT installed.
Since it is NOT called by grldr (no matter whether the latter is named grldr or ntldr) grldr.mbr is again NOT NEEDED.

From the grub4dos readme README_GRUB4DOS.txt:

grldr.mbr contains code that can be used as Master Boot Record. The code is
responsible for searching all partitions for grldr and when found, loading it.
....
The second sector of GRLDR.MBR is called "previous MBR". When GRLDR not found,
"previous MBR" will be started.
....
Note: The bootstrap code of GRLDR.MBR only finds GRLDR file in the root dir of
a partition. You'd better place menu.lst file accompanying with GRLDR(i.e., in
the same root dir of the same partition as GRLDR).


jaclaz

#5 Mike69

Mike69

    Member

  • Members
  • 59 posts
  • Location:Hell

Posted 24 May 2007 - 08:22 AM

jaclaz...youre a though guy to convince. :confused1:

today im going to grab a brand new pen drive, and use the steps i describied!!

ill post here the results!!!

#6 was_jaclaz

was_jaclaz

    Finder

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

Posted 24 May 2007 - 09:56 AM

I don't think that refusing to accept an APODICTICAL statement without confrontation makes me "tough to convince" :confused1:, I am actually very open to new ideas and experiences :confused1:, even very improbable ones, but I still hang to the famous Sir Arthur Conan Doyle's quote:

“When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.”


However I do not want/need to be "convinced", we are not talking about "Acts of God", "Faith", "Black Magic" or "Miracles", we are talking about booting from USB by means of a determined procedure, this needs to have (at least) these requisites:
1) being documented
2) being repeatable (by other experimenters as well)
3) being based on a known (or newly discovered :confused1: ) principle, logical sequence of steps or however any other method, as long as they are not contrary to fundamental Laws of physics, mathematics and computer programming

This procedure can EITHER work OR not, there is no compromise on it.

And if it works, it works BECAUSE of something in MBR, bootsector or other file present on the stick.

What I am interested in is to understand WHY and HOW it works, to (hopefully) better, simplify or refine the procedure.

At the moment your method lacks ALL three requisites above, you repeating the (not clearly or completely documented) procedure on another pendrive might fill (partially) requisite #2, that's all.

Of course you are not obliged in the least to publish the first sector of your stick, but since you started this thread, I guess that the original scope was to share your findings :confused1:.

:confused1:

jaclaz

#7 Mike69

Mike69

    Member

  • Members
  • 59 posts
  • Location:Hell

Posted 24 May 2007 - 10:11 AM

And if it works, it works BECAUSE of something in MBR, bootsector or other file present on the stick.


i will not argue with that statment... because youre porbably right


What I am interested in is to understand WHY and HOW it works, to (hopefully) better, simplify or refine the procedure.


to be honest i dont know why or how it works...but it works for me

later in the day ill post the results and the first sector

#8 Mike69

Mike69

    Member

  • Members
  • 59 posts
  • Location:Hell

Posted 24 May 2007 - 10:38 AM

i could be wrong...but there are many motherboards that boot a pen drive and go to a:\ prompt (i assume this ones boot the pen as usb-fdd??!!) and others boot to c:\ prompt (usb-hdd maybe??) and with my method i can boot from all of them...


am i right in this statment?

#9 was_jaclaz

was_jaclaz

    Finder

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

Posted 24 May 2007 - 11:54 AM


i could be wrong...but there are many motherboards that boot a pen drive and go to a:\ prompt (i assume this ones boot the pen as usb-fdd??!!) and others boot to c:\ prompt (usb-hdd maybe??) and with my method i can boot from all of them...

am i right in this statment?


I am afraid not.

As said, the "HDD" device implies having a MBR as first sector, the "FDD" device implies having a bootsector as first sector.

A possible exception I know of is the makebootfat "special" bootsector that can "act" as BOTH MBR and bootsector, some reference is here:
http://www.boot-land...p?showtopic=761

It is of course possible that there are other sectors that can act as the above one, but I know of none.

jaclaz

#10 Mike69

Mike69

    Member

  • Members
  • 59 posts
  • Location:Hell

Posted 24 May 2007 - 12:02 PM

why some mobos boot to a:\ and others c:\ on the same pen?

#11 Mike69

Mike69

    Member

  • Members
  • 59 posts
  • Location:Hell

Posted 24 May 2007 - 12:59 PM

first sectors of pen

Posted Image
Posted Image
Posted Image
Posted Image
Posted Image
Posted Image
Posted Image

i used a brand new pen kingston dti/256
used the HP USB Disk Storage Format Tool 2.0.6
copy grldr and grldr.mbr to the pen
renamed to ntldr and ntldr.mbr
opend ntldr with xvi32 hex editor
locate and erased --ignore-floppies
saved
copy a random menu.lst (just to test)



already tryied it today on:

ASUS BAREBONE T2-PH2
ASUS P5VDC-MX
HP DV1673EA
HP A839.PT

in all of this hardware it boots fine, but i will test it a lot more

be cool

#12 was_jaclaz

was_jaclaz

    Finder

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

Posted 24 May 2007 - 03:11 PM

Ok, the first sector is just a "normal" NTFS bootsector. (NO MBR)
(made on a Portuguese XP)
on a Nx255x63 geometry media, with 503744 total sectors, that should be a 256 Mb stick with a number of "reserved" sectors or with a small unused space.

Since in the data there are 63 hidden sectors present, I have to ask you this:
Are you SURE that the first sector you posted is the First Sector of PHYSICAL drive and NOT the First Sector of LOGICAL drive (i.e. drive letter) ?

Can you please use the linked to app as suggested to either post the screenshot or attach the saved sectors?

Only first sector of PHYSICAL drive and first sector of LOGICAL drive are meaningful, no need for other sectors.

jaclaz

#13 Mike69

Mike69

    Member

  • Members
  • 59 posts
  • Location:Hell

Posted 24 May 2007 - 03:57 PM

Can you please use the linked to app as suggested to either post the screenshot or attach the saved sectors?



??? (what link?)


but i think youre right about the phisical or logical drive!
can you point me a good tool to view the sectors of the phisical drive?

#14 was_jaclaz

was_jaclaz

    Finder

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

Posted 24 May 2007 - 05:49 PM

??? (what link?)


The one in first reply post:
http://www.boot-land...?...c=2246&st=1

It would be interesting if you could run Dimio's HDhacker:
http://dimio.altervista.org/eng/
and post a screenshot with First Sector of the Physical drive, so that one can be sure of the actual content of first sector (MBR or Bootsector)


Even better if you attach the two saved sectors.

Any hex/disk editor should be capable of doing so, like Winhex (Commercial) or the freeware
tinyhex:
http://www.mirkes.de...are/tinyhex.php

Otherwise you can use hdhacker to save the sector as a file and then hexview the file with any "plain" hex editor/viewer.

jaclaz

#15 Mike69

Mike69

    Member

  • Members
  • 59 posts
  • Location:Hell

Posted 25 May 2007 - 08:24 AM

here it goes...

Attached Files

  • Attached File  boot.rar   1.02KB   435 downloads


#16 was_jaclaz

was_jaclaz

    Finder

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

Posted 25 May 2007 - 10:26 AM

Yep,
so, as expected, First Sector of Physical drive is a MBR, so far there is nothing "new", this is the normal behaviour of the HP utility, i.e. place a MBR on the stick with just one partition entry, active, covering the entire capacity, formatted with the chosen filesysten, FAT16, FAT32 or NTFS (the latter in this case).

First sector of Logical drive (partition) is the standard 2K/XP/2003 NTFS bootsector.


Let's however have a look at the MBR, at first look it appears to be "standard"
(the default one in English) beginning with 33C08E, it means that it is one that comes from "Windows":
http://www.boot-land...?...c=2220&st=3

more exactly, it is the version that comes with 2K/XP/2003, though it appears to have some slight modifications:
1) bytes 202, 203 and 204 are EB1A90 instead of B80102
2) bytes 437, 438 and 439 are 000000 instead of 2C4463
(the third difference, i.e. the presence of Disk Signature 69708B00 is "normal", it only means that the stick has been mounted/accessed under a 2K/XP/2003 OS)

The 2C4463 appears is an offset for "help messages", 2C4463 is the offset for English, reference is here:
http://thestarman.pc...br/Win2kmbr.htm

Much more interesting is the other modification, on the same page there is a disassembly that reads:
06CA B80102		MOV	 AX,0201	 &#59;|   INT 13,  Function 2
the code changed to EB1A90 means:
EB1A jmp E6

90 NOP

more in detail:

000000CA: EB1A						 jmps		0000000E6  --- (4)

000000CC: 90						   nop

000000CD: BB007C					   mov		 bx,07C00;"| "

000000D0: 8B4E02					   mov		 cx,[bp][02]

000000D3: 8B5600					   mov		 dx,[bp][00]

000000D6: CD13						 int		 013

000000D8: 7351						 jae		 00000012B  --- (5)

000000DA: 4F						   dec		 di

000000DB: 744E						 je		  00000012B  --- (6)

000000DD: 32E4						 xor		 ah,ah

000000DF: 8A5600					   mov		 dl,[bp][00]

000000E2: CD13						 int		 013

000000E4: EBE4						 jmps		0000000CA  --- (7)

000000E6: 8A5600					   mov		 dl,[bp][00]

000000E9: 60						   pusha

so with reference to the linked page, the code appears to jump unconditionally over a section of code:

06C1 7723 JA 06E6 ; Check for Extended INT 13.
06C3 7205 JB 06CA
06C5 394608 CMP [BP+08],AX
06C8 731C JNB 06E6 ; Check for Extended INT 13.

06CA B80102 MOV AX,0201 ;| INT 13, Function 2
06CA EB1A JMP 06E6 ;| SKIP UNCONDITIONALLY OVER code in RED below:
06CC 90 NOP
06CD BB007C MOV BX,7C00 ;| (ES):BX = Memory Buffer
06D0 8B4E02 MOV CX,[BP+02] ;|
06D3 8B5600 MOV DX,[BP+00] ;|
06D6 CD13 INT 13 ;| "Read 1 Sector into Memory"

06D8 7351 JNB 072B
06DA 4F DEC DI
06DB 744E JZ 072B
06DD 32E4 XOR AH,AH ;| INT 13, Function 0
06DF 8A5600 MOV DL,[BP+00] ;| DL=Drive Number
06E2 CD13 INT 13 ;| "Reset DISK System"

06E4 EBE4 JMP 06CA



; The following are the "INT 13 Extensions Installation Check" and
; the Extended READ sectors from Hard Drive (Function 42h) routines.

06E6 8A5600 MOV DL,[BP+00] ;| DL = Drive Number.


If you look at the last few lines before the modified code, you will see that they contain CONDITIONAL jumps, that only if INT13 Extensions are found, will jump to E6 (GREEN code).

Most probably this is done to workaround "defective" BIOSes that do not correctly give information about INT13 Extensions on the USB bus.

This has of course NOTHING to do with the drive being seen as A:\ or C:\, the stick thus formatted has a MBR and therefore, at least from the MBR and bootsector side, it will appear as C:\, besides the bootsector has on offset 21 the "F8" media descriptor, that corresponds to "Hard drive".

Nor it has ANYTHING to do with the reported grldr/grldr.mbr thingie.

BUT it is a GREAT find!
:confused1:

This finally explains WHY the "HP" utility appears to boot from a larger number of systems!

It simply skips over a (probably unneeded on modern motherboards, read motherboards with USB boot capability) check that can possibly be a cause of error with some "bad" BIOSes. (Int13h extensions, read LBA addressing) have been implemented at least since 1995, as Windows 95 First edition came with the new 0E and 0F "LBA addressed" partitition types:
http://en.wikipedia.org/wiki/INT_13
http://www.linux.com...k-HOWTO-4.shtml
http://oldfiles.org....ad/tmeline2.htm
http://www.win.tue.n...on_types-1.html
I had looked, say, several tens of times to the MBR produced by the HP utility, but since it is (except from those few bytes) identical to the standard 2K/XP/2003 MBR I always assumed (wrongly) that it was the same one.

I have no idea, nor enough Assembly knowledge, to understand why:
1) the 2C4463 has been "zeroed" out, the only effect should be that in case of a booting error no message is shown on the screen
2) why the unconditional jump has been placed AFTER two conditional ones, logic should call for placing the unconditional one BEFORE them
Maybe some member with more knowledge in this field can share some light on the above.

Anyway, a large part of the mistery has nonetheless being solved, and I am very happy about it, thanks to Mike69 for making me have this closer look at it! :confused1:

jaclaz

P.S.: @Mike69 Now we can go on, can you simply try deleting the grldr.mbr/ntldr.mbr from the stick and see if it stops booting?

#17 Mike69

Mike69

    Member

  • Members
  • 59 posts
  • Location:Hell

Posted 25 May 2007 - 10:57 AM

lol...i got to say...i didnt understant a lot of your post jaclaz, i simply dont have that kind of knowledge (you must think im stupid or something...lol)

as you said the pen boots without the ntldr.mbr file...(i could swear it didnt boot before)

my goal in this topic was simply to share how to bypass the "disk error" issue
because i used bootlace and grubinst in my pen and it didnt work on some motherboads, but it was always on fat / fat32 fs
and then i tryed ntfs and it shows the ntldr is missing error, and then i remeberd to read somwhere to rename grldr to ntldr and a tryed it!! could you ask the person who builds grub4dos to make an option to remove the --ignore-floppies option and build a tool based on the hp format utility to install grub mbr?

you still havent answered me about why some mobos on a fat pen boot to a:\ and others to c:\

be cool

#18 was_jaclaz

was_jaclaz

    Finder

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

Posted 25 May 2007 - 11:49 AM

you still havent answered me about why some mobos on a fat pen boot to a:\ and others to c:\


Well, rather obviously, if the SAME pen, with the SAME boot files and SAME OS on it, behaves DIFFERENTLY on different systems, the difference must be in the system (read BIOS) or in the settings in the BIOS.

I guess nothing (except maybe a BIOS update for the manufacturer) can be done to change this behaviour.

However, I have NEVER seen a BIOS set to boot from USB "HDD" to load a stick with a proper MBR (like the one you are now using) on it to recognize the active partition as "floppy", "superfloppy" or however have the booted OS assign to it the a:\ letter, but of course there might be some.

Now, just for the fun of it, can you try replacing the grldr (renamed NTLDR) on the stick with a standard one (i.e. one that has NOT the --ignore-floppies hexedited out) and see if it stops booting or finding the "dummy" menu.lst?

If some later releases of Grub4dos give you problems, try reverting to an earlier version.

jaclaz

#19 Mike69

Mike69

    Member

  • Members
  • 59 posts
  • Location:Hell

Posted 25 May 2007 - 12:39 PM

i changed to the original one and it boots on all motherboards...but wont find menu.lst on all of them.

examples:

1 - wont find menu.lst
asus p4p800-e deluxe
asus t2-ph2

2 - find menu.lst
asus p5b
all hp notebooks dv1000,dv4000,5000,dv6000,dv8000,dv9000 series

if i use bootlace or grubinst to install grub mbr, group 2 will boot fine but not group 1 (disk error)
if i use fat it boots from all groups - group1: a:\ group2: c:\
if i use hp format utility and ntfs with grub files it boots from both groups but wont find menu.lst in group1
if i edit grldr and remove the --ignore-floppies it boots from both groups


ps.i want to make a folder to insert bios upgrades files and how can i use grub to boot and give a command line prompt to do it? (we already talked about this in pm´s)

#20 was_jaclaz

was_jaclaz

    Finder

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

Posted 26 May 2007 - 12:17 PM

A question, when you say:

if i use fat it boots from all groups - group1: a:\ group2: c:\


You mean DOS booted through Grub4dos, don't you?
If yes, can you post the relevant menu.lst entry?

Anyway I'll have a couple nights sleep on these results and see what I can find. :confused1:

jaclaz

P.S. The thread related to BIOS upgrading has been splitted and is here:
http://www.boot-land...?showtopic=2265

#21 Mike69

Mike69

    Member

  • Members
  • 59 posts
  • Location:Hell

Posted 23 July 2007 - 09:33 AM

hi,


sorry for the late reply...

i mean a standart usb pen drive formatted with hp utility

#22 sfinktah

sfinktah

    Frequent Member

  • Advanced user
  • 217 posts
  • Location:Der Äther
  • Interests:/(C(++|#)|P(HP|XE)|(OS|Linu)X|8051)/
  •  
    Australia

Posted 18 November 2011 - 02:44 PM

*yawn* dead thread, but i landed here from another dead thread while investigating MOA.

it's bios related. i have an ASUS P6T in my collection, and you can specify what kind of device to present your USB mass storage as. One option is "AUTO" which (according to some site I knicked this from):


For example, ASUS P5GDC-V BIOS in Auto mode maps 0-512Mb USB disks to A: and 512+ Mb disks to C:.


ASUS P6T BIOS in Auto mode maps 0-1024Mb USB disks to A: and 1024+ Mb disks to C:.


I expect problems of this nature don't occur these days, NOT due to changes in BIOS (my board is only 2 years old), BUT because USB mass storage devices are much larger, and thus never trigger the BIOS to perhaps treat it as a floppy.

Personally, I think it's a pretty cool feature, and when I finally found a USB stick that was small enough to qualify as "Floppy" i was overjoyed to copy PLOP onto it and have my bios believe it was A:.

SIde note: that text about the ASUS was sourced from FlashBoot - which claims to solve all these problems .. not by clever MBR patches, but by dealing with them in the loading process. http://www.prime-exp...y_flashboot.php

Never tried it myself, too many usb boot tools, too little time. i'll take pxe anyday.

#23 steve6375

steve6375

    Platinum Member

  • Developer
  • 4,956 posts
  • Location:UK
  • Interests:computers (!), programming (masm,vb6,C,vbs), OSes, photography,TV,films,guitars
  •  
    United Kingdom

Posted 18 November 2011 - 02:57 PM

Using grub4dos you can boot as an external USB HDD but then map the USB HDD as Floppy. If grub4dos is then used to run DOS (MS-DOS, FreeDOS etc.) then DOS will think it is running from a floppy disk and the 1st hard disk will be the real internal HDD.
It is easier to force BIOSes to boot as HDD (using large USB Flash drives + 2 partitions on the USB drive) than it is to try to get the BIOS to boot a USB Flash drive as a floppy.

#24 sfinktah

sfinktah

    Frequent Member

  • Advanced user
  • 217 posts
  • Location:Der Äther
  • Interests:/(C(++|#)|P(HP|XE)|(OS|Linu)X|8051)/
  •  
    Australia

Posted 27 November 2011 - 03:07 PM

The rather specific reason I was interested in the USB-Floppy option, was that I was juggling a GPT partitioned 3TB disk, with dual-boot Windows 7 (UEFI) and Mac OS X (Chameleon).

Being able to put my own bootloader on a USB-FDD, would have ensured priority loading. Not to mention that installing *any* bootloader onto a GPT drive is pushing the limits of any bootloader.

Also, on my ASUS motherboard, the boot order can get very random if you select a USB-HDD device as your boot drive. Again, having a specific USB device nominally operating as a floppy, would guarantee it's precedence (if attached), and ignore it otherwise.

The other reason is attempting the (seemingly impossible) quest, to do an iSCSI install of Windows 7, which involves booting from gPXE and then having it fail and turn to the DVD drive to continue booting. I don't believe that's something that grldr can do.

Edited by sfinktah, 27 November 2011 - 03:09 PM.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users