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

Implement SharedMemory #30

Merged
merged 2 commits into from
Nov 30, 2018
Merged

Conversation

roblabla
Copy link
Member

This PR depends on #28 . DO NOT MERGE BEFORE MERGING #28

  • Implements Create/Map/Unmap shared memory syscalls in kernelspace
  • Implements the equivalent syscall in userspace
  • Add SharedMemory and MappedSharedMemory userspace types.
  • MappedSharedMemory contains some unsafe functions that should probably not
    be used...

@roblabla roblabla force-pushed the svc-sharedmem branch 2 times, most recently from 68c649b to 341469f Compare November 29, 2018 16:21
@todo
Copy link

todo bot commented Nov 29, 2018

RE the switch: can we map a subsection of a shared memory?

https://github.com/roblabla42/KFS/blob/341469f276d7fcaeec4ab6884a7d960b96f84cf0/kernel/src/interrupts/syscalls.rs#L246-L256


This comment was generated by todo based on a TODO comment in 341469f in #30. cc @roblabla.

@todo
Copy link

todo bot commented Nov 29, 2018

Can we unmap a subsection of a shared memory?

https://github.com/roblabla42/KFS/blob/341469f276d7fcaeec4ab6884a7d960b96f84cf0/kernel/src/interrupts/syscalls.rs#L264-L274


This comment was generated by todo based on a TODO comment in 341469f in #30. cc @roblabla.

@todo
Copy link

todo bot commented Nov 29, 2018

Handle MemoryAttributes and refcounts in query_memory

https://github.com/roblabla42/KFS/blob/341469f276d7fcaeec4ab6884a7d960b96f84cf0/kernel/src/interrupts/syscalls.rs#L296-L306


This comment was generated by todo based on a TODO comment in 341469f in #30. cc @roblabla.

@todo
Copy link

todo bot commented Nov 29, 2018

PageInfo Handling

https://github.com/roblabla42/KFS/blob/341469f276d7fcaeec4ab6884a7d960b96f84cf0/kernel/src/interrupts/syscalls.rs#L305-L313


This comment was generated by todo based on a TODO comment in 341469f in #30. cc @roblabla.

@todo
Copy link

todo bot commented Nov 29, 2018

Extend MappingType to cover all MemoryTypes

https://github.com/roblabla42/KFS/blob/341469f276d7fcaeec4ab6884a7d960b96f84cf0/kernel/src/paging/mapping.rs#L48-L58


This comment was generated by todo based on a TODO comment in 341469f in #30. cc @roblabla.

@Orycterope
Copy link
Member

So, if I understand correctly, closing a SharedMemory handle leaves it mapped, but makes it impossible for the process to unmap it. The SharedMemory is not dropped, because an Arc remains in the process' bookkeeping.
Is that it ?

@roblabla
Copy link
Member Author

@Orycterope no. When you map a SharedMemory, MappedSharedMemory gets ownership of the underlying handle. As such, the handle cannot be closed until the MappedSharedMemory gets unmapped (which will close the handle).

- Implements Create/Map/Unmap shared memory syscalls in kernelspace
- Implements the equivalent syscall in userspace
- Add SharedMemory and MappedSharedMemory userspace types.
- MappedSharedMemory contains some unsafe functions that should probably not
  be used...
@todo
Copy link

todo bot commented Nov 30, 2018

Frame Allocator should take lengths in bytes.

https://github.com/roblabla42/KFS/blob/c6d95b32cbd1b6947ed251463c1f76731be73d70/kernel/src/interrupts/syscalls.rs#L235-L245


This comment was generated by todo based on a TODO comment in c6d95b3 in #30. cc @roblabla.

Copy link
Member

@Orycterope Orycterope left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

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.

None yet

2 participants