sunriseos / sunriseos Goto Github PK
View Code? Open in Web Editor NEWHorizon/NX kernel reimplementation
License: Apache License 2.0
Horizon/NX kernel reimplementation
License: Apache License 2.0
We should map the kernel at the end of address space (> 0xC0000000).
This might be accomplished by a bootstrap stage whose main goal is to enable paging. It maps the rest of the kernel in high addresses, and jumps to it. That way the kernel starts with paging already on.
The bootstrap is also a good place to handle architecture specific things, like setting up a valid kernel stack, creating the gdt, etc.
TODO
comment in 1b59e39 when #20 was merged. cc @Orycterope.Rust 2018 has so many awesome feature, it'd be a shame if we missed out on them. We should upgrade to rust 1.31, and upgrade all our crates to the 2018 edition.
Currently, we never unregister our intents. This means that if we wait(), return from wait (so we're Scheduled/Running), and then get an IRQ for another event, we'll add the process to the schedule queue again, causing an assert.
I believe we should clean up registrations.
Because we clearly don't have enough warnings.
Clippy is a cool tool that's able to catch a lot of logic bugs, in addition to imposing some style choices (which helps keep the code uniform).
It does not need to be related to interruptions, and should be the easiest module to find in all the kernel.
This will overflow on OOM.
TODO
comment in 72c424a when #78 was merged. cc @Orycterope.We lost the pretty CGA ๐ญ . We'll need an easy low-level debugger for all the dumb shit that'll happen in the VBE stuff, and serial seems easy enough. Right? ๐
gdt is specific to i386 architecture, and should not be at the root level
TODO
comment in 1b59e39 when #20 was merged. cc @Orycterope.We have a userspace. Next step is porting the libstd. This would allow us to use many of the nice interfaces from std, such as std::io, HashMaps, etc...
TODO
comment in 84f52da when #63 was merged. cc @Orycterope.Our kernel is currently completely untested. We need to fix this. We should have two layers of tests:
Unit tests, which would be ran using (more or less) cargo test
, will check the core routines of our kernel (bookkeeping, IPC primitives, scheduling algorithm, etc...) to make sure they have the expected behavior.
Integration tests, which would be either userspace binaries or "kernel processes" which would run under qemu and write the output of the test to the serial console.
The first layer is very easy to implement. We just need to add a few #[cfg] here and there, and write the damn tests.
The second layer is more interesting though. It will require adding a test harness to the kernel. The test harness will be responsible with running the tests (which should each be a single "Process" - either userspace or kernel) and outputing the results of the tests on the serial console. Ideally, it should output it in a format understood by the TAP protocol (https://testanything.org/), so that we can then use TAP consumers (such as tappy) to read the output easily. There is a crate that allows easily writing TAP producers: https://docs.rs/testanything/0.1.1/testanything/
The Logger trait and color attributes were used to multiplex kernel logging. They got copied to userspace when shell and clock were evicted from the kernel, but they could be hugely simplified now.
TODO
comment in 84f52da when #63 was merged. cc @Orycterope.Please, my eyes are bleeding.
This should allow those function to be memory-safe, and make it harder to fuck up and reuse invalidated pointers.
It follows the scheme from #1, just need to make extra sure it's safe
Right now, Pios can be created at will with utter disregard for ownership. This isn't great. It'd be nice if we could statically guaranatee that a given pin will only be used once (and panic on duplicate use).
The idea would be to have a PioRegistry that keeps track of who uses which pins. This PioRegistry would keep a Vec (or HashMap or whatever) of Pio registration entries, and only return a Pio if it isn't already registered.
Reserve a bit in the PageEntry for DROPPABLE, add a bool in Frame for droppable. If droppable is true, free the frame from the allocator.
Return to vanilla font-rs, now that we're in userspace and have a heap.
This might need a PR to font-rs to expose a font's max_ascent and max_descent
Having the FRAMES_BITMAP_SIZE set to this value on a 64 bit target causes rustc to panic in a really random assertion when creating the array (which would be too big).
I think we should report that.
TODO
comment in 84f52da when #63 was merged. cc @Orycterope.let's avoid leaking memory, shall we?
We should implement KACs like Horizon/NX does. We currently have an ad-hoc system for specifying IOPB restrictions, ideally we should merge it with the KAC system.
https://switchbrew.org/w/index.php?title=NPDM#Kernel_Access_Control
Make kernel errors match the userspace errors.
TODO
comment in 1b59e39 when #20 was merged. cc @Orycterope.`#[cfg(not(test))]` still compiles this item with cargo test, but `#[cfg(target_os = "none")] does not. I think this is a bug, we should report it.
TODO
comment in 84f52da when #63 was merged. cc @Orycterope.The kernel must bzero every page that it gives to userspace, to prevent leaking data from a process to another.
Unfortunately this implies a lot of overhead. We should find a way to be smart about it, and do it the less often possible.
First we need to decide if either:
Secondly, we need to find a strategy to keep track of dirty pages, and bzero them only once.
I imagine we can put to use the dirty
flag in the page tables, but i don't really know when would be the best moment to do the clean. On allocation ? On clean ?
Also: Do we consider never-used pages as clean ? Are they guaranteed to be all zeros on boot ?
A lot of questions ๐
Apparently, if CR0 WP bit is not set, then the kernel can write in RO pages. We might want to set it.
Dependabot is a github bot that automatically submits a PR when a dependency gets updated. https://dependabot.com.
When calling vi::draw, vi reads from the shared memory. There is no borrow-checking mechanism in place to ensure that the other process does not mutate it while this happens. Maybe we should have some kind of cross-process mutex? How to implement this properly?
TODO
comment in 42d48b2 when #52 was merged. cc @roblabla.A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.