Conversation
And move the install instructions out, and fix them up.
| ``` | ||
|
|
||
| This is our main function, which is traditionally called `kmain()`, for 'kernel | ||
| main.' We need to use the `#[no_mangle] and `pub extern` annotations to indicate |
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.
Missing backtick after #[no_mangle].
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.
thanks!
| This is our main function, which is traditionally called `kmain()`, for 'kernel | ||
| main.' We need to use the `#[no_mangle]` and `pub extern` annotations to indicate | ||
| that we're going to call this function like we would call a C function. The `-> !` | ||
| indicates that this function never returns. And in fact, it does not: the body |
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.
Incorrect not in it does not.
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.
Hmmm, I think this is one of things things in which English is ambiguous.
And in fact, it does not return
is how I read this, but you're reading it as negating the "never 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.
Yes, could you change it to it does not return?
| In this case, the reason we need `unsafe` is the next two lines: we create a | ||
| pointer to `0xb8000`, and then write some numbers to it. Rust cannot know that | ||
| this is safe; if it did, it would have to understand that we are a kernel, | ||
| and understand the VGA specification. Having a programming langauge understand |
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.
s/langauge/language/
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 am the worst. thanks for finding these
|
Thanks everyone, I've addressed the nits. Also, I wrote an aside pointing to an example of a more DRY makefile. |
as discovered in intermezzOS/kernel#45, the focus on the .a wouldn't actually cause things to be rebuilt. This will.
|
I am too excited to get this merged, and so I'm going to go ahead and do it. If you didn't get the chance to check this chapter out yet, please open issues with anything you want to comment on! Still very happy to get feedback. |
Here's the next chapter! We finally have Rust code!