Re: [Etherboot-developers] Question on relocation etc..
Brought to you by:
marty_connor,
stefanhajnoczi
|
From: <ke...@us...> - 2002-12-29 05:17:56
|
>Ken posted a message about updates required to the drivers for the 5.1 >branch for relocation. Can someone expand on the details for me? I am >developing the driver based on a cvs update pre Eric's directories >restructure. Is there something special that needs to be done for 5.1 >because of relocation? Eric will correct my mistakes when he gets back but I believe the story is like this: Etherboot runs at virtual address 0x20000 upwards (see arch/i386/Makefile). However this actually corresponds to a physical address somewhere at the top of memory due to address translation. Within Etherboot itself there is no problem using the virtual addresses, memory references will come out ok. However when you give the address to hardware, say for DMA or something, you have to convert them to physical addresses or the hardware will try to access the wrong locations. The function virt_to_phys or virt_to_bus (same thing) will do this for you. In some cases you have to call the reverse function phys_to_virt, when the hardware contains shared memory, e.g. WD8013 NICs, so that Etherboot will address the correct hardware address. Typically this is in places where you load address registers of the NIC. >Now I just need to track down a 14 missing bytes in my truncated >transmit. Is it possible that it is relocation related? Sounds like you forgot to fill in the Ethernet frame header? |