intermezzOS / kernel

A hobby operating system, in Rust
http://intermezzos.github.io/
Apache License 2.0
1.39k stars 90 forks source link

Build on Windows without the WSL #118

Closed steveklabnik closed 6 years ago

steveklabnik commented 6 years ago

One major thing holding back intermezzOS development is that I'm on Windows now. Getting a native windows build would be key.

http://forum.osdev.org/viewtopic.php?f=1&t=27605 might be a part of the puzzle.

feliwir commented 6 years ago

What's wrong with WSL? I do all my OS development like that

steveklabnik commented 6 years ago

Nothing's wrong with it, but I don't use it, and neither do many others. it already builds just fine under the WSL, but it's a big dependency.

On Sun, Dec 10, 2017 at 3:30 PM, Stephan Vedder notifications@github.com wrote:

What's wrong with WSL? I do all my OS development like that

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/intermezzOS/kernel/issues/118#issuecomment-350579234, or mute the thread https://github.com/notifications/unsubscribe-auth/AABsisNVwsqKfQsGJLleIZk3INGbnO-fks5s_D9dgaJpZM4Q4MPP .

LaylBongers commented 6 years ago

Could something like this be an option? https://github.com/phil-opp/blog_os/tree/master/docker

It's still a big dependency (likely bigger than WSL) but it's probably easier to set up.

steveklabnik commented 6 years ago

It's another option, but I still expect a native windows build.

steveklabnik commented 6 years ago

I am personally giving up on this in the interest of being able to move forward with the project again. I'd still love to have this, but it's basically blocking me from getting anything done, which is causing a lack of movement on the project overall.

The perfect is the enemy of the good.

phil-opp commented 6 years ago

I'm currently working on a second edition of the Writing an OS in Rust series, which will work natively on Linux, Windows, and macOS. Instead of GRUB, we use an own bootloader written in Rust inline assembly. This bootloader already does most of the setup (e.g. the switch to long mode), so that the tutorials can start at the Rust level and nasm is no longer needed. We also use LLD for linking, which is now shipped with Rust, so everything should work out of the box. Maybe this is useful for intermezzOS too.

The basics are nearly done, there is just one last issue that LLD is not found on macOS: https://github.com/rust-lang/rust/issues/48772. For Windows, it should work already (the CI is green at least). I plan to write a blog post on this as soon as the macOS build works too.

You can try the new edition at https://os.phil-opp.com/second-edition/. Beware that this is still beta content and things might change in the future. If you have any feedback, please tell me (e.g. in phil-opp/blog_os#360).

steveklabnik commented 6 years ago

oh my @phil-opp !!!!!!

That is super amazing. Given that I was already adapting the bootloading stuff from you before, maybe I should port to that when it's ready.

At the moment, I'm trying to sort out how to find time in my schedule to work on intermezzOS generally, and to get back into the swing of things. The combo of switching to Windows and expending all of my writing energy really set intermezzOS back over the last year, but now that that's winding down, I'm really eager to start writing code again.

Are you planning on documenting the bootloader, etc? or are you gonna keep it a black box? I'll have to consider how I feel about this for intermezzOS's goals; I'm of two minds. It'd be amazing to get started without any asm, but knowing how that stuff works is good. At the same time, we also treat GRUB/etc as a black box, so this is really just shifting that boundary slightly.

We also use LLD for linking, which is now shipped with Rust,

I was wondering about this, but since alex described it as "for the wasm target only" I wasn't sure if there was a way to use it otherwise, and hadn't had the time to dig in. So exciting!

phil-opp commented 6 years ago

Awesome to see you back at osdev!

Are you planning on documenting the bootloader, etc?

Yes, I'm planning a small “Writing a Bootloader” sub-series, linked from the main post. So people can look behind the curtain if they like, but are not forced to write assembly right at the beginning. It will take some time to write this, since the bootloader is just a hacky prototype at the moment, but I definitely plan to do it.

steveklabnik commented 6 years ago

Awesome to see you back at osdev!

<3

It will take some time to write this, since the bootloader is just a hacky prototype at the moment, but I definitely plan to do it.

Cool. I want to talk it over with @ashleygwilliams but, the more I think about it, the fact that we treat GRUB as magic means that I think we should treat this as magic, and just point to that. If you'd like a hand, please let me know! I don't know much about the details of bootloaders, but I'd be happy to try to pitch in if you'd like it. I gotta give back somehow