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

[WIP] Basic Userspace #81

Draft
wants to merge 18 commits into
base: development
Choose a base branch
from
Draft

[WIP] Basic Userspace #81

wants to merge 18 commits into from

Conversation

Restioson
Copy link
Member

This PR will add a basic userspace to flower -- just enough to jump into userspace (in code located inside the kernel) and do some things there. It will not add program loading or elf parsing,

@Restioson Restioson mentioned this pull request Apr 28, 2019
12 tasks
let iomap_addr = (&tss.iomap) as *const _ as usize;
let iomap_base = (iomap_addr - tss_addr) as u16;

tss.tss.get_mut().iomap_base = iomap_base;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that this approach works. The iomap_addr points to your local stack frame, which is no longer valid after the function returns.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does work, as the iomap base is relative to the TSS start address's. This is why it is iomap_addr - tss_addr. Otherwise yes, it wouldn't work.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah sorry, I confused RefCell and Rc and thought that the tss lived on the heap.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I may have forgot to add the size of the TSS. Not sure if that's needed... In testing it has worked though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, I don't, nvm.

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

Successfully merging this pull request may close these issues.

2 participants