Jump to content











Photo
* * * * - 2 votes

Grub4dos Guide/Tutorial


  • Please log in to reply
129 replies to this topic

#26 diddy

diddy

    Member

  • Tutorial Writer
  • 78 posts

Posted 19 February 2009 - 10:58 PM

Guide updated to version 1.2 (Grub4dos 0.4.4-2009-02-05).

Since downloading build 0.4.4-2009-02-05 two weeks ago there have been 8 new builds - great news for anyone not trying to maintain an up to date guide :poke: .

I will try to keep the guide updated on a monthly basis but can't keep up with tinybit et al.

The .chm version has been temporarily removed - not sure when it will be updated due to lack of free time.

diddy

#27 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 21 February 2009 - 05:45 AM

Menu colours can be set using the following command (default is white text on a black background, with current option being black text within a white highlight) -

color a/b c/d
Where a=text, b=background, c=selected option text, d=selected option highlight

Colours b and d must be one of the following - black, blue, green, cyan, red, magenta, brown, light-gray

Colours a and c must be one of the following - black, blue, green, cyan, red, magenta, brown, light-gray, dark-gray, light-blue, light-green, light-cyan, light-red, light-magenta, yellow and white.

The new color command:
color NORMAL [HIGHLIGHT] [HELPTEXT [HEADING]]]
color fg/bg fg/bg fg/bg fg/bg
All colors can be used as foreground and background color now: black, blue, green, cyan, red, magenta, brown, light-gray, dark-gray, light-blue, light-green, light-cyan, light-red, light-magenta, yellow and white.

#28 mr_

mr_

    Frequent Member

  • Members
  • 355 posts
  •  
    Germany

Posted 21 March 2009 - 06:54 PM

In appendix commands I am missing:
- bootlace.com
- grubinst.exe
- grbins16.exe
- hmload.com

What are the commands install and setup currently doing? Installing the grub legacy way?

#29 Uofis

Uofis
  • Members
  • 1 posts
  •  
    Netherlands Antilles

Posted 21 March 2009 - 10:33 PM

Great Tut.. thx..

Helped already experimenting the .iso booting .. greetZ

#30 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 22 March 2009 - 12:01 PM

In appendix commands I am missing:
- bootlace.com
- grubinst.exe
- grbins16.exe
- hmload.com

What are the commands install and setup currently doing? Installing the grub legacy way?

You are not "missing" them, the appendix is about grub4dos commands.

The files you listed are not grub4dos commands, they are "external utilities".

The use of grubinst/bootlace/grbins16 is in the install chapter:
http://diddy.boot-la...les/install.htm
http://diddy.boot-la...ll.htm#method08
http://diddy.boot-la...ll.htm#method09
http://diddy.boot-la...ll.htm#method13

Advanced info is in the README_GRUB4DOS.txt file.

As well in this last file there are details on the use of hmload.com and a link to the developer's page:
http://sysdocs.stu.q...ent/GrubForDOS/

jaclaz

#31 mr_

mr_

    Frequent Member

  • Members
  • 355 posts
  •  
    Germany

Posted 26 March 2009 - 01:39 PM

I am pleased to see instructions for creating the triple MBR (3x2), related topic, http://www.boot-land...?showtopic=7507.

You are not "missing" them, the appendix is about grub4dos commands.

The files you listed are not grub4dos commands, they are "external utilities".

Indeed, well I was seeing all this more as a package..

Still I would appreciate putting the syntax also for the external utilities also into the guide, in meanwhile I posted them into the grub4dos wiki.

As well in this last file there are details on the use of hmload.com and a link to the developer's page:
http://sysdocs.stu.q...ent/GrubForDOS/

On this site I don't find the word 'hmload'.

#32 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 26 March 2009 - 10:58 PM

On this site I don't find the word 'hmload'.


Sure ^_^, there isn't any. ^_^

For unknown reasons the program by John Cobb was renamed/changed into xsel (or viceversa :good:), compare the grub4dos readme.txt with the site:

******************************************************************************
*** About the DOS utility `hmload' ***
******************************************************************************

This program was written by John Cobb (Queen Mary, University of London).

John Cobb's note:

To make use of the ram drive feature I wrote a program `hmload' to load
an arbitrary file to an arbitrary address in high memory. The program
is not very sophisticated and relies on XMS to turn on the A20 line.
(Also one must be very careful to steer clear of any areas of memory
already in use).

Under Linux we generated a disk image `dskimg' (with the kernel and
Initrd and a partition table).

Using this our boot procedure looked something like this:

hmload -fdskimg -a128
fixrb
<unload network drivers>
grub

map --ram-drive=0x81
map --rd-base=0x8000000
map --rd-size=0x400000
root (rd,0)
kernel /kernel root=/dev/ram0 rw ip=bootp ramdisk_size=32768 ...
initrd /initrd
boot

See http://sysdocs.stu.q...ent/GrubForDOS/ for details.


and with info.htm:
http://sysdocs.stu.q...S/code/info.htm

jaclaz

#33 diddy

diddy

    Member

  • Tutorial Writer
  • 78 posts

Posted 22 April 2009 - 06:47 PM

Guide updated to version 1.3

Changes -

* Updated guide for use with Grub4dos version 0.4.4 Final (build 2009-03-31).
* Significant changes made to Installing Grub4dos section - which has been renamed as Loading/Installing Grub4dos
* Added Embedded Menu section
* Added Bootlace Commands section
* Added Grubinst Commands section
* Edited Introduction - simplifying the grub4dos boot process
* Updated Display Options in Configuration File Entries section.
* Added Using && and ||Commands to Configuration File Entries section.
* Amended/updated color, dd, geometry and map commands in Commands section.
* Minor edits and spelling corrections throughout the guide.

The .chm version is still missing for now. I'm going on holiday with family from 24/4/09 and will update the .chm version on my return home (honest).

I'm without internet access whilst away (much to my wifes pleasure) and will check for feedback on the updated guide on my return.

diddy

p.s. Sorry linkmaster (jaclaz) but the updated Loading/Installing Grub4dos section will probably result in some broken links in some of your posts. The original was getting a little too big (and messy) so I have taken an executive decision in breaking it up into smaller OS/device specific sections.

#34 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 22 April 2009 - 07:21 PM

Guide updated to version 1.2

Like in "please read 1.3":

Welcome to Grub4dos guide Version 1.3 (22nd April 2009).


:)

I'm going on holiday with family from 24/4/09 and will update the .chm version on my return home (honest).


Have fun :)

I'm without internet access whilst away (much to my wifes pleasure) and will check for feedback on the updated guide on my return.



I wonder why women are so motivated against the Internet....:)

p.s. Sorry linkmaster (jaclaz) but the updated Loading/Installing Grub4dos section will probably result in some broken links in some of your posts. The original was getting a little too big (and messy) so I have taken an executive decision in breaking it up into smaller OS/device specific sections.

"Linkmaster" in his simplicity :) usually gives three links, like:
http://www.boot-land...?showtopic=5187
http://diddy.boot-la...os/Grub4dos.htm
http://diddy.boot-la...ws.htm#windows5

Should intended audience fail to find last item, it's their problem. :)

:(

jaclaz

#35 diddy

diddy

    Member

  • Tutorial Writer
  • 78 posts

Posted 22 April 2009 - 07:47 PM

Like in "please read 1.3":


Oops

I've just edited by last post - cheers jaclaz

#36 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 22 April 2009 - 08:28 PM

The page at http://diddy.boot-la...iles/syntax.htm isn't very clear:
- missing (rd) as valid device
- missing (hd32) (and higher bios drive numbers) as virtual CDROM/DVDROM drive
- not that clear distinction between the numbering of primary and logical partitions.

Maybe something like the following, will be more structured:
Drives/devices are numbered using the following syntax in Grub4dos&#58;



The numbering of the hard disks starts with zero.

	* &#40;hd0&#41; - first hard disk

	* &#40;hd1&#41; - second hard disk

	* &#40;hd2&#41; - third hard disk

	* ....



Virtual CD drives start at &#40;hd32&#41;&#58;

	* &#40;hd32&#41; - first virtual CDROM/DVDROM drive &#40;equal to &#40;0xA0&#41;&#41;

	* &#40;hd33&#41; - second virtual CDROM/DVDROM drive

	* ...

	* &#40;0xFF&#41; - last virtual CDROM/DVDROM drive &#40;use this if &#40;hd32&#41; doesn&#39;t work for you&#41;



&#40;hd32&#41; is a grub drive number equivalent to &#40;0xA0&#41;. If a virtual drive is specified with a drive number greater than or equal to 0xA0, then it will be treated as a cdrom &#40;i.e., with 2048-byte big sectors&#41;.



Floppy disks&#58;

	* &#40;fd0&#41; - first floppy disk

	* &#40;fd1&#41; - second floppy disk



CD/DVD drives&#58;

	* &#40;cd0&#41; - first &#40;real&#41; CDROM/DVDROM drive

	* &#40;cd1&#41; - second &#40;real&#41; CDROM/DVDROM drive

	* ...



PXE drive&#58;

	* &#40;pd&#41; - virtual device used to designate the root director of PXE boot server



Ramdisk drive&#58;

	* &#40;rd&#41; - ramdisk





Partition numbering for hard disks&#58;

- Primary partitions &#40;numbering from 0 to 3&#41;&#58;

	* &#40;hd#,0&#41; - first primary partition

	* &#40;hd#,1&#41; - second primary partition

	* &#40;hd#,2&#41; - third primary partition

	* &#40;hd#,3&#41; - fourth primary partition &#40;usually an extended partition&#41;



   Examples&#58;

	* &#40;hd0,0&#41; - first primary partition on first hard disk

	* &#40;hd2,1&#41; - second primary partition on third hard disk

	* &#40;hd5,3&#41; - fourth primary partition on sixth hard disk



- Logical partitions &#40;numbering starts from 4&#41;&#58;

	* &#40;hd#,4&#41;  - first logical partition

	* &#40;hd#,5&#41;  - second logical partition

	* &#40;hd#,6&#41;  - third logical partition

	* &#40;hd#,7&#41;  - fourth logical partition

	* &#40;hd#,8&#41;  - fifth logical partition

	* &#40;hd#,9&#41;  - sixth logical partition

	* &#40;hd#,10&#41; - seventh logical partition

	* &#40;hd#,11&#41; - eight logical partition

	* &#40;hd#,12&#41; - ninth logical partition

	* &#40;hd#,13&#41; - tenth logical partition

	* &#40;hd#,14&#41; - eleventh logical partition

	* &#40;hd#,15&#41; - twelfth logical partition

	* &#40;hd#,16&#41; - thirteenth logical partition

	* &#40;hd#,17&#41; - fourteenth logical partition

	* ...



   Examples&#58;

	* &#40;hd0,7&#41; - fourth logical partition on first hard disk

	* &#40;hd3,10&#41; - seventh logical partition on fourth hard disk

	* &#40;hd1,14&#41; - eleventh logical partition on second hard disk





To get a list of all devices that grub4dos can see, press &#39;c&#39; to go the command line mode and type&#58;

  root &#40;

and press <TAB>.


Also repeat at the ISO mapping part of the tutorial:

The "map" process is implemented using INT 13 - any disk emulation will remain accessible from an OS that uses compatible mode disk access, e.g. DOS and Windows 9x. The emulation can't however, be accessed from an OS which uses protected mode drivers (Windows NT/2000/XP/Vista, Linux, FreeBSD) once the protected mode kernel file(s) take control.

and add that Windows based boot disks can't be booted with grub4dos iso emulation, unless they are ramdisk based (link to tutorials would be nice).
This will hopefully solve the problem of newbies that try to use grub4dos iso emulation for booting windows based boot CDs (iso's), but that didn't read or didn't understand the INT 13 access problem with protected mode drivers, which is now only explained at the beginning of the map page.

Also explain that most linux based iso's won't work with grub4dos iso emulation, unless they only need a kernel and an initrd for their working.
  • Linux based iso's, that only need a kernel and an initrd will work with grub4dos iso emulation because the kernel don't need to read any data from the virtual CD drive. The kernel and initrd are loaded by grub4dos from the mapped iso file (INT 13 access is still working here).
  • Linux based iso's, that need other files from the mapped iso, besides the kernel and initrd, will fail to find the virtual CD drive and won't fully boot.

It would also be nice when the guide is available from: http://diddy.boot-la...b4dos/index.htm (which seems more logical to me than http://diddy.boot-la...os/Grub4dos.htm)


Upload also the original README_GRUB4DOS.txt and link to it.
It will be useful for people that are searching for some more advanced examples that aren't covered in the tutorial (yet).

Also update your first post.

#37 diddy

diddy

    Member

  • Tutorial Writer
  • 78 posts

Posted 23 April 2009 - 01:03 AM

@Icecube
I've had a quick scan through your suggestions, which all seem worth adding to the next revision.

Will work on it after my holiday.

Thanks for the suggestions and advice.

diddy

#38 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 09 May 2009 - 08:21 PM

Update: http://diddy.boot-la...files/links.htm

The text isn't actually wrong, but grub4dos 0.4.4 is the last official version, so maybe it is appropriate to update the number 0.4.3 to 0.4.4.

#39 river~~

river~~

    Member

  • Members
  • 34 posts
  •  
    United Kingdom

Posted 11 May 2009 - 07:37 PM

hi Diddy,

I am putting together a floppy disk for use in rescuing windows systems that have been broken by a clumsy Linux install, and also to allow usb cds to boot when the BIOS does not support it.

I'm using Grub4DOS and FreeDOS on the floppy.

I'd like to include some text files on the disk to be used as help files from within FreeDOS. May I take a lot of the material from your tutorial? What acknowledgements would you like? I was planning to include the url of the download, and this forum, any other urls you' like me to include?

Also, I don't think I saw any licence / copyright notice at all in the tutorial (I downloaded the zip with all the pages, and have read through them all). Apols if it is in there and I missed it, but if there is no such info at present, may I suggest you add it to the next edition. It is useful to know if it is GPL or Public Domain or whatever.

Thanks for the work you put into the tutorial - it was a real time saver for me getting started.
best regards,

River~~

#40 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 11 May 2009 - 07:45 PM

It is useful to know if it is GPL or Public Domain or whatever.


At least for my small contribution to it, it follows CAREWARE License:
http://home.graffiti...t/careware.html

Of course diddy is the real Author :D , so he may well apply a more restrictive one.

:D

jaclaz

#41 diddy

diddy

    Member

  • Tutorial Writer
  • 78 posts

Posted 12 May 2009 - 09:48 PM

@river~~

The guide is a community project and is public domain as far as I am concerned, having been compiled with help from other boot-land members and numerous posts both here and on the 911cd forum.

jaclaz's CAREWARE License (see previous post) should however be applied due to the help he gave me with the guide + for pointing me in the right direction whenever I've posted with a Grub4dos related problem :D .

I'd appreciate anyone copying the guide to include the url's for the guide (see first post) + this thread.

Cheers,

diddy

#42 river~~

river~~

    Member

  • Members
  • 34 posts
  •  
    United Kingdom

Posted 13 May 2009 - 04:23 PM

For your info here are my cut down pages of Diddy's guide, intended to be read in DOS from a floppy with no browser, no graphics, etc

Please feel free to copy/use/amend as per jaclaz's CAREWARE licence. In these files I have only covered things relevant to my 'rbrokwin' project (no grub.exe, no PXE, etc) so if you apopt these for anything else you may want to add those back in.

The attachment is a zip file containing MS-DOS text files (\r\n line separators)


River~~

EDIT by jaclaz
Discussion/ideas about the rbrokwin project continues here:
http://www.boot-land...?...ic=7995&hl=

edit by R~~
thanks jaclaz :D
added brief comment about "missing" topics in my files.

Attached Files



#43 diddy

diddy

    Member

  • Tutorial Writer
  • 78 posts

Posted 17 May 2009 - 04:40 PM

Guide updated to version 1.4

Changes -

* Added Gfxmenu section following some subtle prompting from jaclaz.
* Added Acknowledgements section.
* Included README_GRUB4DOS.txt (as requested by Icecube).
* Edited Device Allocation/Numbering (as suggested by Icecube).
* Edited Booting from .ISO Images in Map Command section (as suggested by Icecube).
* Edited Display Options in Configuration File Entries section - adding information about gfxmenu.
* Edited Fundamentals section, adding instructions for using spaces in file/folder paths.
* Edited Contents.

The .chm version has finally been updated.

diddy

#44 Alberich

Alberich

    Member

  • .script developer
  • 71 posts
  • Location:Germany
  •  
    Germany

Posted 18 May 2009 - 06:13 AM

Thanks a lot to all the people contributed to this Guide. Excellent work. One of the best tutorials I've read.

It was planned for month to change my project for all booting purposes to grub. I expect a horrible piece of work, especially reading all the manuals, examples, tips n tricks available on the net.

It took me only some hours to implement the new booting concept with Grub, thanks to this Guide. A must to read for all beginners and very usefull for experienced users. Handy, well structured, focussing on things you really need to know.
Brilliant.

Juergen :D

#45 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 18 May 2009 - 06:53 AM

@diddy
An alltogether new meaning to the world subtle! ;)

Good work, once again. :D

@Alberich
Actually, grub4dos. :D

;)

jaclaz

#46 diddy

diddy

    Member

  • Tutorial Writer
  • 78 posts

Posted 18 May 2009 - 07:19 PM

@diddy
An alltogether new meaning to the world subtle! :D


I decided not to publish the (underhand) tatics used by jaclaz as I did not want to upset any of the more sensitive members of the forum :D

@everyone
Work now begins on version 1.5. I will not be updating the guide from 0.4.4 final to one of the newer builds for now as I don't have time at present to update/check the whole guide and want to add a couple of new topics in the coming weeks. It's nice to see that development continues in tinybit's absence.

diddy

#47 river~~

river~~

    Member

  • Members
  • 34 posts
  •  
    United Kingdom

Posted 20 May 2009 - 06:42 AM

Minor suggestion for http://diddy.boot-la...s/files/map.htm, soon after the bulleted list.

"Either of the following programs can be used to defragment a file" - suggest you also add winimage. Some people frown on it as non-free software, but many others use it and happily pay for it as an easy way to extract/insert file to/from an image.

In winimage, with the image already open, click image->defrag current image. Works in v6.1, not tested it with later/earlier versions. Of course this only works to defrag an image that winimage recognises, as you have to open the image before defragging it.

Tip: insertion of new files into the disk image can fragment the image on disk, and so does reading a new image from a real disk - so I have got into the habit of forcing a defrag before every close.

@Diddy: How much of this detail you include in the manual is up to you of course

River~~

#48 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 20 May 2009 - 09:32 AM

"Either of the following programs can be used to defragment a file" - suggest you also add winimage. Some people frown on it as non-free software, but many others use it and happily pay for it as an easy way to extract/insert file to/from an image.

In winimage, with the image already open, click image->defrag current image. Works in v6.1, not tested it with later/earlier versions. Of course this only works to defrag an image that winimage recognises, as you have to open the image before defragging it.


Well, NO. (i.e. it is NOT recommended as it is NOT a "general" solution)

For TWO reasons:
1)
Winimage will work properly ONLY on a Floppy or Super-Floppy image (one that has NOT a MBR).

Since it "understands" only partitions, it connects to one of them and then you can save the image as a "Full HD" image by adding a MBR and hidden sectors to it.

The management of this feature is NOT always accurate, i.e. the resulting MBR (and partition DATA) may not reflect anymore original one.

2) While Winimage defrags the image "internally" there is no actual "foolproof" guarantee that the file containing the image will be contiguous on the "external" filesystem.

You may be interested (as an alternative) to the good ol' poor man's way that we used in the times of NT4.00:
http://www.msfn.org/...howtopic=131017

jaclaz

#49 river~~

river~~

    Member

  • Members
  • 34 posts
  •  
    United Kingdom

Posted 20 May 2009 - 11:14 AM

Well, NO. (i.e. it is NOT recommended as it is NOT a "general" solution)

For TWO reasons:
1) Winimage will work properly ONLY on a Floppy or Super-Floppy image...

fair comment

2) While Winimage defrags the image "internally" there is no actual "foolproof" guarantee that the file containing the image will be contiguous on the "external" filesystem.

my experience (with floppy images only) is that it always seems to do an external defrag (I must have just been lucky so far - and I've done it so often that perhaps I am now thinking of buying a lotto ticket...)

You may be interested (as an alternative) to the good ol' poor man's way that we used in the times of NT4.00:

basically copy it to a recently initialised disk? - yes, done that before(*) - hoping for something a bit friendlier - or were you referring to another post in that thread?

I recently discovered this does not work on ext3 - even writing to a newly formatted ext3 partition a dvd image is not contiguous (my guess is that some journal entries get interleaved with the dvd).

What is the best/recommended linux tool to defrag a single file?

River~~
(*)
[nostalgia]
first did a copy to defrag and compress in 1980 on an interdata 8/16e which had a 5Mb removable disk (in a cartridge about 400mm across and 40mmthick). Used to sort & copy onto 1/2" mag tape and then initialise the disk and copy back. The tape then got filed as backup - the only time in my life I've regularly done backups :D. Including disk and tape drives, the machine took a whole standard rack from bottom to top. And it took long enough to process that we'd have lunch while it was rolling, even though it only had to process max 10Mb (5 to tape, 5 back)
[/nostalgia]

#50 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 20 May 2009 - 11:57 AM

basically copy it to a recently initialised disk? - yes, done that before(*) - hoping for something a bit friendlier - or were you referring to another post in that thread?

Yep, to that one, plain and simple, as I see it, I find it trivial if we are talking of relatively small devices (USB sticks).
What I normally do with them is "building" an image from scratch, copy to the image the files (including "inner" images, then "dd" the whole thingy.
Once you get familiar with the process, possibly using a script to mount/partition/format, see here:
http://www.boot-land...?showtopic=5000
http://www.boot-land...?showtopic=3191
it is better in my view then actually fiddling with the "real" USB stick. (and besides you already have an image of it should it become coirrupted for any reason).

The friendly way is already Contig/Wincontig.

About EXT3FS I guess you are right, there is no practical way to have on it a (large) contiguous file on it. (or I may too miss something).
What you may want to have a look at is Shake:
http://vleu.net/shake/
AFAIK it works better than Defrag:
http://ck.kolivas.org/apps/defrag/
or PYTHON Defrag:
http://bazaar.launch...ols/trunk/files

Unless of course you convert it "back" to EXT2FS and than re-convert it "forward" to EXT3FS, which it doesn't seem to me really "handy". :D

jaclaz




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users