The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
memory_layout.h File Reference
#include "common/stdint.h"

Go to the source code of this file.

Macros

#define USER_SPACE_START   0x00001000u
 ginnOS virtual memory layout constants.
#define USER_SPACE_END   0xC0000000u
#define KERNEL_PHYS_BASE   0x00010000u
#define LOW_MEMORY_END   0x00100000u
#define USER_LOAD_ADDR   0x00400000u
#define USER_STACK_TOP   0xBFFFF000u
#define USER_STACK_MAX   0x01000000u
#define USER_STACK_LIMIT   (USER_STACK_TOP - USER_STACK_MAX)
#define USER_STACK_SIZE   0x00004000u
#define USER_STACK_BASE   (USER_STACK_TOP - USER_STACK_SIZE)
#define KERNEL_VIRT_BASE   0xC0000000u
#define PHYS_MAP_SIZE   0x20000000u
#define KSTACK_REGION_BASE   0xE0000000u
#define MMIO_REGION_BASE   0xF0000000u
#define MMIO_REGION_END   0xF4000000u
#define USER_MMAP_BASE   0x40000000u
#define USER_MMAP_END   0xB0000000u

Macro Definition Documentation

◆ USER_SPACE_START

#define USER_SPACE_START   0x00001000u

ginnOS virtual memory layout constants.

every address space (i686, 4 GiB): 0x00000000 - 0x00000FFF : null guard (never mapped) 0x00400000 - ... : user program text/data/bss (linker/user.ld) ... - ... : user heap (grows up via sbrk from the ELF end) 0x40000000 - 0xAFFFFFFF : user mmap region 0xBEFFF000 - 0xBFFFEFFF : user stack (up to 16 MiB, grows down on demand) 0xBFFFF000 - 0xBFFFFFFF : user stack guard (never mapped) 0xC0000000 - 0xDFFFFFFF : kernel: direct map of RAM (phys_to_virt) 0xE0000000 - ... : kernel stacks (kstack.h) 0xF0000000 - 0xF3FFFFFF : kernel MMIO window (ioremap)

the user half (below 0xC0000000) is per process; the kernel half is shared by every address space and supervisor-only.

◆ USER_SPACE_END

#define USER_SPACE_END   0xC0000000u

◆ KERNEL_PHYS_BASE

#define KERNEL_PHYS_BASE   0x00010000u

◆ LOW_MEMORY_END

#define LOW_MEMORY_END   0x00100000u

◆ USER_LOAD_ADDR

#define USER_LOAD_ADDR   0x00400000u

◆ USER_STACK_TOP

#define USER_STACK_TOP   0xBFFFF000u

◆ USER_STACK_MAX

#define USER_STACK_MAX   0x01000000u

◆ USER_STACK_LIMIT

#define USER_STACK_LIMIT   (USER_STACK_TOP - USER_STACK_MAX)

◆ USER_STACK_SIZE

#define USER_STACK_SIZE   0x00004000u

◆ USER_STACK_BASE

#define USER_STACK_BASE   (USER_STACK_TOP - USER_STACK_SIZE)

◆ KERNEL_VIRT_BASE

#define KERNEL_VIRT_BASE   0xC0000000u

◆ PHYS_MAP_SIZE

#define PHYS_MAP_SIZE   0x20000000u

◆ KSTACK_REGION_BASE

#define KSTACK_REGION_BASE   0xE0000000u

◆ MMIO_REGION_BASE

#define MMIO_REGION_BASE   0xF0000000u

◆ MMIO_REGION_END

#define MMIO_REGION_END   0xF4000000u

◆ USER_MMAP_BASE

#define USER_MMAP_BASE   0x40000000u

◆ USER_MMAP_END

#define USER_MMAP_END   0xB0000000u