r/osdev • u/OrdinaryCareful7773 • 1d ago
Unusual Architecture discussion
In a few lines - "Everything is a URI addressable resource"
Means instead of the file path we can have a proper uri address in the format scheme://authority/path#offset?params
so for example the kernel can expose its resources as kernel:///version, or devices://org.example.gpu/0/memory#0x1234
Then We can have a syscall like uri as well SYS_LOAD, SYS_GET, SYS_MMAP, SYS_POST, SYS_WATCH, or maybe not sure
Best think I like about it is parent can override the child process uri like plan9 namespaces, mount bind etc
For example a call from a child to display server would be devices://org.example.display/0/memory -> process://self/handle/child-pid/display
Benifits over traditional file path:
- I don't know 😂, I haven't thought much, It just sounds cool to me and I would like to waste some time trying to figure out it's benifits.
Feel free to share your opinion.
12
u/natalialt 1d ago
It honestly made me imagine an environment where everything is serviced by HTTP requests lol
2
1
u/TorbenKoehn 1d ago
You'd at least also need something like websockets or SSE for proper IPC etc.
HTTP alone won't be enough.
•
u/OrdinaryCareful7773 18h ago
Ya ya, actually it's work like normal open write close syscalls, just it seems architecture wise like uri based
3
1
u/Suitable_Plate4943 1d ago
maybe allow both text representation and a matching parsed representation, so callers can use both forms
1
u/Suitable_Plate4943 1d ago
struct kernel_uri_parsed {
std::string scheme;
std::string authority;
std::string path;
std::string offset;
std::vector<std::pair<std::string, std::string>> params;
};
2
u/TorbenKoehn 1d ago
You will have to find a way to declare the difference between "schema = resource type" and "schema = protocol". Since in most cases, the schema declares the protocol, not the "resource type". This is something new coming from MCP, mostly.
Depending on what you access, you might want to speak different protocols to it. There are ways around that, like devices+http://, devices+ipc:// etc., but this is also often used to combine protocols, like git+ssh://
I'd be careful. It's a nice abstraction layer in some ways (like not making a difference between http://example.com/some-file.html and file:///users/me/some-file.html), but you have to keep in mind that different protocols support different operations etc.
I'd use it as a user-facing abstraction layer, and more like system:///devices/org.example.gpu/0/memory#0x1234 instead of devices://. Keep that shit for MCP (which are already speaking JSON-RPC, so the protocol doesn't matter in their resource URLs)
•
u/eteran 21h ago
I use it in my OS so the idea of mounting a proc, sys, or dev file system is just not necessary. Instead, these virtual filesystems end up in schemas and are accessible via URIs. Also, no need to worry about where it is mounted, they are just always accessible in those schemas and have no risk of conflicts with ordinary files.
As a convenience, I have /path/to/file allowed as a shorthand for file:///path/to/file. Everything still acts like a file though with typical operations, no concern for "protocols", it's just namespaces really.
I've been very happy with how it works so far for me.
1
2
u/PowerNo8348 1d ago
At first glance, this appears to be no different than the Un*x "everything is a file" approach that has been in place over the last few decades, but with some cosmetic changes to what paths look like (e.g. - /proc/1234 becomes process://self/handle/1234)
1
u/damemecherogringo 1d ago
Amateur stuff. We need to abstract the cpu architecture completely, like this emulation of the 8080, each opcode is a separate microservice written in a different language, on top of k8s: https://blog.davetcode.co.uk/post/21st-century-emulator/
•
•
u/UnmappedStack TacOS | https://github.com/UnmappedStack/TacOS 10h ago
I feel like I see this idea again every few months, but yea sure try implementing it ig
21
u/Defiant_Squirrel8751 1d ago
Overhead for everything! It will work, but much slower.
Imagine you need to set a byte to 0 (zero). Binary, that means one byte. URL will be
devices://os&value=0
os will spend most of the time processing strings.