Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docs #90

Merged
merged 17 commits into from
Dec 22, 2018
Merged

Fix docs #90

merged 17 commits into from
Dec 22, 2018

Conversation

roblabla
Copy link
Member

WIP, don't merge yet.

roblabla and others added 13 commits December 14, 2018 17:56
- Fix the repr of enum_with_val, it should be transparent.
- Allow metas on the associated constants in the enum_with_vals macro, most
  importantly allowing docs.
Also add a *few* TODOs.
Sorry this adds even more warnings :/
- Remove IWaitable::into_handle, it was unused.
- Fix a few "result not use" warnings.
@sunriseos sunriseos deleted a comment from todo bot Dec 17, 2018
@sunriseos sunriseos deleted a comment from todo bot Dec 17, 2018
@sunriseos sunriseos deleted a comment from todo bot Dec 17, 2018
@sunriseos sunriseos deleted a comment from todo bot Dec 17, 2018
@sunriseos sunriseos deleted a comment from todo bot Dec 17, 2018
@sunriseos sunriseos deleted a comment from todo bot Dec 17, 2018
@sunriseos sunriseos deleted a comment from todo bot Dec 17, 2018
@sunriseos sunriseos deleted a comment from todo bot Dec 17, 2018
@sunriseos sunriseos deleted a comment from todo bot Dec 17, 2018
@sunriseos sunriseos deleted a comment from todo bot Dec 17, 2018
@sunriseos sunriseos deleted a comment from todo bot Dec 17, 2018
@sunriseos sunriseos deleted a comment from todo bot Dec 17, 2018
@sunriseos sunriseos deleted a comment from todo bot Dec 17, 2018
@todo
Copy link

todo bot commented Dec 17, 2018

Kernel heap memory management

Currently, if the kernel ever OOMs, this will lead to a panic. This is really not ideal. Unfortunately, we depend on a lot of Rust structures that make use of allocation (Arc, Vec, String...). Some of those have methods to customize OOM behavior (Vec and String have try_reserve), but some structures (like Arc) seem to be devoid of any function to avoid OOM.
Maybe we should approach the rust developers, see if they would accept a try_new function on Arc/Rc that would return an AllocErr if it fails.
Alternatively, we could start using our own Arc/Rc forks.


https://github.com/roblabla42/KFS/blob/e83bf63b8b517769060ca708e1b7a6f90b264339/kernel/src/heap_allocator.rs#L108-L118


This comment was generated by todo based on a TODO comment in e83bf63 in #90. cc @roblabla.

@todo
Copy link

todo bot commented Dec 17, 2018

gdt::get_main_iopb does not prevent creation of multiple mut ref.

There's currently no guarantee that we don't create multiple &mut pointer to the IOPB region, which would cause undefined behavior. In practice, it should only be used by `i386::process_switch`, and as such, there is never actually two main_iopb active at the same time. Still, it'd be nicer to have safe functions to access the IOPB.


https://github.com/roblabla42/KFS/blob/e83bf63b8b517769060ca708e1b7a6f90b264339/kernel/src/i386/gdt.rs#L189-L199


This comment was generated by todo based on a TODO comment in e83bf63 in #90. cc @roblabla.

@todo
Copy link

todo bot commented Dec 17, 2018

Don't panic in Session::reply if active_request is not set.

Session::reply currently asserts that an active session is set. This assertion can be trivially triggered by userspace, by calling the reply_and_receive syscall with reply_target set to a Session that hasn't received any request.


https://github.com/roblabla42/KFS/blob/e83bf63b8b517769060ca708e1b7a6f90b264339/kernel/src/ipc/session.rs#L331-L338


This comment was generated by todo based on a TODO comment in e83bf63 in #90. cc @roblabla.

@todo
Copy link

todo bot commented Dec 20, 2018

Don't panic in Session::reply if active_request is not set.

Session::reply currently asserts that an active session is set. This assertion can be trivially triggered by userspace, by calling the reply_and_receive syscall with reply_target set to a Session that hasn't received any request.


https://github.com/roblabla42/KFS/blob/7d5bf239fbddadd38f2c8b7abbd70fd9fa785af4/kernel/src/ipc/session.rs#L332-L339


This comment was generated by todo based on a TODO comment in 7d5bf23 in #90. cc @roblabla.

@todo
Copy link

todo bot commented Dec 20, 2018

Don't panic in the oom handler, exit instead.

Panicking may allocate, so calling panic in the OOM handler is a terrible idea.


https://github.com/roblabla42/KFS/blob/7d5bf239fbddadd38f2c8b7abbd70fd9fa785af4/libuser/src/lib.rs#L96-L102


This comment was generated by todo based on a TODO comment in 7d5bf23 in #90. cc @roblabla.

@todo
Copy link

todo bot commented Dec 20, 2018

Don't panic in Session::reply if active_request is not set.

Session::reply currently asserts that an active session is set. This assertion can be trivially triggered by userspace, by calling the reply_and_receive syscall with reply_target set to a Session that hasn't received any request.


https://github.com/roblabla42/KFS/blob/adee47274ba5c0dc0ef112ce8933becd63d3da77/kernel/src/ipc/session.rs#L332-L339


This comment was generated by todo based on a TODO comment in adee472 in #90. cc @roblabla.

@todo
Copy link

todo bot commented Dec 20, 2018

Don't panic in the oom handler, exit instead.

Panicking may allocate, so calling panic in the OOM handler is a terrible idea.


https://github.com/roblabla42/KFS/blob/adee47274ba5c0dc0ef112ce8933becd63d3da77/libuser/src/lib.rs#L96-L102


This comment was generated by todo based on a TODO comment in adee472 in #90. cc @roblabla.

@roblabla
Copy link
Member Author

Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants