-
Notifications
You must be signed in to change notification settings - Fork 5
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
base: development
Are you sure you want to change the base?
Conversation
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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
…ve -- I think)" This reverts somes lines of commit 3894986
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,