Skip to content

[WIP] Basic Userspace#81

Draft
Restioson wants to merge 18 commits intodevelopmentfrom
basic-userspace
Draft

[WIP] Basic Userspace#81
Restioson wants to merge 18 commits intodevelopmentfrom
basic-userspace

Conversation

@Restioson
Copy link
Copy Markdown
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
Comment thread kernel/src/gdt.rs
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;
Copy link
Copy Markdown

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
Copy Markdown
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.

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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