rdos wrote:
Regardless of method, it's basically impossible to implement a zero-copy file API with both the shared buffer interface (which is obvious) and with memory mapping. This is because file clusters might be smaller than the page size, which means you cannot memory map the file without allocating an intermediate buffer. What is needed is that the kernel must be able to memory map the file in chunks of it's underlying sector size, and the application must be able to handle that the mapping might not be continous rather in chunks. With traditional memory mapping, it's typically the application that defines where the mapping should reside, which won't work with zero-copy. Unless you create an overly complex disc buffer architecture.
It's true that it is impossible to implement a zero-copy interface with memory mapping for files with a storage-like backing, but it is perfectly possible to implement a zero-copy file interface for files with a memory-like backing (i.e. MMIO or actual RAM) as long as they are page-aligned. UX/RT will directly map any file with a page-aligned memory-like backing into the address space of the target process (although in some cases accesses will be intercepted with page faults). In fact, memory-mapped files will be the only way to map memory at all for regular processes, and anonymous memory will be completely absent outside the kernel and process server.
rdos wrote:
I'm not building a desktop OS for multiple users, rather I'm more focused on embedded systems and servers/data collectors.
The basic security infrastructure in UX/RT will be pretty lightweight. There will likely be a cut-down permission manager for embedded systems, and it will be possible to run with no permission manager at all. The login manager will be separate from the permission manager and will also be optional.
rdos wrote:
I suppose you (as the OS creator) could easily add this, but could somebody else do it without changing or adding interfaces to your OS? This is the problem in Windows/Linux. In my design, somebody could actually add a device driver for this that interacts with PCI to find & initiate the device and that exports a set of APIs for user level. This would not require any kernel modifications. The only thing it would require are some private gate numbers that could just be picked at the end.
Yes, it will be easy enough for anyone to do it with stock UX/RT since it will be a QNX-like pure microkernel system. All drivers will be ordinary processes (or plugins loaded into ordinary processes), and the interfaces they use will be available to any process that has been configured with sufficient privileges (and there will be no restrictions on which programs can be given what privileges). There won't be any way to add custom system call traps, but that won't be necessary since literally all interfaces will be based on file-oriented message passing and memory mapping and any process will be able to export a filesystem.
Extensibility is so important to me that I put it in the name (Universally eXtensible Real Time operating system). The poor extensibility of conventional Unices (and all of the ad-hoc hacks needed to work around it) is responsible for many or even most of the problems with them IMO.
thewrongchristian wrote:rdos wrote:
I think you still need the root (super user) account, and so you are still forced into the user account model.
root (as in, a root user) is simply a user space name for UID 0, the super-user. process 1 (init) is already running as UID 0. Take any UNIX or UNIX like kernel, give it a filesystem with just an init program, and that program can do whatever it wants.
When I log into my computer, the username I use is a user level construct. The user id I'm assigned is a user level construct. At the kernel level, UNIX cares not what my user id is except in regards to distinguishing the super-user (UID 0) from non-super user (any other UID) and any UID from any other UID.
Presumably, an embedded system would not need a user in the desktop sense. It would just make sense to run user code as unprivilegedcode, so the only requirement is to drop UID 0 privileges by setting UID to 1.
Yes, in Unix-like systems, login management is almost always separated from the actual permission checking, which is generally pretty lightweight. This will be true of UX/RT as well, even though both its login management and permission checking will be rather different from that under legacy Unix.