Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support mmap by rearrange virtual memory space #94

Open
2 of 3 tasks
coolyjg opened this issue Apr 12, 2024 · 4 comments
Open
2 of 3 tasks

Support mmap by rearrange virtual memory space #94

coolyjg opened this issue Apr 12, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@coolyjg
Copy link
Contributor

coolyjg commented Apr 12, 2024

  • Support mmap with anonymous mapping and file mapping.
  • Rearrange virtual memory space.
  • Support swap mechanism.
  • Multi-architecture:
    • X86_64
    • AArch64
    • RiscV64
@coolyjg
Copy link
Contributor Author

coolyjg commented Apr 12, 2024

#82 #83

@coolyjg coolyjg added the enhancement New feature or request label Apr 12, 2024
@coolyjg coolyjg modified the milestone: Release v0.0.1 Apr 12, 2024
@coolyjg
Copy link
Contributor Author

coolyjg commented Apr 15, 2024

#96

@ken4647
Copy link
Contributor

ken4647 commented Apr 28, 2024

There is a problem for x86_64:x86_64 has the problem of inconsistency TLB for multi-core cpu after tlb_flush(). Generally, IPI (inter-core interrupt) can be considered to solve it. However, RuxOS doesn't support it so far.

@ken4647
Copy link
Contributor

ken4647 commented Apr 28, 2024

Another problem is there is a actually small virtual memory space between phys-memory-base(0) and the begin of mmio-regions(0xb000_0000) for x86_64. Therefore, under the default configuration, only a maximum of 3GB of physical memory is supported.

# Base address of the whole physical memory.
phys-memory-base = "0"
# Size of the whole physical memory.
# phys-memory-size = "0x800_0000"     # 128M
phys-memory-size = "0x8000_0000"     # 2G
# Base physical address of the kernel image.
kernel-base-paddr = "0x20_0000"
# Base virtual address of the kernel image.
kernel-base-vaddr = "0xffff_ff80_0020_0000"
# virtual start address of the mapping memory.
mmap-start-vaddr = "0xffff_8000_0000_0000"
# virtual end address of the mapping memory.
mmap-end-vaddr = "0xffff_f000_0000_0000"
# Linear mapping offset, for quick conversions between physical and virtual
# addresses.
phys-virt-offset = "0xffff_ff80_0000_0000"
# MMIO regions with format (`base_paddr`, `size`).
mmio-regions = [
    ["0xb000_0000", "0x1000_0000"], # PCI config space
    ["0xfe00_0000", "0xc0_0000"],   # PCI devices
    ["0xfec0_0000", "0x1000"],      # IO APIC
    ["0xfed0_0000", "0x1000"],      # HPET
    ["0xfee0_0000", "0x1000"],      # Local APIC
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants