Re: GRUB and ntldr
Thomas Schweikle wrote: AFAIK does the MBR load the first active primary partition boot block (an other 512 Bytes). Yes. This loads parts of ntldr. I suspect the 1st block, but I'm not sure. Then jumps to a place within ntldr (ntldr is not started at position 0x0 in the file). Seems odd, but might be true. Why do you think so? Should be easy to find out the address. 'dd' the first 512 bytes from hda1 (whatever) into a file, name that file 'xxx.com' and load it into IDA Pro. Look at the code, I'm sure that there's a CALL or something similar at the end that jumps to the NTLDR code. (IDA Pro is available as freeware and trial versions, it runs under Wine.) It would be nice enough if one could tell us exactly how MBR, partition boot sector and ntldr interact and work, then what is required to make ntldr find boot.ini. I'll go ahead and suggest how you can find out. First: $ dd if=/dev/zero of=blank_disk.img bs=1M count=100 $ losetup /dev/loop0 blank_disk.img Then, 1. Boot bochs with the above image as a harddrive image and the Windows 2000/XP cdrom to boot from. 2. Create a blank NTFS partition with the setup program. 3. Reboot. 4. Start the Recovery Console 5. Expand NTDETECT.COM, NTLDR, WINDOWS\system32\ntoskrnl.exe and WINDOWS\system32\hal.dll onto C:, or copy them from another partition which you attach to bochs. 6. Make sure there's a boot.ini, either by copying it from somewhere or by using the Recovery Console's boot.ini generator (type HELP for info on that). 7. Type FIXBOOT (or FIXBOOT C:). 8. Type FIXMBR (or FIXMBR \\Device\HardDrive0\Partition0). 9. Type EXIT Then boot bochs in debugging mode. You can use GFE as a graphical frontend for the bochs debugger. You should be able to follow the boot process in action. You'll probably be specifically interested in looking for 'int 13' calls. Look for the value in the AH register as int 13 is about to be called - that value denotes the function which it's calling. Most likely one of 'get geometry', 'load chs sector', 'load lba sector' or something similar. Can't remember them all, but you can look them up in Ralf Brown's interrupt guide. ___ Bug-grub mailing list Bug-grub@gnu.org http://lists.gnu.org/mailman/listinfo/bug-grub
Re: GRUB and ntldr
Yedidyah Bar-David schrieb: On Thu, Nov 10, 2005 at 05:26:24PM +0100, Thomas Schweikle wrote: [...] You can simply install windows on 3 primary partitions, each of them bootable, and choose one of them with grub. This should give you around 30 versions of windows, 1 of which (3 with some grub tricks) can be 9x. Yes, but for various reasons it would be more nice, if I just could patch ntldr, leaving the rest up to GRUB. --- Using GRUB makes it possible to have more than 30 Windows Versions on one machine, since we are only testing German, English and Chinese at the moment. Assume French, Japanese, Korean, Hindi, Spain, ... I do find this interesting though, so if someone manages to boot ntldr from grub, please tell us. It would be nice enough if one could tell us exactly how MBR, partition boot sector and ntldr interact and work, then what is required to make ntldr find boot.ini. AFAIK does the MBR load the first active primary partition boot block (an other 512 Bytes). This loads parts of ntldr. Then jumps to a place within ntldr (ntldr is not started at position 0x0 in the file). Where exactly GRUB would have to jump in into ntldr I do not know, as I do not know where this information is placed in ntldr. Any helpful documentation I'd appreciate! -- Thomas signature.asc Description: OpenPGP digital signature ___ Bug-grub mailing list Bug-grub@gnu.org http://lists.gnu.org/mailman/listinfo/bug-grub
Re: GRUB and ntldr
adrian15 schrieb: title Windows root (hd0,0) chainloader (hd0,0)/ntldr boot supposing that the ntldr is called like that. This doesn't work, since ntldr isn't a supported binary type. GRUB refuses to load it this way. A) Tell me if that works for you I'm interested also in loading ntldr manually. The response to your question is in the manual: http://www.gnu.org/software/grub/manual/html_node/chainloader.html#chainloa der Load file as a chain-loader. file can be (hd0,0)+1 as usual or it can be a file as in a linux system. And now that I am reading the documentation you might need probably the -- force option. title Windows root (hd0,0) chainloader --force (hd0,0)/ntldr boot Upps! An option I overlooked. I've tried it, but with no success. Forcing ntldr to load just prints four characters on screen, but doesn't start ntldr as expected. There are two possibilities: ntldr has to reside a a certain place in memory, or there is a displacement the correct start adress is loacated at ... A) I repeat again, tell me how does it work for you. Partly: I can force it now to load, but this does not make it run :-( Another ntldr must be in a partition that Grub can read... that's FAT32 mainly,... if you want to use ntldr in NTFS you might need a Grub called Grub Win32 or similar with ntfs support. Check these links: http://www.geocities.com/lode_leroy/grubinstall/ (This is the useful one) http://grub4dos.sourceforge.net/ (This is just for curiosity) B) Another question. Why are you interested in loading ntldr manually? I am interested, since I have to set up a test machine equiped with various versions of Windows 98, Windows 2000, Windows XP, Windows 2000 Server, Windows 2003, Linux in some flawers and last FreeBSD. Linux isn't a problem, as isn't FreeBSD. But Windows ntldr just doesn't allow for more than 10 selectable items while booting and there are 27 Windows versions (German, English, Chinese), with different Service packs applied to boot. -- Thomas ___ Bug-grub mailing list Bug-grub@gnu.org http://lists.gnu.org/mailman/listinfo/bug-grub
Re: GRUB and ntldr
On Thu, Nov 10, 2005 at 05:26:24PM +0100, Thomas Schweikle wrote: I am interested, since I have to set up a test machine equiped with various versions of Windows 98, Windows 2000, Windows XP, Windows 2000 Server, Windows 2003, Linux in some flawers and last FreeBSD. Linux isn't a problem, as isn't FreeBSD. But Windows ntldr just doesn't allow for more than 10 selectable items while booting and there are 27 Windows versions (German, English, Chinese), with different Service packs applied to boot. You can simply install windows on 3 primary partitions, each of them bootable, and choose one of them with grub. This should give you around 30 versions of windows, 1 of which (3 with some grub tricks) can be 9x. I do find this interesting though, so if someone manages to boot ntldr from grub, please tell us. -- Didi ___ Bug-grub mailing list Bug-grub@gnu.org http://lists.gnu.org/mailman/listinfo/bug-grub
Re: GRUB and ntldr
Thomas Schweikle wrote: adrian15 schrieb: title Windows root (hd0,0) chainloader (hd0,0)/ntldr (No need for hd0,0 since that's root) boot This doesn't work, since ntldr isn't a supported binary type. GRUB refuses to load it this way. But it will happily load a boot sector using block list notation? Doesn't sound right. B) Another question. Why are you interested in loading ntldr manually? Here's another reason why it would be pretty cool. It often happens that Windows 2000/XP fails to boot, showing just a blank screen. I've seen it happen when: - Installing on a large (eg. 50 GB) NTFS volume with lots of data on it already. - Moving a disk from one system to another, where the moved-to system uses a different LBA-CHS translation scheme. I'm unsure whether it's the volume boot sector or NTLDR that hangs, but if Grub could load NTLDR, I guess I'd have an answer to that question pretty soon ;-). I think I've read somewhere that the volume boot sector only loads 1 sector of NTLDR, after which NTLDR loads the rest of itself, maybe using CHS calls. Would be pretty cool to be able to skip that step and just use Grub to LBA load NTLDR to the right place in memory and call whatever location that's supposed to be run when it's all loaded. ___ Bug-grub mailing list Bug-grub@gnu.org http://lists.gnu.org/mailman/listinfo/bug-grub
Re: GRUB and ntldr
Hi! Any way available to directly load ntldr? I need something to get this thing into RAM and then execute it. Any idea not using an windows mbr (and thus chainloading ntldr). I need a direct way. I will try with something similar to this: title Windows root (hd0,0) chainloader (hd0,0)/ntldr boot supposing that the ntldr is called like that. A) Tell me if that works for you I'm interested also in loading ntldr manually. The response to your question is in the manual: http://www.gnu.org/software/grub/manual/html_node/chainloader.html#chainloa der Load file as a chain-loader. file can be (hd0,0)+1 as usual or it can be a file as in a linux system. And now that I am reading the documentation you might need probably the -- force option. title Windows root (hd0,0) chainloader --force (hd0,0)/ntldr boot A) I repeat again, tell me how does it work for you. Another ntldr must be in a partition that Grub can read... that's FAT32 mainly,... if you want to use ntldr in NTFS you might need a Grub called Grub Win32 or similar with ntfs support. Check these links: http://www.geocities.com/lode_leroy/grubinstall/ (This is the useful one) http://grub4dos.sourceforge.net/ (This is just for curiosity) B) Another question. Why are you interested in loading ntldr manually? See you, adrian15 ___ Bug-grub mailing list Bug-grub@gnu.org http://lists.gnu.org/mailman/listinfo/bug-grub
GRUB and ntldr
Hi! Any way available to directly load ntldr? I need something to get this thing into RAM and then execute it. Any idea not using an windows mbr (and thus chainloading ntldr). I need a direct way. Something like: title Windows root (hd0,0) kernel /ntldr boot or title Windows root (hd0,0) kernel /somethingToStartNtldr /ntldr boot or even some better idea using only grub! -- Thomas ___ Bug-grub mailing list Bug-grub@gnu.org http://lists.gnu.org/mailman/listinfo/bug-grub