Skip to contentSkip to conversation

memory layout

hppa-linux Mike Shaver 4 participants 6 messages Mar 18, 1999 – Mar 19, 1999

lore
Share & tools
lore
#0 lore raw

rd.c:467: KERNEL_DS' undeclared (first use in this function) mmap.c:361: TASK_UNMAPPED_BASE' undeclared (first use in this function)

It sorta begs the question: what is our memory layout going to look like? What goes where? I'll pore over my PA-RISC book tonight looking for clues, but I doubt that'll be enough.

What kind of memory layout does HP-UX use, if I might be so bold as to ask?

Mike

Signature · 1 line
305756.61 259655.94
#1 lore raw

Talking about only pa1.1 or 32 bit CPUs, I would say the same layout can be used as Linux on Intel does. That is kernel mapped at 0xc0000000. So 3 Gig for User space and 1 Gig for kernel. Of course, other ppl may have different ideas.

PA has this strange concept of Spaces and they have those space registers %sr0 to %sr7. This reminds me of Intel's segment registers. And whoever wanted to do any serious OS like Unix on 80386 never liked segments.

pkd

Quoted 12 lines · Mike Shaver

rd.c:467: KERNEL_DS' undeclared (first use in this function) mmap.c:361: TASK_UNMAPPED_BASE' undeclared (first use in this function)

It sorta begs the question: what is our memory layout going to look like? What goes where? I'll pore over my PA-RISC book tonight looking for clues, but I doubt that'll be enough.

What kind of memory layout does HP-UX use, if I might be so bold as to ask?

Mike

#2 lore raw
Quoted 5 lines · Kumar

Talking about only pa1.1 or 32 bit CPUs, I would say the same layout can be used as Linux on Intel does. That is kernel mapped at 0xc0000000. So 3 Gig for User space and 1 Gig for kernel. Of course, other ppl may have different ideas.

OpenBSD has the same idea, it seems. From
sys/arch/hppa/include/vmparam.h:

/* user/kernel map constants */

#define VM_MIN_ADDRESS          ((vm_offset_t)0)
#define VM_MAXUSER_ADDRESS      ((vm_offset_t)0xc0000000)
#define VM_MAX_ADDRESS          VM_MAXUSER_ADDRESS
#define VM_MIN_KERNEL_ADDRESS   ((vm_offset_t)0)
#define VM_MAX_KERNEL_ADDRESS   ((vm_offset_t)0xF0000000)

I'll start filling in the x86 numbers blindly, I guess.

Quoted 4 lines

PA has this strange concept of Spaces and they have those space registers %sr0 to %sr7. This reminds me of Intel's segment registers. And whoever wanted to do any serious OS like Unix on 80386 never liked segments.

Yeah, I've been trying to figure out whether we should do anything special with those, but I don't quite understand the whole architecture yet.

Mike

Signature · 1 line
311774.80 264634.54
#3 lore raw
In reply to Kumar
Quoted 4 lines

Talking about only pa1.1 or 32 bit CPUs, I would say the same layout can be used as Linux on Intel does. That is kernel mapped at 0xc0000000. So 3 Gig for User space and 1 Gig for kernel. Of course, other ppl may have different ideas.

If you want to run PH/UX binaries then you need to probably follow their layout

Quoted 4 lines

PA has this strange concept of Spaces and they have those space registers %sr0 to %sr7. This reminds me of Intel's segment registers. And whoever wanted to do any serious OS like Unix on 80386 never liked segments.

Spaces is more segments done right. The reason we dont use segmentation to split user/kernel on x86 any more is simply performance - it costs us 1 clock per dword copied to/from luser space.

The m68k people use the 'spaces' equivalent on the m68k quite heavily

#4 lore raw
Quoted 2 lines · Alan Cox

If you want to run PH/UX binaries then you need to probably follow their layout

Yeah, but OpenBSD runs their binaries and seems to use the 0xC0000000 division.

Quoted 1 line

The m68k people use the 'spaces' equivalent on the m68k quite heavily

So we should be reading up on the spaces use in the arch/m68k code, then =).

Mike

Signature · 1 line
351839.03 300276.13
#5 lore raw

Making, drinking tea and reading an opus magnum from Mike Shaver:

Quoted 6 lines
Quoted 2 lines · Alan Cox

If you want to run PH/UX binaries then you need to probably follow their layout

Yeah, but OpenBSD runs their binaries and seems to use the 0xC0000000 division.

hey! thank you very much, but we are not running hp/ux binaries on hppa yet (; syscalls are done in hpux/lites/mklinux/osf/linux(?;) compatible way. not all sources are in the repo tho (i'm doing things one at a time)

Quoted 4 lines
Quoted 1 line

The m68k people use the 'spaces' equivalent on the m68k quite heavily

So we should be reading up on the spaces use in the arch/m68k code, then =).

and hp300 (which is m68k) is doing syscalls throught the trap#n actually (for both hpux and bsd)

cu

Quoted 11 lines

Mike

Signature · 5 lines
351839.03 300276.13

-------------------------------------------------------------------------
To unsubscribe: send e-mail to [email protected] with
`unsubscribe' as the subject.
Signature · 1 line
    paranoic mickey       (my employers have changed but, the name has remained)