-
Notifications
You must be signed in to change notification settings - Fork 3
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
Refactor/add hal as datastructure #148
base: main
Are you sure you want to change the base?
Conversation
d91ff9d
to
3388641
Compare
5616c9b
to
bd7612f
Compare
120894e
to
012f9aa
Compare
79d0437
to
bf53293
Compare
3382a7c
to
d1320cd
Compare
|
||
gic.init_distributor(); | ||
|
||
gic | ||
} | ||
|
||
pub fn disable_interrupts(&mut self) { |
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.
&mut
encoded the fact that this would have side-effect in a way. Let's see how it goes in practice then
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 stopped doing that because having global mutables is a nightmare.
kernel/src/generic_main.rs
Outdated
let (gicd_base, gicc_base) = (0x800_0000, 0x801_0000); | ||
HAL.kpt().lock().identity_map_range( | ||
VAddr::new(gicd_base), | ||
0x0001_0000 / HAL.page_size(), |
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 would rather have a calculus or a const than just 0x0001_0000
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.
A calculus ?
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.
Looks like this comment was on an older version of this branch which was mistakenly pushed, I pushed the actual revision.
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.
(te current code does this by looking up the gic node in the device tree)
hal::mm::enable_paging(); | ||
log::trace!("going to enable paging..."); | ||
HAL.enable_paging()?; | ||
log::trace!("enabled paging !"); |
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.
"paging enabled !"
@@ -7,7 +6,7 @@ use log::error; | |||
fn panic(info: &core::panic::PanicInfo) -> ! { | |||
error!("\x1b[31mkernel panic\x1b[0m: {}", info); | |||
|
|||
error!("hal panic info: {:X?}", hal::panic_info()); | |||
error!("hal panic info:"); // {:X?}", hal::panic_info()); |
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.
Why ':' if we don't print anything else
Taken from rust, very minor modifications on my side.
d1320cd
to
9a30ec0
Compare
registers::set_sscratch(core_id); | ||
} | ||
fn core_id() -> usize { | ||
// Early kernel code called Self::init and putthe core_id argument into the sscratch. |
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.
// Early kernel code called Self::init and putthe core_id argument into the sscratch. | |
// Early kernel code called Self::init and put the core_id argument into the sscratch. |
No description provided.