2024-05-04 13:20:30 -05:00
|
|
|
# Memory service spec
|
|
|
|
The memory service uses the first byte in the message to identify the request type.
|
|
|
|
|
|
|
|
## Allocate (12 bytes)
|
2024-05-05 05:08:42 -05:00
|
|
|
[U8] -> 0
|
|
|
|
[U8] -> Page count
|
2024-05-04 13:20:30 -05:00
|
|
|
<!-- Currently this does not allocate here, check r1 for a ptr to alloc to -->
|
2024-05-05 05:08:42 -05:00
|
|
|
[U64] -> ptr to alloc at
|
2024-05-04 13:20:30 -05:00
|
|
|
|
|
|
|
## Deallocate (12 bytes)
|
|
|
|
<!-- Currently this does not deallocate -->
|
2024-05-05 05:08:42 -05:00
|
|
|
[U8] -> 1
|
|
|
|
[U8] -> Page count
|
|
|
|
[U64] -> ptr to dealloc from
|
2024-05-04 13:20:30 -05:00
|
|
|
|
|
|
|
## Map Device Into Memory
|
|
|
|
Typically only used for simple drivers such as vga.
|
|
|
|
<!-- Unimp -->
|
2024-05-05 05:08:42 -05:00
|
|
|
[U8] -> 2
|
|
|
|
[U8] -> Page count
|
|
|
|
[U64] -> HostID
|
|
|
|
[U64] -> DeviceID
|
2024-05-04 13:20:30 -05:00
|
|
|
|
|
|
|
## Unmap Device From Memory
|
|
|
|
<!-- Unimp -->
|
2024-05-05 05:08:42 -05:00
|
|
|
[U8] -> 3
|
|
|
|
[U8] -> Page count
|
|
|
|
[U64] -> HostID
|
|
|
|
[U64] -> DeviceID
|
2024-05-04 13:20:30 -05:00
|
|
|
|
|
|
|
## Set Memory Quota
|
|
|
|
<!-- unimp -->
|
2024-05-05 05:08:42 -05:00
|
|
|
[U8] -> 4
|
|
|
|
[U64] -> HostID
|
|
|
|
[U64] -> ProcessID
|
|
|
|
[U8] -> Refer to the Memory Quota Table
|
|
|
|
[U64] -> Memory quota. In pages of memory. Multiply by 4096 to get the total byte count.
|
2024-05-04 13:20:30 -05:00
|
|
|
|
|
|
|
### Memory Quota Table
|
|
|
|
0 -> No quota.
|
|
|
|
1 -> Soft quota. Notifies the process supervisor.
|
|
|
|
2 -> Hard quota. Refuses to allocate above the quota.
|
|
|
|
3 -> Kill quota. Kill the process and notify the supervisor when the process tries to allocate above the quota.
|
|
|
|
|
|
|
|
## Set Buffer Quota
|
|
|
|
<!-- unimp -->
|
2024-05-05 05:08:42 -05:00
|
|
|
[U8] -> 4
|
|
|
|
[U64] -> HostID
|
|
|
|
[U64] -> BufferID
|
|
|
|
[U8] -> Refer to the Buffer Quota Table
|
|
|
|
[U64] -> Buffer quota. In pages of memory. Multiply by 4096 to get the total byte count.
|
2024-05-04 13:20:30 -05:00
|
|
|
|
|
|
|
### Buffer Quota Table
|
|
|
|
<!-- Because of the abusability of buffers there is no Kill Quota -->
|
|
|
|
0 -> No quota
|
|
|
|
1 -> Soft quota. Notify supervisor of quota violation Buffer Message
|
|
|
|
2 -> Hard quota. Return an error message to the process that sent the message.
|