Re: BOOTBOOT Multi-platform Micro-kernel Loader
Posted: Thu Mar 25, 2021 10:13 am
Hey bzt.
This is a general questions post (very much on-topic, but possibly these are repeated - though I could not find answers), and I apologize in advance if it's a bit too lengthy or feature a few "stupid questions".
I initially fell in love with BOOTBOOT when starting my osdev journey a couple weeks back, but I could not get it to work and had some problems despite reading the docs (maybe I just missed stuff, in such a case feel free to just say so). I ended up using Limine, which I like a lot save for lack of support for anything not x86 .There is a stivale2 ARM bootloader, sabaton , but :
1. It seems to currently be focus on mobile phones , with support for pinephone and progress being made for iPhones. I consider phones to be a meme .
2. It's in Zig, and I don't want to learn another lang just to know what my bootloader does (no offence, Zig is probably fine, just not for me + no binaries).
3. It has some differences from the usual stivale2 protocol in the interface it gives to the kernel (not any significant ones, and that's pretty amazing btw)
Now, I have got some code down and am relooking bootloaders, especially since I like RPi, so have a few questions :
1. Is the 4GiB mmap limit on x86_64 BIOS concrete; is there any hope of change there ? The logic seems to be that it loads in protected mode, so what if I chain-load it from Grub or such a thing ? I'm not too worried about the other features of level 2 , just this one matters to me ATM.
2. Why does BOOTBOOT restrict the mmap to 16GiB on other platforms; is there any hope of change there ?
3. AFAIK, upon last check a few weeks back, the "mkbootimg" binary is making BIOS-only images (tried VBox UEFI and real hw UEFI, didn't boot) ? I would like to generate x86 images that could boot on UEFI + BIOS (I believe the term is El-Torito ?). How can this be done ? Also, how would one use mkbootimg to generate an image for other archs than x86_64 ?
4. I could not understand the spec PDF (it seemed a bit too concise to me ) on how one should go about getting the mmap or dealing with SMP, is this covered elsewhere ?
5. Why does mkbootimg need two configuration files ? Is it necessary to have a JSON + a .txt ? Maybe it is for some reason, I just found it odd.
6. By RasPi 3+ support, do you include the RasPi 400 (the one with the keyboard) ?
7. Is it possible to specify a stack size for the kernel in the BOOTBOOT protocol ?
8. Does BOOTBOOT supply some way to handle SMP cross platform , or is this left to the kernel to handle ?
9. The spec says something about the x86_64 BIOS Initrd is restricted to "~96k" ; is there any hope for change there ?
10. The mmap is said to not be in order; is there any hope for change there ? Because (maybe there is a workaround but) I use an explicit free list allocator with entires in ascending order (similar to the one in K&R unit , and to sort a variable number of mmap entries would itself require a malloc() , but the mmap is needed to do a malloc (ouch).
Thanks a lot for enduring this rather long post, and thanks for putting in the time and effort to make a viable no-nonsense bootloader for those targeting 64-bit RasPi. If the mmap limitations are permanent , I might have to (much to my disliking) have two source files for dealing with the x86 btldr (limine) and the RasPi/ btldr (bootboot) - or arrange some sort of abstraction for the kernel to work regardless of bootloader - so before I did that, I though I should consult you.
This is a general questions post (very much on-topic, but possibly these are repeated - though I could not find answers), and I apologize in advance if it's a bit too lengthy or feature a few "stupid questions".
I initially fell in love with BOOTBOOT when starting my osdev journey a couple weeks back, but I could not get it to work and had some problems despite reading the docs (maybe I just missed stuff, in such a case feel free to just say so). I ended up using Limine, which I like a lot save for lack of support for anything not x86 .There is a stivale2 ARM bootloader, sabaton , but :
1. It seems to currently be focus on mobile phones , with support for pinephone and progress being made for iPhones. I consider phones to be a meme .
2. It's in Zig, and I don't want to learn another lang just to know what my bootloader does (no offence, Zig is probably fine, just not for me + no binaries).
3. It has some differences from the usual stivale2 protocol in the interface it gives to the kernel (not any significant ones, and that's pretty amazing btw)
Now, I have got some code down and am relooking bootloaders, especially since I like RPi, so have a few questions :
1. Is the 4GiB mmap limit on x86_64 BIOS concrete; is there any hope of change there ? The logic seems to be that it loads in protected mode, so what if I chain-load it from Grub or such a thing ? I'm not too worried about the other features of level 2 , just this one matters to me ATM.
2. Why does BOOTBOOT restrict the mmap to 16GiB on other platforms; is there any hope of change there ?
3. AFAIK, upon last check a few weeks back, the "mkbootimg" binary is making BIOS-only images (tried VBox UEFI and real hw UEFI, didn't boot) ? I would like to generate x86 images that could boot on UEFI + BIOS (I believe the term is El-Torito ?). How can this be done ? Also, how would one use mkbootimg to generate an image for other archs than x86_64 ?
4. I could not understand the spec PDF (it seemed a bit too concise to me ) on how one should go about getting the mmap or dealing with SMP, is this covered elsewhere ?
5. Why does mkbootimg need two configuration files ? Is it necessary to have a JSON + a .txt ? Maybe it is for some reason, I just found it odd.
6. By RasPi 3+ support, do you include the RasPi 400 (the one with the keyboard) ?
7. Is it possible to specify a stack size for the kernel in the BOOTBOOT protocol ?
8. Does BOOTBOOT supply some way to handle SMP cross platform , or is this left to the kernel to handle ?
9. The spec says something about the x86_64 BIOS Initrd is restricted to "~96k" ; is there any hope for change there ?
10. The mmap is said to not be in order; is there any hope for change there ? Because (maybe there is a workaround but) I use an explicit free list allocator with entires in ascending order (similar to the one in K&R unit , and to sort a variable number of mmap entries would itself require a malloc() , but the mmap is needed to do a malloc (ouch).
Thanks a lot for enduring this rather long post, and thanks for putting in the time and effort to make a viable no-nonsense bootloader for those targeting 64-bit RasPi. If the mmap limitations are permanent , I might have to (much to my disliking) have two source files for dealing with the x86 btldr (limine) and the RasPi/ btldr (bootboot) - or arrange some sort of abstraction for the kernel to work regardless of bootloader - so before I did that, I though I should consult you.