It's my first post. I'd appreciate your feedback :)
Hey, just a couple of points 1. Don't link the bootsector and the rest of your binary together. It's more trouble than it's worth, and if you ever progress to loading off a filesystem, then you won't be linking them together anyway. 2. You can use LBA addressing in real mode with int 13h (just specify a hard disk rather than a floppy when booting): https://wiki.osdev.org/ATA_in_x86_RealMode_(BIOS)#LBA_in_Ext... 3. Yo…
Booting to 'Hello Rust' on x86_64
11–20 of 37 posts
Re: Booting to 'Hello Rust' on x86_64
#12It's my first post. I'd appreciate your feedback :)
Re: Booting to 'Hello Rust' on x86_64
#13Earlier quoted context omitted.
Hey, just a couple of points 1. Don't link the bootsector and the rest of your binary together. It's more trouble than it's worth, and if you ever progress to loading off a filesystem, then you won't be linking them together anyway. 2. You can use LBA addressing in real mode with int 13h (just specify a hard disk rather than a floppy when booting): https://wiki.osdev.org/ATA_in_x86_RealMode_(BIOS)#LBA_in_Ext... 3. Yo…
I am extremely biased, but I’ve always found the rust tool chain far easier than the C ones, especially as a Windows user. No need to set up a cross compiler, given that rustc already is one, and is easy to add more targets to via the JSON target spec.
I just think that when starting out in kernel development, you're likely going to be dealing with linker scripts for likely the first time. It's been a while since I tried rust for this, but C generates pretty clean object files, so the linker scripts from the OSDev wiki can often be copied verbatim.
Re: Booting to 'Hello Rust' on x86_64
#14It's my first post. I'd appreciate your feedback :)
That or I'm very confused.
Re: Booting to 'Hello Rust' on x86_64
#15It's my first post. I'd appreciate your feedback :)
I think there's a typo in the final screenshot. It looks like your original code outputs "RM" (maybe "real mode" or "hello Rust" in a different language?), but the example source seems like it should output "HR." That or I'm very confused.
Re: Booting to 'Hello Rust' on x86_64
#16Re: Booting to 'Hello Rust' on x86_64
#17Re: Booting to 'Hello Rust' on x86_64
#18Re: Booting to 'Hello Rust' on x86_64
#19(This is linked near the end of the article, but I think it's worth pointing out.)
Full disclosure: I think he uses a library I wrote to initialize the keyboard controller.
Re: Booting to 'Hello Rust' on x86_64
#20Earlier quoted context omitted.
I am extremely biased, but I’ve always found the rust tool chain far easier than the C ones, especially as a Windows user. No need to set up a cross compiler, given that rustc already is one, and is easy to add more targets to via the JSON target spec.
A cross compiler is easy enough to set up with clang too (just specify the -target command line option). I just think that when starting out in kernel development, you're likely going to be dealing with linker scripts for likely the first time. It's been a while since I tried rust for this, but C generates pretty clean object files, so the linker scripts from the OSDev wiki can often be copied verbatim.
I don’t think that the linker script stuff ends up different but it’s been a minute since I started from scratch.