You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be very nice for the standard library, or significant parts of it, to work in kernel mode. There's a lot of refactoring and design necessary for this.
std will probably need a good bit of refactoring, the addition of some sort of platform abstraction layer, the introduction of conditional compilation (profiles) to cut out parts that are irrelevant to kernel-space, and the stubbing out of parts that would be kernel-specific, like tasks and runtime services.
I tried this several times for a toy kernel written in Rust. Getting libstd to compile in free-standing mode is surprisingly easy; simply commenting out the dependency to rtdeps in std/lib.rs will do. But making it really work is another story all together. Two things blocked my effort so far:
The assert! and similar macros. They pull in all sort of platform specific dependencies, std::rt::unwind, std::fmt, etc.
The std::fmt, in turn, needs memory allocation (read: ~str and io::MemWriter) and condition! macro, which depends on tls.
So yes, profiles part of the proposal should be relatively easy. But macro and owned box are used everywhere, it requires some serious refactoring.
I believe that this is entirely contained within the facade effort. The core library, libcore, is entirely usable in kernel mode, as well as all libraries which are only dependent on libcore. I believe we've sliced out about as much as we're going to in order to get the standard library working in kernel mod, so I'm going to close this issue as being as complete as it can be.
new lint to detect infinite loop
closes: rust-lang#11438
changelog: add new lint to detect infinite loop
~*I'll change the lint name*~. Should I name it `infinite_loop` or `infinite_loops` is fine? Ahhhh, English is hard...
It would be very nice for the standard library, or significant parts of it, to work in kernel mode. There's a lot of refactoring and design necessary for this.
std will probably need a good bit of refactoring, the addition of some sort of platform abstraction layer, the introduction of conditional compilation (profiles) to cut out parts that are irrelevant to kernel-space, and the stubbing out of parts that would be kernel-specific, like tasks and runtime services.
cc #11828 - refactoring
cc #7282 - profiles
The text was updated successfully, but these errors were encountered: