In fact, I don't know the detail of UNDI very much, either :(. As I know, UNDI need at least two segment of base memory: one is for the UNDI code segment and the other is for the UNDI data segment. The actual size of the two segments depends on the implementation of PXE ROM on the NIC, but I think 64K may be enough on most cards (rtl8139/eepro100/3c90x).
Another problem is the stack segment. The UNDI API may adjust the stack pointer to its own value as a 'reserved' stack for itself. I don't know the actual size of this stack, but the real mode stack of GRUB is so small (8K) that most UNDI APIs will crash the stack to the real mode interrupts area (0-4K) :( In the Michael Brown's UNDI implementation in etherboot, a set of functions is used to allocate the base memory (basemem.c). It acts just like the BIOS dose --- build the link pointer, magic number, and change the memory size stored in address 0x413. That UNDI driver also need some base memory to install a real mode interrupt handler, which is not need in GRUB, for GRUB runs in the base memory already. Currently, my implementation uses a special UNDI_HEAP memory segment (64K) to hold all these memory: data, code and stack. The UNDI_HEAP is located on 512K-576K, which may be crashed in downloading kernel, but may test the UNDI driver itself works OK on DHCP or something. I think we need a heap which can be used safely in the kernel downloading. The simple memory management may help us a lot in many place. -----Original Message----- From: Yoshinori K. Okuji [mailto:[EMAIL PROTECTED] Sent: Monday, July 05, 2004 7:40 AM To: [EMAIL PROTECTED] Cc: Feng Shuo Subject: Re: The UNDI support patch for grub-0.95-diskless-patch-2 On Saturday 03 July 2004 09:59, Feng Shuo wrote: > Now, the patch can do DHCP properly, but hang in downloading kernel > or initrd. Perhaps the kernel data crash the UNDI stack in base > memory, but I could not find a place safe enough to contains the UNDI > code/data/stack :-( It looks great progress. I'd like to help you, but I don't know the details about UNDI. Could you tell me how UNDI uses memory? Okuji _______________________________________________ Bug-grub mailing list [EMAIL PROTECTED] http://lists.gnu.org/mailman/listinfo/bug-grub
