Strange problem with PXE_GET_CACHED_INFO

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Congdm
Member
Member
Posts: 48
Joined: Wed Aug 01, 2012 10:53 am

Strange problem with PXE_GET_CACHED_INFO

Post by Congdm »

Hi, I am writing my PXE boot loader but when calling PXE_GET_CACHED_INFO, I always get PXE_EXIT_FAILURE:

Code: Select all

push ds    ; DS is 0
push t_PXENV_GET_CACHED_INFO
push PXENV_GET_CACHED_INFO
call dword [Var.EntryPointSP]
Here is t_PXENV_GET_CACHED_INFO structure:

Code: Select all

t_PXENV_GET_CACHED_INFO:
        .Status dw 0
        .PacketType dw PXENV_PACKET_TYPE_DHCP_ACK
        .BufferSize dw Cached_Packet_End - Cached_Packet + 1
        .Buffer_Off dw Cached_Packet
        .Buffer_Seg dw 0
        .BufferLimit dw 0
Everything stay in same segment and the code run at ORG $7C00. But when I change .Buffer_Off, .Buffer_Seg and .BufferSize to 0, it works and return PXE_EXIT_SUCCESS. Anyone knows about this problem? Also, I running it on ASRock P4i45GV with RTL8139 onboard.
Nable
Member
Member
Posts: 453
Joined: Tue Nov 08, 2011 11:35 am

Re: Strange problem with PXE_GET_CACHED_INFO

Post by Nable »

http://wiki.osdev.org/PXE#PXE_API
The PXE Entry Point uses the Pascal calling convention - push the parameters on the stack, far call the entry point, clean up the stack - while the older PXENV+ Entry Point uses registers.
I don't know if that's the cause of your problem but it's better to check.

> .BufferSize to 0, it works
What do you mean when you say 'it works' ? As I think, call with buffer size = 0 would return no data.

Then, could you post values of the constants that you use?
Congdm
Member
Member
Posts: 48
Joined: Wed Aug 01, 2012 10:53 am

Re: Strange problem with PXE_GET_CACHED_INFO

Post by Congdm »

Constants:

Code: Select all

PXENV_GET_CACHED_INFO = $0071
PXENV_PACKET_TYPE_DHCP_DISCOVER = 1
PXENV_PACKET_TYPE_DHCP_ACK = 2
PXENV_PACKET_TYPE_CACHED_REPLY = 3
Nable wrote:What do you mean when you say 'it works' ?
When I set BufferSize, Buffer_Off and Buffer_Seg to 0, it returned PXENV_EXIT_SUCCESS in AX and the address of bootph was fill into t_PXENV_GET_CACHED_INFO structure.
Post Reply