-
Notifications
You must be signed in to change notification settings - Fork 214
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
Support for other architectures #299
Comments
I don't have plans to port the crate to other CPU architectures right now, but I would like to see this as well! As far as I know, @tsoutsman is currently working on an UEFI bootloader for the Theseus OS project with the goal to support both x86_64 and aarch64 booting. Maybe they can use some help? (As a side note, I would love to integrate this into the |
Yea, the UEFI bootloader supports I would love to upstream the changes (especially considering a lot of the code is taken from The big changes that were necessary for the bootloader to work on Theseus were:
Only the first point would be a significant hurdle to overcome, which is more a problem with Theseus than the bootloader. Ideally, I'd make Theseus work when loaded at an arbitrary physical address, at which point I could port the changes from
The way I approached it in You could start by doing a similar thing for this repo. |
Interesting, so you load the kernel directly at the physical address specified in the ELF file? What happens if that address is already in used or not available (e.g. marked as reserved by the hardware)?
We have an open PR at #302 that tries to do something similar, but limited to a single file. Maybe we should generalize this to allow multiple, arbitrary files...
You mean a list of all the sections and their start addresses and sizes? I'm fine with adding something like this. |
You only need to point to the program header (and if you relocate, the offset by which it was relocated), right? Then the kernel itself can parse the program header to find the location of each segment as well as other program table entries (like the dynamic table location, notes, ...) if necessary. This is what is done on for example Linux for userspace programs to allow the dynamic linker access to this information. |
We give up. It's a problem in Theseus that needs to be fixed.
FWIW here's my janky implementation. It iterates over a directory called
Theseus specifically needs the section headers, which it has no way of accessing since AFAICT the section header table/ I don't think it can parse the program headers because they wouldn't be loaded, either. |
You can write a linker script that marks the section table as allocated and thus produces a load segment for it. I can understand that it is less convenient though.
They are loaded by default. Here
The first |
Do we really want to load multiple files? Would some kind of image file do instead? Trade off thoughts comment here: #302 (comment) |
I assume the idea is that the archive is more like concatenating multiple files together + some metadata to know where the individual members start and end (and possibly a name), where this archive is parsed by the bootloader and then each individual member is passed separately to the kernel. Not a full fledged filesystem with directories, timestamps and security information. If you want that you did still make your own archive and treat it as a single extra file that could get wrapped into the archive format of the bootloader if there are multiple extra files. Multiboot2 already has support for multiple files in the form of boot modules. I think grub2 allows reading them from separate files using the |
I was unable to locate anything in either the grub2 code, or mutliple microkenrels on github. (Doesn't mean it doesn't exist) Everything I can find supports loading a single file (such as linux's initrd). And the bootloader does zero parsing on the file, it simply loads it into ram, and feeds a pointer to it to the kerenl. |
I'm not against an archive/ramdisk because it would simplify the code in the bootloader a fair bit. I only implemented "modules" for UEFI, and I'd imagine it's quite a bit harder for BIOS. |
Wow, you learn something new every day! I'll take a stab at it after #301 is merged. Maybe we can get both? |
I'm fine with merging a simple ramdisk first since this is a commonly used feature. We can generalize this to a set of multiple files/modules later if needed. |
Hi. Overall, I am impressed with this project, and I am in great admiration. But I have a question, are there any plans to create a bootloader for other processor architectures, e.g. AARCH64, RISC-V? I'm not saying right away that in this repository, maybe a separate bootloader in a separate repository? If such an idea was possible, could I help in some way?
Thank you in advance for your answer and best regards. 😊
The text was updated successfully, but these errors were encountered: