<html>
<head>
</head>
<body>
Find below the instructions / research into getting GRUB to work. See if
it has something in it for you to work with. I originally had some problems
with the install, however, I no longer do since following the instructions
I made for myself.<br>
<br>
<br>
Making a Grub Boot Disk<br>
<br>
A custom Grub boot disk is required to boot the RTEMS operating system from
a floppy disk.  After installing Grub onto your computer (I used Linux Red
Hat 6.2), follow these instructions to make the customized Grub disk:<br>
<br>
<br>
1.    Create a file called “floppy.lst” with the following entries<br>
#this list requires that the executable "smart.exe: exists on this floppy<br>
#timeout = 0 will make OS boot immediately<br>
timeout = 0<br>
<br>
default = 0<br>
<br>
title RTEMS<br>
root = (fd0)<br>
#replace smart.exe with the name of your application<br>
kernel =/smart.exe<br>
2.    Copy the following files onto a standard FAT floppy disk: stage1, stage2,
and floppy.lst.<br>
3.    Boot your PC with a standard Grub disk. The instructions for this are
in the file [grubdir]/docs/grub.info-1 under the heading “Installing GRUB
on a floppy.”<br>
4.    Execute these commands at the Grub prompt:<br>
grub> root = (fd0)<br>
grub> install /stage1 (fd0) /stage2 /floppy.lst<br>
5.    You can now boot your RTEMS exe by copying it to the floppy you just
created and then booting your PC with that floppy.<br>
<br>
This proved satisfactory at the beginning, however, swapping the floppy between
the PC that runs the executable and the computer that I was using for development
caused the floppy to wear out and start to jam in the computer.  The computer
that was running RTEMS is attached to my network, so I decided to copy the
built executable to the directory <a class="moz-txt-link-freetext" href="C:\rtems">C:\rtems</a> through the network while the
computer was running Windows.  I would then re-boot the computer into RTEMS
by using the following menu file on the Grub floppy:<br>
<br>
# This is the amount GRUB waits in seconds before booting the default entry<br>
# Set this when you're sure that the default entry is correct.<br>
timeout 30<br>
<br>
# Tell which entry to boot by default.  Note that this is origin zero<br>
# from the beginning of the file.<br>
default 0<br>
<br>
title   Windows<br>
rootnoverify (hd0,0)<br>
chainloader +1<br>
makeactive<br>
<br>
title RTEMS<br>
root = (hd0,0)<br>
kernel =/rtems/smart.exe<br>
<br>
<br>
<br>
<br>
<br>
grub> root = (fd0)<br>
grub> install /stage1 (fd0) /stage2 /winmenu.lst <br>
<br>
This now allows me to boot the computer to either Windows or RTEMS without
ever having to remove the floppy disk from the drive.<br>
<br>
The next stage was to eliminate Windows entirely from the target computer.
This was done using a Dos 6.22 / Linux dual boot computer as the test computer. 
The computer used was a 386 PC with no co-processor, therefore making the
system very similar to my final embedded target.  Linux was installed onto
the second partition of the first hard drive, with LILO installed onto the
superblock of the partition, thus allowing to boot the partition using the
chainloader feature of Grub .  I created the following Menu file, named “test.lst”,
to select the appropriate operating system to load at boot time:<br>
<br>
# This is the amount GRUB waits in seconds before booting the default entry<br>
# Set this when you're sure that the default entry is correct.<br>
timeout 30<br>
<br>
# Tell which entry to boot by default.  Note that this is origin zero<br>
# from the beginning of the file.<br>
default 1<br>
<br>
<br>
title   Dos<br>
rootnoverify (hd0,0)<br>
chainloader +1<br>
makeactive<br>
<br>
<br>
title Linux<br>
rootnoverify (hd0,1)<br>
chainloader +1<br>
makeactive<br>
<br>
title Paranoia<br>
root = (hd0,1)<br>
kernel =/home/test/paranoia.exe<br>
<br>
title Smart Controller<br>
root = (hd0,1)<br>
kernel =/home/test/smart.exe<br>
<br>
I copied stage1, stage2, and test.lst to the directory /boot while the target
was running Linux and the host was running WS_FTP LE in Windows NT4. I installed
Grub to the MBR of the hard drive using the following commands:<br>
<br>
grub > root = (hd0,1)<br>
grub > install /boot/stage1 (hd0) /boot/stage2 /boot/test.lst<br>
<br>
Grub was installed to the MBR of the hard drive, however, there was no menu. 
I attempted to install Grub again from the DOS partition, however, this did
not resolve the problem. I attempted to use the fat_stage1_5 file from the
DOS partition without success.  I then tried using the e2fs_stage1_5 on the
Linux partition using the following commands:<br>
<br>
grub > root = (hd0,1)<br>
grub > install /boot/stage1 (hd0) /e2fs_stage1_5 /test.lst<br>
<br>
which proved successful.  The menu list and the test RTEMS kernels can be
modified using <a class="moz-txt-link-abbreviated" href="ftp://ftp. ">ftp. </a> The result is that I should never require a floppy disk
in the test computer under normal testing circumstances.<br>
<br>
I later had to re-install Linux, and as such, the e2fs_stage1_5 and test.lst
were no longer on the partition.  I was then unable to install GRUB using
the previous method as I would always get a sector out of alignment error
message.  I eventually overcame this by booting with the GRUB floppy and
inserting a DOS formatted floppy with the stage1 file on it.  The stage2
and test.lst files were on the Linux partition in the /boot directory.  I
then executed the commands:<br>
<br>
grub > root (fd0)<br>
grub > install /stage1 (hd0) (hd0,1)/boot/stage2 (hd0,1)/boot/test.lst<br>
<br>
which proved to be successful.  I decided to attempt to boot the computer
with the stage2 and test.lst files on the DOS partition, just to prove that
I did not just jag it.  I modified test.lst and saved it to the DOS partition. 
The DOS partition had only stage2 and test.lst (as well as the whole of MSDOS). 
I proceeded as per the previous example except the install command was as
follows:<br>
grub > install /stage1 (hd0) (hd0,0)/stage2 (hd0,0)/test.lst<br>
<br>
The computer booted using the menu on the dos partition.  I proved this by
booting into DOS and modifying test.lst.  The new menu appeared when I re-booted. 
I then booted into Linux and removed the stage1 and the e2fs_stage1_5 files
from that partition.  I re-booted with the GRUB floppy and installed GRUB
with the menu and stage2 files on the /boot directory of the Linux partition.<br>
grub > root (fd0)<br>
grub > install /stage1 (hd0) (hd0,1)/boot/stage2 (hd0,1)/boot/test.lst<br>
<br>
<br>
Erwin Rol wrote:<br>
<blockquote type="cite" cite="mid:1037305537.4283.316.camel@drake.erwin.muffin.org">
  <pre wrap="">Hello Rakesh,<br><br>As you can see in the email header i also sent this mail to the RTEMS<br>list, which is normaly the best place to ask "gerneral" questions. I<br>personaly don't know grub to well , and can't really give you any help<br>on that topic, i just sugested trying it to make sure the problem you<br>had was really lilo related.<br><br>To everybody else, just read the mails below and maybe someone can give<br>Rakesh some help ?<br><br>- Erwin<br><br>On Thu, 2002-11-14 at 07:50, Rakesh.V.R wrote:<br></pre>
  <blockquote type="cite">
    <pre wrap="">Hi Erwin,<br>     Thanks for your reply. I tried to boot with GRUB following the<br>directions specified in the HOWTO doc, provided along with the RTEMS<br>snapshot. But on giving the "install" command, "File Not Found" error is<br>displayed. I've attached the HOWTO doc with this mail.<br>I tried using plex86 simulator. Still not successful to run RTEMS based<br>application. Expecting your suggestions.<br><br>Thanks,<br>Rakesh<br><br>----- Original Message -----<br>From: "Erwin Rol" <a class="moz-txt-link-rfc2396E" href="mailto:erwin@muffin.org"><erwin@muffin.org></a><br>To: "Rakesh.V.R" <a class="moz-txt-link-rfc2396E" href="mailto:rakesh@atinav.com"><rakesh@atinav.com></a><br>Sent: Thursday, November 14, 2002 2:44 AM<br>Subject: Re: Query based on : LILO for RTEMS<br><br><br></pre>
    <blockquote type="cite">
      <pre wrap="">Hello Rakesh,<br><br>On Thu, 2002-11-07 at 07:17, Rakesh.V.R wrote:<br></pre>
      <blockquote type="cite">
        <pre wrap="">Hello Erwin,<br>    I configured and build RTEMS for target i386-rtems and pc386 bsp.<br></pre>
        </blockquote>
        <pre wrap="">Then I<br></pre>
        <blockquote type="cite">
          <pre wrap="">edited the path in Makefile.inc provided in your liloboot package to<br></pre>
          </blockquote>
          <pre wrap="">the<br></pre>
          <blockquote type="cite">
            <pre wrap="">sample helloworld application created. I created the zImage and tried<br></pre>
            </blockquote>
            <pre wrap="">to<br></pre>
            <blockquote type="cite">
              <pre wrap="">boot the same using lilo. System successfully booted to RTEMS. But<br></pre>
              </blockquote>
              <pre wrap="">instead<br></pre>
              <blockquote type="cite">
                <pre wrap="">of printing *** HELLO WORLD TEST ***, etc specified in the printf()<br>statements, it printed number 8000 for some 10 times and stopped.<br></pre>
                </blockquote>
                <pre wrap="">Could you<br></pre>
                <blockquote type="cite">
                  <pre wrap="">please suggest something in this regard.<br></pre>
                  </blockquote>
                  <pre wrap="">Hmmm hard to say, i wrote the lilo stuff a _long_ time ago so it might<br>be something with the newer RTEMS kernels that goes wrong. Did you try<br>to boot with grub to verify that RTEMS itself works on your hardware ?<br><br></pre>
                  <blockquote type="cite">
                    <pre wrap="">Is there any good pc386 emulator, which can be used for running the<br>application?<br></pre>
                    </blockquote>
                    <pre wrap="">I used BOCH's to boot RTEMS, that should still work. Else you can try<br>vmware. BOCH's is opensource vmware is closed commercial software.<br><br><br>I know the reaction was a bit slow, but i hope it still helps you a bit,<br><br>Erwin<br><br><br></pre>
                    <blockquote type="cite">
                      <pre wrap="">Thanks,<br>Rakesh<br><br>----- Original Message -----<br>From: "Erwin Rol" <a class="moz-txt-link-rfc2396E" href="mailto:erwin@muffin.org"><erwin@muffin.org></a><br>To: "RTEMS" <a class="moz-txt-link-rfc2396E" href="mailto:rtems-users@oarcorp.com"><rtems-users@oarcorp.com></a><br>Sent: Saturday, January 29, 2000 3:57 AM<br>Subject: LILO for RTEMS<br><br><br></pre>
                      <blockquote type="cite">
                        <pre wrap="">Hello all,<br><br>due to the positive reactions here the source to<br>make a image that can be booted with lilo.<br><br>Few notes:<br>it is hacked linux kernel code, which makes it GPL.<br>The Makefile.inc holds the path to the "image" that should<br>be booted. after a 'make' you will have a zImage wich can<br>be dd'ed to floppy or booted with lilo.<br><br>lilo offers the possibility pass boot parameters and to pass<br>the memory size and it sets up the video modes.<br>These things might be usefull for the pc386 BSP ?<br>also I am interested to see if it solves those strange reboot<br></pre>
                        </blockquote>
                        </blockquote>
                        <pre wrap="">problems.<br></pre>
                        <blockquote type="cite">
                          <blockquote type="cite">
                            <pre wrap="">I never have had serious problems with the 4.0.0 version and grub<br></pre>
                            </blockquote>
                            </blockquote>
                            <pre wrap="">and<br></pre>
                            <blockquote type="cite">
                              <blockquote type="cite">
                                <pre wrap="">was very supriced to see the C++/sp/hello wolrd (the only ones i<br></pre>
                                </blockquote>
                                </blockquote>
                                <pre wrap="">tried)<br></pre>
                                <blockquote type="cite">
                                  <blockquote type="cite">
                                    <pre wrap="">worked in one go now.<br><br>I hope it is usefull and maybe can be integrated in the pc386 BSP<br></pre>
                                    </blockquote>
                                    </blockquote>
                                    <pre wrap="">(even<br></pre>
                                    <blockquote type="cite">
                                      <blockquote type="cite">
                                        <pre wrap="">though<br>it is GPL)<br><br>- Erwin<br><br>PS. can someone tell me what the best way would be to interegrate<br></pre>
                                        </blockquote>
                                        </blockquote>
                                        <pre wrap="">this<br></pre>
                                        <blockquote type="cite">
                                          <blockquote type="cite">
                                            <pre wrap="">into the<br>build process ? now i run make manualy on it and have to chnage the<br>image name in the makefile.<br><br><br></pre>
                                            </blockquote>
                                            </blockquote>
                                            </blockquote>
                                            </blockquote>
                                            <pre wrap=""><!----><br></pre>
                                            </blockquote>
                                            <br>
                                            <pre class="moz-signature" cols="$mailwrapcol">-- 
Angelo Fraietta

PO Box 859
Hamilton NSW 2303

Home Page


<a class="moz-txt-link-freetext" href="http://www.users.bigpond.com/angelo_f/">http://www.users.bigpond.com/angelo_f/</a>

There are those who seek knowledge for the sake of knowledge - that is CURIOSITY
There are those who seek knowledge to be known by others - that is VANITY
There are those who seek knowledge in order to serve - that is LOVE
    Bernard of Clairvaux (1090 - 1153)</pre>
                                            <br>
                                            </body>
                                            </html>