Skip to content

Conversation

eternalcomet
Copy link

Description

Underlying driver assumes a linear mapping between virtual address and physical address when converting them, which is only present in kernel address space. So under circumstance related to physical address, we should copy the buffer to kernel space.

(cherry picked from commit 25abd28)

Related Issues(If necessary)

  • sys_write will finally call axfs::dev::Disk::write_one in dev.rs, which will use the buffer directly.
  • read from stdin will finally call console_read_bytes, which will also use the buffer directly.

Implementation Details

Make sure that the buffer is in kernel address space so that there is a linear mapping between virtual address and physical address.

@Azure-stars
Copy link
Collaborator

Can you solve the merge conflict and CI error?

… convert VA to PA

Underlying driver assumes a linear mapping between virtual address and physical address when converting them, which is only present in kernel address space. So under circumstance related to physical address, we should copy the buffer to kernel space.

- `sys_write` will finally call `axfs::dev::Disk::write_one` in dev.rs, which will use the buffer directly.
- read from stdin will finally call `console_read_bytes`, which will also use the buffer directly.
@eternalcomet eternalcomet force-pushed the fix-phys-addr-convert branch from d9bea7a to 1ea06fb Compare June 16, 2025 02:15
@eternalcomet
Copy link
Author

Can you solve the merge conflict and CI error?

done

@Azure-stars Azure-stars merged commit 5c5fcfe into oscomp:main Jun 16, 2025
24 checks passed
AsakuraMizu pushed a commit that referenced this pull request Jul 7, 2025
… convert VA to PA (#52)

Underlying driver assumes a linear mapping between virtual address and physical address when converting them, which is only present in kernel address space. So under circumstance related to physical address, we should copy the buffer to kernel space.

- `sys_write` will finally call `axfs::dev::Disk::write_one` in dev.rs, which will use the buffer directly.
- read from stdin will finally call `console_read_bytes`, which will also use the buffer directly.
AsakuraMizu pushed a commit that referenced this pull request Jul 7, 2025
… convert VA to PA (#52)

Underlying driver assumes a linear mapping between virtual address and physical address when converting them, which is only present in kernel address space. So under circumstance related to physical address, we should copy the buffer to kernel space.

- `sys_write` will finally call `axfs::dev::Disk::write_one` in dev.rs, which will use the buffer directly.
- read from stdin will finally call `console_read_bytes`, which will also use the buffer directly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants