Skip to content
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

32-bit support (with Multiboot2) #70

Open
bjorn3 opened this issue Jul 31, 2019 · 6 comments
Open

32-bit support (with Multiboot2) #70

bjorn3 opened this issue Jul 31, 2019 · 6 comments

Comments

@bjorn3
Copy link
Contributor

bjorn3 commented Jul 31, 2019

cc phil-opp/blog_os#403 (comment).

@Mendess2526 let's continue the discussion here.

This will need src/stage_3.s to be adapted to stay in protected mode and to setup non-PAE page tables. It will then need at least changes to the rust part to handle non-PAE page tables.

@ethindp
Copy link
Contributor

ethindp commented Jul 31, 2019 via email

@64
Copy link
Contributor

64 commented Jul 31, 2019

Yeah it would need to be a toggleable feature. We should support the multiboot2 protocol for this

@bjorn3
Copy link
Contributor Author

bjorn3 commented Jul 31, 2019

I hope this is togglable with a feature flag.

Shouldnt it just work when it is compiled for i686 instead of x86_64?

@64
Copy link
Contributor

64 commented Jul 31, 2019

Yeah that’s a good point. I think in the mean time it might be good to add some check in the build script that it’s being built for x86_64 (if that is even possible), otherwise error out and point to this issue

@64 64 changed the title 32bit support 32-bit support (with Multiboot2) Jul 31, 2019
@phil-opp
Copy link
Member

phil-opp commented Aug 1, 2019

I think in the mean time it might be good to add some check in the build script that it’s being built for x86_64 (if that is even possible), otherwise error out and point to this issue

This should be possible through the CARGO_CFG_TARGET_ARCH environment variable, but only when the crate is used as a library. The binary compilation currently occurs for a fixed target specified in the Cargo.toml, but this could be easily changed by updating bootimage (e.g. by making the package.metadata.bootloader.target a (target_arch, target file name) map).

bors bot added a commit that referenced this issue Aug 5, 2019
72: Configurable kernel stack size, better non-x86_64 errors r=phil-opp a=64

Allows the configuration of the kernel stack size through an environment variable.

Also makes the errors a bit nicer if you try to use this crate from a non-x86_64 architecture (only works if you build it as a library), as discussed in #70.

Co-authored-by: Matt Taylor <mstaveleytaylor@gmail.com>
bors bot added a commit that referenced this issue Aug 5, 2019
72: Configurable kernel stack size, better non-x86_64 errors r=phil-opp a=64

Allows the configuration of the kernel stack size through an environment variable.

Also makes the errors a bit nicer if you try to use this crate from a non-x86_64 architecture (only works if you build it as a library), as discussed in #70.

Co-authored-by: Matt Taylor <mstaveleytaylor@gmail.com>
@ethindp
Copy link
Contributor

ethindp commented Aug 23, 2019

Personally I don't think we should support 32-bit at all. The only reason I can see this being required is running this on old hardware, and you have VMs for that. Now that you can chainload the bootloader (via grub, for example), you can (technically) run the system on "real" (virtual, but technically real) hardware. Its not physically real, but virtualized hardware, with a few changes here and there, is based off of at least a model of old hardware (i.e. the VMware BIOS implementation uses Phoenix BIOS, I think). 32-bit support overcomplicates a lot of things and would just bloat the code to unreasonable proportions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants