Hi Jonas Oberg !

At the moment I haven't studied PXE, I don't know it, except the fact,
that netboot-0.9.0 of Kuhlmanm supports it.

I don't know, if it is a good idea to do here a netboot stuff again.
There is a well documented packet, that is able to load data fields
diskless into RAM (netboot-0.9.0) and supports PXE and BBS standards.
(Drawback: at the monent the documentation of netboot-0.9.0 is not
actual, it was not updated since v0.8.1).

So my suggestion to the diskless GRUB supoort:
        First step:
                Load stage2 into the memory at 0x8000 which can
                be done with the netboot or etherboot boot ROM and
                my script building up a netboot header.
        
        Second step:
                Executing stage2 at 0x8200 (stage 1 and first 512
                bytes of stage2 are not used in this mode)

        Third step:
                GRUB runs normally as it was booted from floppy or
                disk. Furthermore it detects, if it was netbooted
                by checking the presence of the netboot header block
                in the memory at 0x8000. In this case the grub stage2
                loads the 'menu.lst' file via tftp with the GRUB
                builtin tftp functions !

        But this design is not complete, because in this case only
                one 'menu.lst' file can be used for all clients.

        So I developed a new idea, I want to implement and test this
                weekend. The GRUB should donwload a file like
                '/tftpboot/grub/menu.hosts' from the server. This files
                includes a pair of IP addresses and menu.lst files like:
                        
                # menu.hosts
                #       format:
                #     ip-addr   menu-filename
                192.168.1.21    /tftpboot/machine1/boot/grub/menu.lst
                192.168.1.24    /tftpboot/machine2/boot/grub/menu.lst

                With this design, the menu.lst files can be managed
                very convinient from the server. GRUB stage2 downloads
                the file before runnung the 'menu.lst', looks at its own
                ip address fetched by bootp before and downloading
                the specified 'menu.lst'.

        Forth step:
                All other GRUB functions of downloading and booting
                can be used without any changes.

So I think it is better not to develop special diskless netboot 
functionalities of the own, as the netboot package (also used in
etherboot package) dose this very fine !!

Cheers
        Christoph Plattner



Jonas Oberg wrote:
> 
> Christoph Plattner <[EMAIL PROTECTED]> writes:
> 
> > Now, my 'patched' GRUB detects, whether it was booted
> > by netboot or 'normal' by disk.
> 
> Please send a patch to the list. I want to see what you have done
> so I can do it similarly in my PXE hacks (no need to do things
> very differently if we can avoid it).
> 
> I'm thinking of adding code to the netboot/ directory and make a
> network card definition that uses the PXE's built-in functions,
> if available. They are somewhat different than the already available
> function, in particular when receiving data, but it should be doable.
> 
> It's also possible to hook PXE into the TFTP code and use PXE's
> predefined TFTP routines, but I figured that it would make more
> sense to hook into the lower level network drivers so that other
> remote filesystems have a chance to work if they would ever be
> implemented.
> 
> Is there a limit on the size of pre_grub2?  It's increasing towards
> 64k.
> 
> I also need some help with GAS; I'm unfamiliar with the syntax of
> far calls and other things. In ES:DI is a structure called SEGOFF16
> containing the segment and offset of a function in memory. Currently
> I use this code to call it (PXE code can unfortunately only be called
> from 16 bit real mode);
> 
>         mov %es:(%di), ABS(offset)
>         mov %es:2(%di), ABS(segment)
>         .byte 0x9a
> segment:        .word 0
> offset:         .word 0
> 
> Is this the right way to do it?

Reply via email to