mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
Fix source path
This commit is contained in:
@@ -1047,7 +1047,7 @@ Since the size, pixel format, and memory location of the framebuffer can vary be
|
|||||||
The easiest way to do this is to read it from the [boot information structure][`BootInfo`] that the bootloader passes as argument to our kernel entry point:
|
The easiest way to do this is to read it from the [boot information structure][`BootInfo`] that the bootloader passes as argument to our kernel entry point:
|
||||||
|
|
||||||
```rust ,hl_lines=3 7-13
|
```rust ,hl_lines=3 7-13
|
||||||
// in src/kernel/main.rs
|
// in kernel/src/main.rs
|
||||||
|
|
||||||
use bootloader_api::BootInfo;
|
use bootloader_api::BootInfo;
|
||||||
|
|
||||||
@@ -1083,7 +1083,7 @@ For now, let's just try setting the whole screen to some color.
|
|||||||
For this, we just set every pixel in the byte slice to some fixed value:
|
For this, we just set every pixel in the byte slice to some fixed value:
|
||||||
|
|
||||||
```rust ,hl_lines=5-7
|
```rust ,hl_lines=5-7
|
||||||
// in src/kernel/main.rs
|
// in kernel/src/main.rs
|
||||||
|
|
||||||
fn kernel_main(boot_info: &'static mut BootInfo) -> ! {
|
fn kernel_main(boot_info: &'static mut BootInfo) -> ! {
|
||||||
if let Some(framebuffer) = boot_info.framebuffer.as_mut() {
|
if let Some(framebuffer) = boot_info.framebuffer.as_mut() {
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ We wrote some example code to display a gray background:
|
|||||||
[`BootInfo`]: https://docs.rs/bootloader_api/latest/bootloader_api/info/struct.BootInfo.html
|
[`BootInfo`]: https://docs.rs/bootloader_api/latest/bootloader_api/info/struct.BootInfo.html
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
// in src/kernel/main.rs
|
// in kernel/src/main.rs
|
||||||
|
|
||||||
fn kernel_main(boot_info: &'static mut BootInfo) -> ! {
|
fn kernel_main(boot_info: &'static mut BootInfo) -> ! {
|
||||||
if let Some(framebuffer) = boot_info.framebuffer.as_mut() {
|
if let Some(framebuffer) = boot_info.framebuffer.as_mut() {
|
||||||
|
|||||||
Reference in New Issue
Block a user