-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Comments for "https://os.phil-opp.com/minimal-rust-kernel/" #403
Comments
I'm not really a fan of using this magic utility to turn our blob of Rust into a bootable image. The parts in raw assembly in the first edition were a bit tedious but I liked how they gave us a deeper understanding about how the process worked. I hope that this utility won't be sticking around for the post on UEFI booting... |
"They are designed to make the bootloader simple instead of the kernel. For example, the kernel needs to be linked with an adjusted default page size, because GRUB can't find the Multiboot header otherwise." WRONG! That is true of Multiboot2, a later standard which is less used and NOT multiboot-compatible. However, the actual Multiboot standard does not have that problem at all. |
@Redrield Fair point. On the other hand we already used Apart from a less tedious start, the new bootloader gives us an opportunity for an even deeper understanding of the boot process than before: We're planning to write several posts on how the tool and the underlying bootloader works, in a similar fashion as the other posts (i.e. every line of code is in the post and you can follow along). Thus, we can hide the complexity at the beginning of the main post series and directly start with the more interesting part, but also provide resources to those who want to understand it all the way down. |
@pixelherodev Huh? I was under the impression that Multiboot2 was the successor of Multiboot? Either way, Multiboot 1 is not a better solution for us since it does have other problems (if I remember correctly it does not support 64-bit ELF files at all). |
Fair enough. Multiboot 2 is essentially the spiritual successor to multiboot IIRC.
I also remember multiboot being easier to get started with, but that's neither here nor there :p
Honestly, while I don't think ignoring multiboot was a good idea, I can understand why you did so.
|
Yeah, there are clear tradeoffs in this case. I really like the idea behind multiboot, but the standard and the implementation not so much. I plan to add grub compatibility to the bootimage tool, so that you can boot it in a multi-OS setting too. |
First of all, great tutorial, thanks a lot for the effort! |
@FuzzyHerbivore Thanks a lot! I added a hint to the post in 5f195a8. |
Disclaimer: I'm on Windows. There is a problem with running Also, converting to a VDI for VirtualBox doesn't seem to work. I get:
|
@kyle I'm also using Windows with cargo 1.26.0 nightly and xargo 0.3.11. Are these the same versions for you? I'm stuck with building using xargo:
Using cargo 1.26.0 nightly and xargo 0.3.11. |
@kylegalloway sorry |
Feeling a little silly, still stuck on the above, but realised I was setting the path incorrectly. The following steps still fail:
These are always with the multiple input filenames provided error. Apologies for the multiple posts. |
I pushed a new version of the bootloader yesterday, seems like this is the cause of the error. I reverted the change for now, so it should work again. Thanks for reporting!
Hmm, I have no idea about this error. I only found https://forum.lede-project.org/t/error-convert-img-to-vdi/152, which indicates that the image needs to be padded somehow before converting. |
@AaronCoad Strange, I've never seen this error. Could you try it with |
Hi, I have a little problem with bootimage.
But when I run it with --release flag everything works properly. Why could it happen? .S my host OS is Kubuntu 17.10 |
@SomeAnotherDude Sounds like a problem in the bootloader. Do you have your project online somewhere so that I can try to reproduce? |
@phil-opp I gave it another whirl today and identified the issue and alerted xargo's developers to it. On my main machine my windows user account name has a space in it, so the folder path to .xargo also contains a space. Because the folder path isn't passed through to Qemu reportedly has a bug for Windows as well in their latest version that was identified on March 22 and they're pushing a fix into rc1. http://lists.gnu.org/archive/html/qemu-devel/2018-03/msg05484.html @kylegalloway now that I'm at that point, with VirtualBox 5.2.8 you get a more verbose error of "The given disk size 85992 is not aligned on a sector boundary (512 bytes)". |
@phil-opp It's a miracle! when I clone this repo from github and try to reproduce... It just works... |
There was something wrong with ${progect_root}/target directory. Just after I deleted it and rebuilt the project the problem is gone. |
@SomeAnotherDude Ah, it's probably because the bootloader is cached in the @AaronCoad Good job in pinpointing the
Oh, this is something we can fix in |
VirtualBox requires 512-byte aligned disks. Reported in phil-opp/blog_os#403 (comment)
@AaronCoad @kylegalloway I updated |
@AaronCoad I opened japaric/xargo#207 for the |
@phil-opp thankyou. I've tested the bootimage change and it is now just the invalid size error. Based on some other reported instances, it looks like it may be that VirtualBox looks for a minimum size. I reckon once it gets over that size it should convert no worries. In the meantime, I've just setup an Ubuntu VM so that I can use qemu and look at translating and merging some of the older sections into what I've got. |
@phil-opp The new bootimage worked for me on the qemu command. Thanks for the help! |
@AaronCoad @kylegalloway Cool, thanks for testing! |
I'm getting an error when I run
|
@AbleTheAbove Are you sure that you're using the |
"target may not be installed" when running to resolve: continue with |
I'm getting this error
Can anyone please help me out to resolve this error? |
@bishtpawan ^^ comment right above yours. continue with the |
Thanks, @delta1 for your response, I updated the rustup and the problem is resolved now. |
I am getting this error when running
|
Hi @OscarTHZhang, well I'm not sure about MAC but can you share the command that you are using to run your bootable image in Qemu? |
It lookslike the libnettle dependency of qemu is not installed on your system. |
This is the command I ran:
|
I checked my system and I do have |
@OscarTHZhang try |
Nice. I reinstall nettle and qemu and then it works! Thank you so much! |
Hello, thank you for this great series. Is this still planned? Or is this perhaps depended on rust-osdev/bootloader#24? |
For windows people like myself: The process for creating bootimage worked as written in the guide. I didn't have qemu so I chose to test with virtualbox:
Hope this helps someone! |
I followed the instructions, installed rust-src, and ran the build after cloning the repository, and I still get an error that the crate for std cannot be found. It only happens when I try to install bootimage. |
@r00ster91 I already started writing about creating an UEFI bootloader in the upcoming third edition of the blog. I'm not sure when there will be post about BIOS booting, but it probably makes sense to wait for rust-osdev/bootloader#24 as it will simplify some things. |
@hello01-debug
Could you post a link to your code so that we can look into your issue? |
Sure, as soon as I can.
…________________________________
From: Philipp Oppermann ***@***.***>
Sent: Tuesday, April 27, 2021 5:17 AM
To: phil-opp/blog_os ***@***.***>
Cc: Ilari, Ryan Nathaniel ***@***.***>; Comment ***@***.***>
Subject: Re: [phil-opp/blog_os] Comments for "https://os.phil-opp.com/minimal-rust-kernel/" (#403)
[EXTERNAL EMAIL - Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.]
@hello01-debug<https://github.com/hello01-debug>
I followed the instructions, installed rust-src, and ran the build after cloning the repository, and I still get an error that the crate for std cannot be found. It only happens when I try to install bootimage.
Could you post a link to your code so that we can look into your issue?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#403 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ANPNOP73YB7PDJTA2YA6YPTTKZ6LXANCNFSM4EUUEX3A>.
|
Starting from scratch and noticing this problem with bootloader 0.10.2 ― host OS is Fedora Rawhide and Rust version is 1.54.0-nightly (4de757209 2021-05-01):
Particularly bizarre since I'm following this to the T and it worked fine last year. Oh, and obviously 0.10.2 > 0.5.1. |
This blog post needs to be updated for bootloader 0.10.x. Causing way too many problems. Case in point, after following the updated docs.rs/bootloader instructions:
This is from attempting to add
So either there’s a bug in the code that’s looking for the wrong target or this post needs to be fundamentally overhauled. |
@phil-opp is currently working on a third edition of blog os that uses bootloader 0.10.x. This is taking a while as there are major changed between 0.9.x and 0.10.x to support not just BIOS booting, but also UEFI. In addition UEFI requires APIC (advanced programmable interrupt controller) instead of the legacy PIC that is currently used by blog os. For now you may want to stay on bootloader 0.9.x. |
Alright, guess I’ll just have to patiently wait until that new edition comes out, thanks. |
|
wait shoot, the quotes went down too far. But yea, I encountered the same problem, and I put the src on github at the link above |
@InterestingBrainPoops I just tried your code and it compiled fine using the following build command:
Instead of these command line parameters, you can also create a |
Hi, I had the same problem, I was able to solve it by:
It seems that there is a problem after version 0.9.18 of the bootlader crate |
Really loving reading this blog. For anyone else who is a bit nervous about using brew/macports on MacOS (to get qemu), I managed to get qemu working in an Ubuntu guest with VMware Fusion. Setting up VS Code for Rust in Ubuntu is also simple; so it ends up being a nice developer experience. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
This is a general purpose comment thread for the “A Minimal Rust Kernel” post.
The text was updated successfully, but these errors were encountered: