calling UNDI API
Hi,
does anyone have code to call UNDI functions from withing GRUB?
I can obtain the physical address of a function "entry16point" or "entry32point" which are supposedly callable from real mode and/or protected mode, but I do not know how to use them (successfully)
I'm looking into the sources from NILO and etherboot, but there's too much stuff to learn... (I'm not sufficiently familiar with x86 protected mode used in grub2...)
-- lode
u_int16_t (*entry16point)(u_int16_t func, void *param);
/* 16bit stack segment API entry */
/* point. This will be seg:off in */
/* real mode and sel:off in 16:16 */
/* protected mode. */
u_int16_t (*entry32point)(u_int16_t func, void *param);
/* 32bit stack segment API entry */
/* point. This will be sel:off. */
/* In real mode, sel == 0 */_________________________________________________________________
Online een nieuwe taal leren? http://www.msn.be/msnacademy
Quoted 4 lines
Hi,
does anyone have code to call UNDI functions from withing GRUB?
Ask Feng Shuo <[email protected]>. He has integrated the etherboot driver into grub legacy. I think it could be a good way to start here, with integrating etherboot drivers first and the etherboot undi driver second.
I do some work on grub, but it doesn't work now :-(
I will release a special patch containing the unfinished UNDI drivers for GRUB-0.95. Hope somebody can fix it and let it work :-)
BTW. I think the UNDI driver may be not our first choice ---- so many cards are buggy implemented :-(
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of lode leroy
Sent: Monday, June 21, 2004 11:02 PM
To: [email protected]
Subject: calling UNDI API
Hi,
does anyone have code to call UNDI functions from withing GRUB?
I can obtain the physical address of a function "entry16point" or "entry32point"
which are supposedly callable from real mode and/or protected mode, but I do not know how to use them (successfully)
I'm looking into the sources from NILO and etherboot, but there's too much stuff to learn... (I'm not sufficiently familiar with x86 protected mode used in grub2...)
-- lode
u_int16_t (*entry16point)(u_int16_t func, void *param);
/* 16bit stack segment API entry */
/* point. This will be seg:off in */
/* real mode and sel:off in 16:16 */
/* protected mode. */
u_int16_t (*entry32point)(u_int16_t func, void *param);
/* 32bit stack segment API entry */
/* point. This will be sel:off. */
/* In real mode, sel == 0 */_________________________________________________________________
Online een nieuwe taal leren? http://www.msn.be/msnacademy
_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel
Quoted 1 line · lode leroy
does anyone have code to call UNDI functions from withing GRUB?
Can you please explain what this is and why you need it?
Thanks,
Marco
Quoted 4 lines · Marco Gerards
Quoted 1 line · lode leroy
does anyone have code to call UNDI functions from withing GRUB?
Can you please explain what this is and why you need it?
UNDI is a part of PXE, and it provides a raw ethernet interface. If we can UNDI from GRUB, it fits into our framework, since it works in a similar way as etherboot drivers.
Okuji
Quoted 9 lines · Yoshinori K. Okuji
Quoted 4 lines · Marco Gerards
Quoted 1 line · lode leroy
does anyone have code to call UNDI functions from withing GRUB?
Can you please explain what this is and why you need it?
UNDI is a part of PXE, and it provides a raw ethernet interface. If we can UNDI from GRUB, it fits into our framework, since it works in a similar way as etherboot drivers.
This sounds really cool. Lode, do you want to work on this?
I can do the same for the PPC port, open firmware has such features as well.
Thanks,
Marco
Quoted 9 lines · Yoshinori K. Okuji
Quoted 4 lines · Marco Gerards
Quoted 1 line · lode leroy
does anyone have code to call UNDI functions from withing GRUB?
Can you please explain what this is and why you need it?
UNDI is a part of PXE, and it provides a raw ethernet interface. If we can UNDI from GRUB, it fits into our framework, since it works in a similar way as etherboot drivers.
What is the best way to implement network support? We can access the raw interfaces using UNDI. I think the same is possible (in such a way) when using Open Firmware.
How will we support the other cards? By using etherboot (or whatever it was used in GRUB Legacy)? What I would prefer is to have our own TCP/IP stack that is platform independent.
--
Marco
Quoted 3 lines · Marco Gerards
How will we support the other cards? By using etherboot (or whatever it was used in GRUB Legacy)? What I would prefer is to have our own TCP/IP stack that is platform independent.
There are many TCP/IP implementations that are free to use. I don't recommend to build one from scratch if it isn't really necessary.
I don't know how they collide with GRUB's license but here is link to one of them, even in "local" server:
http://savannah.nongnu.org/projects/lwip/
This one is mainly for embedded systems, but has also x86 port.
Thanks,
Vesa Jääskeläinen
Quoted 3 lines · Marco Gerards
What is the best way to implement network support? We can access the raw interfaces using UNDI. I think the same is possible (in such a way) when using Open Firmware.
If you look at the header file include/grub/net.h, you can see what I had in my mind. Basically, network devices should provide a generic interface to network protocols.
Quoted 3 lines
How will we support the other cards? By using etherboot (or whatever it was used in GRUB Legacy)? What I would prefer is to have our own TCP/IP stack that is platform independent.
In GRUB Legacy, we use our own implementation for network protocols. The source code is derived from etherboot, but we have modified it to adapt it to the GRUB semantics. So, in principle, we only use the ethernet drivers in etherboot.
For network drivers, there are some candidates: Etherboot, OSKit, and drivers in Linux, FreeBSD, NetBSD and OpenBSD. If we want to steal drivers from operating systems, this is not easy, because this requires support for interruptions by hardware. GRUB doesn't assume that hardware interrupts occur during normal execution, since this makes the implementation very complex, due to the switch between real mode and protected mode on i386. So I prefer the polling approach to the interruption-based approach. For this, Etherboot fits gracefully.
If my understanding is correct, Etherboot is now being ported to other architectures, although it was only for i386 like GRUB Legacy. This looks very interesting to us.
BTW, do you really need TCP in GRUB? I know some people want to use TCP protocols for netboot, such as HTTP and FTP. But I feel this is overkill. If you need only UDP, it's quite easy to implement. You can just copy the code from GRUB Legacy with a few modifications for portability.
Okuji
Quoted 3 lines · Yoshinori K. Okuji
If you look at the header file
include/grub/net.h, you can see what I had in my mind. Basically, network devices should provide a generic interface to network protocols.
Ok.
Quoted 9 lines
Quoted 3 lines
How will we support the other cards? By using etherboot (or whatever it was used in GRUB Legacy)? What I would prefer is to have our own TCP/IP stack that is platform independent.
GRUB doesn't assume that hardware interrupts occur during normal execution, since this makes the implementation very complex, due to the switch between real mode and protected mode on i386. So I prefer the polling approach to the interruption-based approach. For this, Etherboot fits gracefully.
Ok, I agree.
Quoted 3 lines
If my understanding is correct, Etherboot is now being ported to other architectures, although it was only for i386 like GRUB Legacy. This looks very interesting to us.
i did not know that. Interesting indeed.
Quoted 5 lines
BTW, do you really need TCP in GRUB? I know some people want to use TCP protocols for netboot, such as HTTP and FTP. But I feel this is overkill. If you need only UDP, it's quite easy to implement. You can just copy the code from GRUB Legacy with a few modifications for portability.
No, I just said TCP/IP because I am used to it and it is the name of the protocol, I did not mean TCP specifically. But I know a lot of people would like TCP support. It is at least an option that should be left open, IMHO.
Thanks,
Marco
Marco Gerards <[email protected]> wrote:
: > GRUB doesn't assume that hardware interrupts occur during normal : > execution, since this makes the implementation very complex, due to : > the switch between real mode and protected mode on i386. So I prefer : > the polling approach to the interruption-based approach. For this, : > Etherboot fits gracefully.
:
: Ok, I agree.
Isn't GRUB executing in protected mode, except when it escapes into real mode to do BIOS calls? I can not see how it would be difficult to use interrupts in such context. Or does the BIOS depend on interrupst?
: > BTW, do you really need TCP in GRUB? I know some people want to use TCP : > protocols for netboot, such as HTTP and FTP. But I feel this is : > overkill. If you need only UDP, it's quite easy to implement. You can : > just copy the code from GRUB Legacy with a few modifications for : > portability.
:
: No, I just said TCP/IP because I am used to it and it is the name of : the protocol, I did not mean TCP specifically. But I know a lot of : people would like TCP support. It is at least an option that should : be left open, IMHO.
The problem is that TCP is rather interrupt driven by nature. For example, it uses a lot of timers for packet re-sending and similar stuff.
Maybe it is possible to use lwIP, which is released under a modified BSD license. See http://savannah.nongnu.org/projects/lwip/
~j
The interrupt handle is different between GRUB and Etherboot. I don't know the detail, but this makes some Etherboot drivers not work properly in GRUB (even with my diskless patch). For instance, the new pcnet32 driver hang in GRUB, for it will raise an interrupt to initialize the card ---- the UNDI driver has the similar problem :-(
In grub2, I think, we must make a decision on which framework to use before we do anything, so that we may change the grub2 base code or architecture to support the frame work better.
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Marco Gerards
Sent: Thursday, July 01, 2004 9:36 PM
To: The development of GRUB 2
Subject: Re: calling UNDI API
Quoted 3 lines · Yoshinori K. Okuji
If you look at the header file
include/grub/net.h, you can see what I had in my mind. Basically, network devices should provide a generic interface to network protocols.
Ok.
Quoted 9 lines
Quoted 3 lines
How will we support the other cards? By using etherboot (or whatever it was used in GRUB Legacy)? What I would prefer is to have our own TCP/IP stack that is platform independent.
GRUB doesn't assume that hardware interrupts occur during normal execution, since this makes the implementation very complex, due to the switch between real mode and protected mode on i386. So I prefer the polling approach to the interruption-based approach. For this, Etherboot fits gracefully.
Ok, I agree.
Quoted 3 lines
If my understanding is correct, Etherboot is now being ported to other architectures, although it was only for i386 like GRUB Legacy. This looks very interesting to us.
i did not know that. Interesting indeed.
Quoted 5 lines
BTW, do you really need TCP in GRUB? I know some people want to use TCP protocols for netboot, such as HTTP and FTP. But I feel this is overkill. If you need only UDP, it's quite easy to implement. You can just copy the code from GRUB Legacy with a few modifications for portability.
No, I just said TCP/IP because I am used to it and it is the name of the protocol, I did not mean TCP specifically. But I know a lot of people would like TCP support. It is at least an option that should be left open, IMHO.
Thanks,
Marco
_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel