Live data from Hacker News

CharlotteOS – An Experimental Modern Operating System

github.com

91–100 of 104 posts

Re: CharlotteOS – An Experimental Modern Operating System

#91
post #9
post #5

Earlier quoted context omitted.

Why would you need to recompile if hardware changes? Linux manages just fine as a monolithic kernel that ships with support for many devices in the same kernel build.

It's true that you can compile everything in but it's not really the standard practice. On a stock distro you have dozens of dynamic modules loaded.

Even a fully loaded kernel with loads of drivers isn't that big. And not all of it has to be resident in memory at all times. Code in general is miniscule compared to data. And most of a kernel's data isn't baked into the executable. And this kernel in particular has very thin drivers that only abstract real devices to generic device class interfaces that userspace has to deal with directly. That's the part that's inspired by exokernels and hypervisor paravirtualization. That means that drivers for this kernel will be even smaller than those for other ones like Linux.

Re: CharlotteOS – An Experimental Modern Operating System

#92

Earlier quoted context omitted.

OP here. The plan is to hand out panes which are just memory buffers to which applications write pixel data as they would on a framebuffer then when the kernel goes to actually refresh the display it composites any visible panes onto the back buffer and then swaps buffers. There is nothing unsafe about that any more so than any other use of shared memory regions between the kernel and userspace and those are quite pr…

Does this mean that window management has to be handled in the kernel? Or is there some process that tells the kernel where those panes should be relative to one another/the framebuffer?

That's going to tentatively be handled in kernel unless there good reason to do otherwise. The idea is to expose low level hardware interfaces across the board and this seemed to be the best way to multiplex actual hardware framebuffers while still keeping things low level.

From there each application can draw its own GUI and respond to events that happen in its panes like a mouse button down event while the cursor is at some coordinates and so forth using event capabilities. What any event or the contents of a pane mean to the application doesn't matter to the OS and the application has full control over all of its resources and its execution environment with the exception of not being allowed to do anything that could harm any other part of the system outside its own process abstraction. That's my rationale for why the display system and input events should work that way. Plus it helps latency to keep all of that in the kernel especially since we're doing all the rendering on the CPU and are thus bottlenecked by the CPU's memory bus having way lower throughput compared to that of a discrete GPU. But that's the way it has to be since there are basically no GPUs out there with full publicly available hardware documentation as far as I know and believe me I've looked far and wide and asked around. Eventually I'll want to port Mesa because redoing all the work develop something that complex and huge just isn't pragmatic.

Re: CharlotteOS – An Experimental Modern Operating System

#93

This is probably a better introduction it seems, than specifically the kernel of the OS: https://github.com/charlotte-os/.github/blob/main/profile/RE... > URIs as namespace paths allowing access to system resources both locally and on the network without mounting or unmounting anything This is such an attractive idea, and I'm gonna give it a try just because I want something with this idea to succeed. Seems the proje…

Recompiling the whole kernel just to change drivers seems like a deal-breaker for wider adoption

Why? It can be fully automated just like dynamic module download and loading are.

Incremental compilation means you don't have to recompile everything just compile the new driver as a library and relink the kernel and you're done. Keep the prior n number of working ones around in case the new one doesn't work.

Re: CharlotteOS – An Experimental Modern Operating System

#94

Earlier quoted context omitted.

Ok, even Doug Crockford has mucked around with licensing before, so this is definitely a digression and not aimed at CharlotteOS which looks fascinating: I wish there was a social stigma in Open Source/Free Software to doing anything other than just picking a bog standard license. I mean, we have a social stigma even for OS developers about rolling your own crypto primitives. Even though it's the same very general do…

OP here, it's not mucking around with the license just making sure people know how the GPLv3 works. You are not required to provide source code for the combined work unless it is conveyed. If you combine the covered work with closed source but don't convey the resulting product you are not required to provide any source to anyone. Many people don't know that, hence the clarification note.

Thanks for that. It's really incredible how much stigma GPLv3 has, makes you wonder sometimes.

Re: CharlotteOS – An Experimental Modern Operating System

#95
post #24

Earlier quoted context omitted.

In an operating system course I attended it was mostly Unix and everyone was used to bashing Windows NT ("so crappy, bsod etc.") but we had Stallings' book and I was surprised to learn that NT was in many ways an improvement over Unix and Linux.

NT is the brainchild of Dave Cutler, who also had a leading role in developing Dec's VMS.

Yeah, reading tip: "Showstopper!: The Breakneck Race to Create Windows NT and the Next Generation at Microsoft"

Re: CharlotteOS – An Experimental Modern Operating System

#96

Earlier quoted context omitted.

Why would you buy it’s more secure. Traditionally in windows in-kernel compositing was a constant source of security vulnerabilities. Sure rust may help the obvious memory corruption possibilities but I’m not convinced.

[flagged]

I’m really not sure what I said that warranted this reaction.

I was literally talking about Microsoft moving the compositor that was inside the kernel in their old Windows 9x kernel architecture to outside the kernel in Windows NT.

That literally every other kernel (OSS and comercial, Unix and not) does this separation suggests this is a generally accepted good security practice.

I’m not aware of any kernel research that alters the fundamental fact that having compositing in-kernel compositing is a big security risk surface area and the OS you are proposing isn’t even pure Rust - it’s got C and assembly and unsafe Rust thrown in which suggests there’s a non trivial attack surface area that isn’t mitigated architecturally - AFAIK capability security won’t help here with a monolithic design and you need a microkernel design to separate concerns and blast areas to make the capabilities mean anything so that an exploit in one piece of the kernel can’t be a launching pad to broader exploits. This is also ignoring that even safe Rust has potential for exploit since there are compiler bugs around soundness in terms of generated code so even if you could write pure safe Rust code (which you can’t at the OS level) a monolithic kernel would present issues.

TLDR: claiming that there’s decades of OS research to improve on that existing kernels don’t take advantage of is fair. Claiming that a monolithic kernel doesn’t suffer architectural security challenges, particularly with respect to compositing in-kernel is a bold statement that would be better supported by explaining how that research solves the security risks rather than launching an ad hominem attack against a different kernel family than I even mentioned is just a weird defensive reaction.

Re: CharlotteOS – An Experimental Modern Operating System

#97

Earlier quoted context omitted.

Why would you buy it’s more secure. Traditionally in windows in-kernel compositing was a constant source of security vulnerabilities. Sure rust may help the obvious memory corruption possibilities but I’m not convinced.

[flagged]

I could go for something like MINIX, i.e. the microkernel architecture. If a driver dies, it gets "resurrected", and so forth.

Re: CharlotteOS – An Experimental Modern Operating System

#98

Earlier quoted context omitted.

I believe redox is doing the same (the everything as an URI part)

Skimming https://doc.redox-os.org/book/scheme-rooted-paths.html and https://doc.redox-os.org/book/schemes.html , I think they've slightly reworked that to a more-unixy approach, but yeah still fundamentally more URI than traditional VFS

I don't think that's changed, it's just that /foo is an alias for /scheme/file/foo.

You could roughly emulate it on Unix by assuming every filename starting /scheme/bar/ is a bar-type (special) file, but nothing stops you creating (and you'd necessarily have) 'files' of any type outside that. In Redox, everything has that scheme prefix describing its type (and if omitted, it's implicitly /scheme/file/).

Re: CharlotteOS – An Experimental Modern Operating System

#99

Earlier quoted context omitted.

[flagged]

I could go for something like MINIX, i.e. the microkernel architecture. If a driver dies, it gets "resurrected", and so forth.

Why? Faulty drivers shouldn't be restarted. I never understood that argument in favor of microkernels.

Re: CharlotteOS – An Experimental Modern Operating System

#100

Earlier quoted context omitted.

[flagged]

I’m really not sure what I said that warranted this reaction. I was literally talking about Microsoft moving the compositor that was inside the kernel in their old Windows 9x kernel architecture to outside the kernel in Windows NT. That literally every other kernel (OSS and comercial, Unix and not) does this separation suggests this is a generally accepted good security practice. I’m not aware of any kernel research…

What security risk exists in blitting together memory buffers and doing some alpha blending? Because that's all compositing is. And Linux, Windows and all the other popular OSes all use memory regions that are shared between the kernel and userspace in ways that are far worse than for putting together an image to display.Your supposed security concern is a total non-issue.

There's no possible way that data which will only ever be read as raw pixel data, Z tested, alpha blended, and then copied to a framebuffer can compromise security or allow any unauthorized code to run at kernel privilege level. It's impossible. These memory regions are never mapped as executable and we use CPU features to prevent the kernel from ever executing or even being able to access pages that are mapped as userspace pages and not explicitly mapped as shared memory with the kernel i.e. double mapped into the higher half. So there's literally an MMU preventing in kernel compositing from even possibly being a security issue.

Post reply on HN