lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Port to 8086 Architecture.


From: Robert Morse
Subject: Re: [lwip-users] Port to 8086 Architecture.
Date: Fri, 16 Feb 2007 10:57:56 -0500


On Feb 16, 2007, at 9:55 AM, Kieran Mansley wrote:

On Fri, 2007-02-16 at 09:49 -0500, Robert Morse wrote:
Thanks for all the help, but I now have it running.

What I had to do was in the one section where the address compare in
the pbuf_header() routine.  I had to change the if to call a function
that created a linear address from the segment/offset then compare those
address.

It's not entirely clear from this what change you made, and whether it
is more widely applicable.  Could you supply a diff?

Kieran

Ok,

In the pbuf.c module, here is the diff that I used:

482c482
<     if ((u8_t *)p->payload < (u8_t *)p + sizeof(struct pbuf)) {
---
> if (MAKELINADDRESS((u8_t *)p->payload) < MAKELINADDRESS( (u8_t *)p + sizeof(struct pbuf)) ) {

Then in my sys_arch.c, i created the following function.

u32_t makelinAddress( void *a)
{
    u32_t a_linAddr;
    u32_t a_o = (u32_t)FP_OFF(a);
    u32_t a_s = (u32_t)FP_SEG(a);

    a_linAddr = (a_s << 8) + a_o;
    return( a_linAddr);
}

Then in my cc.h, I did a define of
#define MAKELINADDRESS(x) makelinAddress(x)

For system that already have a linear address, they could define the following in cc.h
#define MAKELINADDRESS(x) x

Now, I am not sure this is the only place where something like this might need to be done, as all the pointer manipulations that is done, there might be some more offset wraps that might happen depending on where the data areas are placed. I have not yet looked at
replacing all pointers with 'far pointers'.

Setup.

Runing a Turbo86 processor, which looks like a 8086 but has 256 byte pages instead of 16 byte pages of a 8086. This allows 16Meg memory space instead of the 8086 1Meg memory space. I have to run in Large model as I do not have source to our kernel, and that is
only compiled in Large model.

Robert





reply via email to

[Prev in Thread] Current Thread [Next in Thread]