Sender | Message | Time |
---|---|---|
18 Apr 2024 | ||
4lDO2 | In reply to @binarycat:snug.moeNot the kernel, some drivers do though. | 07:44:27 |
ネコ | huh | 07:46:53 |
ネコ | how do you implement an io cache outside the kernel? | 07:47:27 |
ネコ | since you need to drop it when under memory pressure | 07:47:57 |
4lDO2 | Right now, it doesn't. But the kernel will eventually implement swap, in which case it could send deallocation requests to drivers (whose pages would be memlocked), and if a driver is uncooperative or not responding, invoke the oom killer. | 07:59:58 |
4lDO2 | It could for example count various classes of (present) pages in each address space, such as "cache"/"regular cow"/"regular shared"/"pinned", in which case it would know what to prioritize first. | 08:05:14 |
4lDO2 | * Right now, it doesn't. But the kernel will eventually implement swap, in which case it could send deallocation requests to drivers (whose cache pages would be "memlocked"), and if a driver is uncooperative or not responding, invoke the oom killer. | 09:07:53 |
4lDO2 | * The kernel could for example count various classes of (present) pages in each address space, such as "cache"/"regular cow"/"regular shared"/"pinned", in which case it would know what to prioritize first. | 12:14:25 |
~Tijl | So ... I've been studying up on (micro)kernels and OSes. There's one thing I can't quite grasp:
| 15:39:42 |
rw_van | We don't have a specific list. It's "inspired by", not copied from, seL4 and Minix. There are several things that were moved into the kernel for performance reasons, that could be moved out as we continue optimizing. (Optimizing critical functions makes it less necessary to have e.g. various housekeeping functions in the kernel) | 15:47:12 |
Ribbon | Both Minix and seL4 don't have a Plan 9-like system interface. | 15:55:45 |
Ribbon | I think it's the main difference. | 15:56:00 |
~Tijl | Thanks, to be clear: I'm not judging ... just curious. I love this approach of letting badly written drivers crash and burn without impacting the kernel. | 15:57:39 |
~Tijl | ... next to other advantages like live update | 15:58:05 |
~Tijl | Ribbon: So Redox follows a Plan 9-like interface? Also, does Redox have kernel threads. I feels like Andrew Tanenbaum would've included that if he were to do Minix all over - from some of his comments. | 16:25:48 |
Ribbon | In reply to @tijlleenders:matrix.orgYes, the "schemes" | 16:26:26 |
~Tijl | Ah yes of course! ... and kernel threads are supported? | 16:39:53 |
4lDO2 | Yes, there are kernel threads, but it has been proposed that the kernel be restructured as an "event kernel" (for performance), i.e. only one stack per hardware thread (https://gitlab.redox-os.org/redox-os/kernel/-/issues/112). | 16:58:30 |
4lDO2 | (which userspace won't notice, other than memory usage being lower per thread) | 16:59:29 |
4lDO2 | Currently, the kernel threads are called "contexts", almost all of which are userspace. The only exception is one kmain context per cpu. | 17:01:47 |
Ribbon | In reply to @4ldo2:matrix.orgThe link is broken? | 17:03:11 |
4lDO2 | In reply to @draft_isa:matrix.orgnot for me | 17:03:35 |
4lDO2 | * Currently, the kernel threads are called "contexts", almost all of which primarily run userspace except during interrupt handlers or syscalls. The only exception is one kmain context per cpu. | 17:06:52 |
4lDO2 | In reply to @tijlleenders:matrix.orgI haven't looked that deeply into minix, but compared to seL4, Redox has a slightly more complex and indirect capability system (in order to implement POSIX file descriptors without overhead). The kernel is also stack-based rather than event-based, and implements memory management and process management (the latter will likely be moved to userspace) which sel4 implements in userspace. | 17:16:59 |
4lDO2 | In reply to @tijlleenders:matrix.org* I haven't looked that deeply into minix, but compared to seL4, Redox has a slightly more complex and indirect capability system (in order to implement POSIX file descriptors without overhead). The kernel is also stack-based rather than event-based, and implements memory management and process management (the latter will likely be moved to userspace) which sel4 expects userspace to implement. | 17:17:40 |
4lDO2 | * I haven't looked that deeply into minix, but compared to seL4, Redox has a slightly more complex and indirect capability system (in order to implement POSIX file descriptors without overhead). The kernel is also s(currently) tack-based rather than event-based, and implements memory management and process management (the latter will likely be moved to userspace) which sel4 expects userspace to implement. | 17:20:04 |
4lDO2 | * I haven't looked that deeply into minix, but compared to seL4, Redox has a slightly more complex and indirect capability system (in order to implement POSIX file descriptors without overhead). The kernel is also (currently) stack-based rather than event-based, and implements memory management and process management (the latter will likely be moved to userspace) which sel4 expects userspace to implement. | 17:20:14 |
~Tijl | Thanks people, I'll dive into the code when I have time. Maybe I can make some PRs on the documentation 🤔. I s the MMU is a good place to start ... or capabilities? | 17:24:29 |
Ribbon | In reply to @tijlleenders:matrix.orgIt's a grey area because we are implementing things and changing the design where needed. | 17:26:47 |
~Tijl | Ok I'll tread lightly and ask before going all out... Don't have much time to spare - but I see huge potential and would love to help in any way I can. | 17:29:27 |