Writing an OS in Rust - Part 1 - A Freestanding Rust Binary
Вставка
- Опубліковано 16 лис 2024
- This is my version of Philipp Oppermann's "BlogOS". It's a baremetal operating system that can boot off of a USB stick on any BIOS-compatible machine, which is pretty amazing. I'm going to be following the whole blog, one video at a time, and running the OS using QEMU instead of booting a physical machine. Just to keep things simple.
Full playlist: • Rust OS
Livestream: / unclescientist
This first video goes through the basics of creating a standalone (or "freestanding" to use the terminnoloy in the blog post) executable in Rust, eschewing the rust startup code, the libc requirement, and even the rust standard library.
See os.phil-opp.com/
#rust #rustos #blogos #rustlang
It's kinda odd to me that a video about writing an OS from scratch is this relaxing to watch
I’ll have to work on my ASMR voice
Are intel amd cpus only designed for uefi, or can they be adapted to other alternatives from uefi & legacy bios? @@UncleScientist
@@jirehla-ab1671 uefi is a specification, so it's not tied to a particular cpu
Yt algorithm blessed me to find this channel
Yt algorithm blessed me to find this channel
I’m going to have many long nights with these videos. Wish me luck.
Everything, from your channel profile, to your voice, workspace and skills. Zen 10/10
Im so glad i found someone going over this website in a video. I'm not a very good reader so having someone talk over it is super helpful!
ye, same. (ye = yes/yeah a internet slang term for an expression of "yes" commonly used among gen z)
Perfect background video to have on while I write mediocre js
Comment to feed the algo. Great video for an OG who want to dabble in Rust + OS ! Thank you for all the hard work and great documentation. Much appreciated.
Comment to make youtube happy. Good luck.
Oh my you're a madlad
I really enjoyed this
1:51 they are doing that and its called relibc
Nice, finally found this.
Came by to check the comment section to remind myself that there are people just immune to suffering of this world.
you are my god now
what a chad
ah shit now I'm gonna have to do this
Note: if you do use an arm system you could technically get away with using the first step most likely; otherwise you’d need to remake your own version to work for the new Apple chipsets…
Can't it be cross compiled ? I know this might be stupid but im new to it
@@vikramvikram3726 Arm and x86 are both different so he have to make for arm as well
how did you manage this with no assembly at all
amazing!
nice music
What is the difference beetwen cargo new and cargo new --bin?
The "--bin" argument is default, so "cargo new xyzzy" by default creates a binary project. See doc.rust-lang.org/cargo/commands/cargo-new.html for more details
@@UncleScientist thanks
glad ibfound you really powerful mehn u the best
When you ran `cargo build --target !$`, can you help me understand what `!$` means?
Yeah, it's not exactly google-friendly. The "!$" means "replace me with the last item from the previous command. In this case, my previous command was "rustup target thumbv7em-non-eabihf", so that means !$ was replaced by "thumbv7em-non-eabihf". If you look at the line immediately following where I entered "cargo build --target !$", you'll see the *actual* cargo build line that the command saw. See zsh.sourceforge.io/Doc/Release/Expansion.html under section 14.1.3 for more details
@@UncleScientist Thanks for the clear explanation! Makes sense now! (And, yes…not so Google-friendly indeed 😅)
if you don't want to type out the target every time, you can just create a script file and put the command in there instead, then run that script instead of cargo build
e.g. I created a batch file in the OS directory called "cargo.bat" (bc I'm on windows) that says "cargo build --target thumbv7em-none-eabihf" and now in cmd.exe, in the OS directory, I type "build.bat" instead of "cargo build"
and I did the same with the run command
also, you can add a ".cargo/config.toml" off your main working directory, that allows you to set some defaults when running cargo build. i think the entry youd use for this is
[build]
target = "..."
i am stuck in installing rust in my windows is there any tutorial you could give me to do it
You should be able to install rust for windows using these instructions rustup.rs/
Can every operating system be rewritten in Rust?
yes
might sound like an odd question... but can someone who doesnt know rust follow along with this?
it's not really a rust teaching book, but if you know the basics of programming, you shouldnt' have any problem following along
Thank you! @@UncleScientist
Goood
might as well contribute to redox OS, instead of writing it up from scratch
this stream was more about learning how OS's work than creating an actual OS, but thanks for the tip about redox - i checked it out and it looks interesting. maybe i could stream a PR for it at some point
Great content, well presented. Would be much better without the irritating background music. If it were not for that I would subscribe.
Appreciate the feedback - some of the videos are music-free, so maybe you would enjoy those?
@@UncleScientist Ok, cool. I will continue to follow.
good video, i want to donate
Thanks! I don’t have anything set up for donations outside of twitch, but I very much appreciate the support
`eh_personality` means "Canadian"
p̶r̶o̶m̶o̶s̶m̶
SPEAK LOUDER
Yt algorithm blessed me to find this channel