Subject: Re: ELF, a.out & libsa loadfile()
To: None <port-mac68k@NetBSD.org>
From: None <nigel@ind.tansu.com.au>
List: port-mac68k
Date: 05/23/2001 09:41:23
Chris asked:
> What does your loadfile_machdep.h contain?

	It is based on the news68k version:

    #define BOOT_AOUT
    #define BOOT_ELF
    #define ELFSIZE 32

    #define LOAD_KERNEL     (LOAD_ALL & ~LOAD_HDR)
    #define COUNT_KERNEL    (COUNT_ALL & ~COUNT_HDR)

    #define LOADADDR(a)     (((u_long)(a)) + offset)
    #define ALIGNENTRY(a)   ((u_long)(a))
    #define READ(f, b, c)   kernel_read(f, (void *)LOADADDR(b), c)
    #define BCOPY(s, d, c)  memcpy((void *)LOADADDR(d), (void *)(s), (c))
    #define BZERO(d, c)     memset((void *)LOADADDR(d), 0, (c))
    #define WARN(a)         BootError   a
    #define PROGRESS(a)     ErrorPrintf a
    #define ALLOC(a)        malloc(a)
    #define FREE(a,b)       free(a)
    #define OKMAGIC(m)      1
                         /* (m == OMAGIC || m == NMAGIC || m == ZMAGIC) */

    /* Extras which loadfile.c uses */

    typedef size_t         ssize_t;

    #define EFTYPE         0
    #define MID_MACHINE    MID_M68K

    #define lseek          kernel_lseek
    #define read(f, b, c)  kernel_read(f, (void *)(b), c)


> Is your a.out file NMAGIC, OMAGIC, or ZMAGIC?

	NMAGIC. It is one of the standard distributions' (e.g. 1.4)

-- 
| Nigel Pearson, nigel@ind.tansu.com.au | "Reality is that which,   |
|   Telstra NW-D, Sydney, Australia.    |  when you stop believing  |
| Office: 9206 3468    Fax:  9212 6329  |  in it, doesn't go away." |
| Mobile: 0408 664435  Home: 9792 6998  | Philip K. Dick - 'Valis.' |


-- 
| Nigel Pearson, nigel@ind.tansu.com.au | "Reality is that which,   |
|   Telstra NW-D, Sydney, Australia.    |  when you stop believing  |
| Office: 9206 3468    Fax:  9212 6329  |  in it, doesn't go away." |
| Mobile: 0408 664435  Home: 9792 6998  | Philip K. Dick - 'Valis.' |