Git Product home page Git Product logo

Comments (42)

PeyTy avatar PeyTy commented on July 17, 2024 1

I'll leave this here, because this page is what Google shows for "xorriso windows"

https://github.com/PeyTy/xorriso-exe-for-windows

from book.

steveklabnik avatar steveklabnik commented on July 17, 2024

I propose we get together a .zip package containing all the tools needed to start kernel developing.

I like this idea.

from book.

LaylBongers avatar LaylBongers commented on July 17, 2024

Added a note on qemu, redistributing it probably is more trouble than it's worth. It's easily installed and isn't just a simple single executable.

from book.

LaylBongers avatar LaylBongers commented on July 17, 2024

I've found more online references to GRUB2 being build-able under windows Cygwin, it may be worth a try but it will definitely take more time than I have spare for this week.

from book.

LaylBongers avatar LaylBongers commented on July 17, 2024

I've stopped working on getting a toolset together for windows, as I switched to Arch myself. I still think a pre-packaged set of tools would be useful to have however.

from book.

feliwir avatar feliwir commented on July 17, 2024

I use Msys2 windows 10 which allows to use the package manager pacman. Every required binary can be installed using: pacman -S mingw-w64-x86_64-(binary) (e.g. pacman -S mingw-w64-x86_64-nasm). The only missing binary i have right now is grub-mkrescue, but I'll ask the msys2 maintainers if they might be so kind and add it as a package

EDIT:
I've build grub2 binaries myself using msys2. Which doesn't really work, so you might want to try something else than grub-mkrescue to create the iso on windows

from book.

LaylBongers avatar LaylBongers commented on July 17, 2024

The problem is that the binaries you need are special ones compiled just for cross-compiling. Installing mingw-w64-x86_64-gcc will not give you a gcc capable of creating a kernel.

from book.

feliwir avatar feliwir commented on July 17, 2024

yeah, but on mingw it is no problem to compile gcc (or any other package for that matter) as a cross compiler. Also multirust is official supporting msys2 as buildsystem, see the multirust repository. I've also found official grub2 binaries for windows: ftp://alpha.gnu.org/gnu/grub/grub-2.02~beta2-for-windows.zip . They contain grub-mkimage and grub-mkstandalone but not grub-mkrescue for some reason, so maybe it would be viable to use those commands instead of grub-mkrescue?
By the way where exactly is gcc required to build the kernel?
Isn't it just enough to do: multirust add-target x86_64-unknown-linux-gnu ??

from book.

LaylBongers avatar LaylBongers commented on July 17, 2024

Most of this seems to have become irrelevant with the introduction of ubuntu userspace in windows 10.

from book.

steveklabnik avatar steveklabnik commented on July 17, 2024

Yes, it's certainly much easier with it. That said, Windows 10 is pretty new, so can we really assume it?

from book.

rylev avatar rylev commented on July 17, 2024

Having used the subsystem a little bit, I can tell you it's still quite rough. I would be careful relying on it for now.

from book.

ncarrillo avatar ncarrillo commented on July 17, 2024

There's currently a bug blocking rustc from running on Windows: microsoft/WSL#258

from book.

amanuel2 avatar amanuel2 commented on July 17, 2024

Anyone succeded on doing this? grub-mkrescue? ...

from book.

feliwir avatar feliwir commented on July 17, 2024

Yes it works without any issues on bash for windows. For grub-mkrescue you need to install the package "grub2-common"

from book.

amanuel2 avatar amanuel2 commented on July 17, 2024

No. I want for cygwin so i can get it for , school since it will be portable

from book.

feliwir avatar feliwir commented on July 17, 2024

grub-mkrescue can't be compiled with cygwin or msys, so no it isn't possible

from book.

amanuel2 avatar amanuel2 commented on July 17, 2024

Hmm Are you sure? Because last time it was more like "grub cant be compiled in windows" . Turns out , it can.

from book.

feliwir avatar feliwir commented on July 17, 2024

Grub itself can be built, but last time i checked on msys grub-mkrescue didn't compile. You can of course get the sources and check for yourself

from book.

amanuel2 avatar amanuel2 commented on July 17, 2024

@feliwir hmm dosent seem it dosent , im just gonna change to windows bash

from book.

feliwir avatar feliwir commented on July 17, 2024

@amanuel2 yes thats by far the easiest&best solution for os development on windows right now

from book.

amanuel2 avatar amanuel2 commented on July 17, 2024

@feliwir yep , i just builded it. Well , right now trying to figure out how to create your own pure cout << like object using namespaces

from book.

LaylBongers avatar LaylBongers commented on July 17, 2024

Perhaps this should be closed in favor of a guide for setting up Ubuntu on Windows for kernel development? It's going to be a better experience in almost every way than messing your way around windows itself.

from book.

amanuel2 avatar amanuel2 commented on July 17, 2024

@LaylConway No dont close it.. If any other people have question they can always ask!

from book.

LaylBongers avatar LaylBongers commented on July 17, 2024

@amanuel2 This is an issue focused on solving a specific problem with the guide, not an open-ended Q&A issue.

from book.

amanuel2 avatar amanuel2 commented on July 17, 2024

@LaylConway Yea , and? Btw checkout https://github.com/Bone-Project/BoneOS

from book.

LaylBongers avatar LaylBongers commented on July 17, 2024

This isn't the time or the place for advertising projects. My point is that this issue isn't meant to be for asking questions, it's for exploring and implementing a specific solution to a certain problem. Given that by now the problem has moved I'm closing this issue as it's not relevant anymore.

from book.

ketsuban avatar ketsuban commented on July 17, 2024

I disagree with this issue being closed - while the Linux subsystem on Windows 10 can and should be the primary recommendation for following intermezzOS due to ease of use, it mustn't be the only one. Not everyone is on Windows 10, for one - I used to be, but starting with Insider Preview build 14958 it bluescreens so frequently on my machine that I can't even finish installing/upgrading. I ended up going back to Windows 7.

Fortunately setting things up on Windows seems mostly doable with only instructions on installing MSYS2 and cross-compiling Binutils. The bit I haven't yet worked out is how to get grub-mkrescue.

from book.

steveklabnik avatar steveklabnik commented on July 17, 2024

@ketsuban I actually use Windows as my primary platform now, and so have wanted to make stuff work regardless.

from book.

AlexandreRouma avatar AlexandreRouma commented on July 17, 2024

Hey guys, I might come a bit late, but it IS possible to build an ISO using grub-mkrescue on windows !
To do it you will need an Ubuntu 16.04 machine (virtual or not, doesn't matter) and copy the folder /usr/lib/grub/i386-pc to the /usr/lib/grub folder on Bash For Windows. It's as easy as that !

I've asked the guys at LSW to include an option to download the grub binaries, hope they will add that in the future !

from book.

LaylBongers avatar LaylBongers commented on July 17, 2024

If you have bash-for-windows, you can just apt-get install grub-pc-bin iirc

from book.

AlexandreRouma avatar AlexandreRouma commented on July 17, 2024

If you have bash-for-windows, you can just apt-get install grub-pc-bin iirc

Tried that and sadly it fails :/
Might be a problem with my LSW though

from book.

steveklabnik avatar steveklabnik commented on July 17, 2024

Bash For Windows.

I did get stuff working on Bash for Windows, but I'd also like a native build. intermezzOS/kernel#118

from book.

Restioson avatar Restioson commented on July 17, 2024

Hi! I might take a look at getting this to work. I came up with a few ways to help reduce dependencies:

  1. Switch over from Make to a python build script (python is very readily available for windows). I have this almost finished in my clone locally.
  2. Switch from nasm to the global_asm macro. Also done in clone locally.
  3. Switch from an explicit invocation of ar to letting rustc do it for us. I'm a bit confused about this one - the book does not use ar. Any help would be appreciated here.

Grub does distribute files from their ftp server for windows. Here's what it contains: https://i.imgur.com/qmzazD9.png.
Unfortunately, this does not include grub-mkrescue. It does include grub-mkimage though. Maybe this is similar/a subsitute?

from book.

feliwir avatar feliwir commented on July 17, 2024

No, it’s not a valid substitute. I think the author knows about those grub binaries for windows already

from book.

Restioson avatar Restioson commented on July 17, 2024

Ok. I think with the changes I've proposed just qemu and grub-mkrescue will be required.

from book.

steveklabnik avatar steveklabnik commented on July 17, 2024

I am a fan of reducing dependencies; ideally, someday, this would all be 100% rust and just use cargo. one motivation is for exactly this kind of cross-platform issue.

@Restioson I'd be interested in seeing your diffs. My rough feels:

  1. I'd rather switch to say, a custom Cargo subcommand in Rust than add a Python dependency.
  2. Getting rid of nasm would be excellent πŸ‘
  3. "Switch from an explicit invocation of ar to letting rustc do it for us" I... am not sure what this is.

reducing dependencies is good, even if we can't get 100% of the way there.

from book.

Restioson avatar Restioson commented on July 17, 2024

I haven't finished completely. I'm mostly done, except I don't know what the invocation of ar is for... see response to 3

  1. Perhaps a justfile/cargo make or something similar? I just pulled python out of thin air since rustc uses a python buildscript too and it was easy for me to prototype.
  2. Personally, I'm not really sure what the invocation of ar in the build.rs does :L. The book only mentions ld. I think rustc should be able to do most of this for us anyway. Theoretically we can just build it as a library crate with a custom layout.ld

from book.

steveklabnik avatar steveklabnik commented on July 17, 2024

Personally, I'm not really sure what the invocation of ar in the build.rs does

OH! I remember now, sorry. So, I was trying to replace some of the make stuff with build scripts to get rid of make.

HOWEVER

At the same time you popped up, this happened over on the kernel repo: intermezzOS/kernel#118 (comment)

I think working toward adopting phil's stuff is probably the best path forward, as it completely eliminates all of this.

from book.

Restioson avatar Restioson commented on July 17, 2024

Ooh, that looks super nice! I totally agree, I'm just wondering how images to run in qemu will be built... Does his bootloader project include something that could help with that? I think we still need to get rid of make and perhaps replace it with Cargo-make or Just.

from book.

Restioson avatar Restioson commented on July 17, 2024

Looks like it should be able to support building a bootable image with help of objcopy.

from book.

steveklabnik avatar steveklabnik commented on July 17, 2024

The output of bootimage --target produces a bootimage.bin that's runnable. bootimage does all the work of invoking cargo, etc, so that's just one command to build, no need for make or anything :)

from book.

steveklabnik avatar steveklabnik commented on July 17, 2024

The second edition now builds on Windows: https://ci.appveyor.com/project/steveklabnik/kernel (still gotta fix gnu, but that's a different issue and I'll deal with it soon).

I'm not working on the first edition anymore, so I'm going to give this a close. If someone wants to send in a PR to fix up the first edition, please feel free, but it seems like a lot of effort for very little reward.

from book.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.