[kernel] Make channels stream based
Multiple changes regarding channels. Mainly channels are now stream based and can handle partial reads or writes. Channels now use the kernel buffers area with the related buffer_cache. Added a fake stdout stream channel and kernel task to read its contents to the screen in preparation for handing channels as stdin/stdout to processes.
This commit is contained in:
@@ -22,8 +22,10 @@ struct vm_range
|
||||
vm_state state;
|
||||
|
||||
inline uintptr_t end() const { return address + size; }
|
||||
inline int compare(const vm_range *other) const {
|
||||
return other->address - address;
|
||||
inline int64_t compare(const vm_range *other) const {
|
||||
if (address > other->address) return -1;
|
||||
else if (address < other->address) return 1;
|
||||
else return 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -253,7 +253,7 @@ vm_space::commit(uintptr_t start, size_t size)
|
||||
vm_state
|
||||
vm_space::get(uintptr_t addr)
|
||||
{
|
||||
node_type *node = find_overlapping(m_ranges.root(), addr, 0);
|
||||
node_type *node = find_overlapping(m_ranges.root(), addr, 1);
|
||||
return node ? node->state : vm_state::unknown;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user